Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing and configuring Auto #476

Merged
merged 7 commits into from
Oct 17, 2022
Merged

Conversation

nathanstilwell
Copy link
Contributor

@nathanstilwell nathanstilwell commented Oct 10, 2022

Installing Auto (https://intuit.github.io/auto/index) for automated publishing. Since this repo has a number of labels already, I disabled the default labels and added custom entries to match the labels that were created.

I created a basic workflow for releasing that doesn't have anything lerna specific (although lerna is used internally with auto) but run the release npm script (which is auto shipit --dry-run -v for now).

Testing locally I ran into an issue where an lerna error will be thrown. This issue seems to be known (see
intuit/auto#2129) with a workaround by adding a "registry" entry to lerna.json (although seems to continue to fail with --dry-run option).

For the moment, I expect the Release workflow to fail. I'm looking to get this PR merged to continue testing.

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @cockroachlabs/[email protected]
npm install @cockroachlabs/[email protected]
npm install @cockroachlabs/[email protected]
npm install @cockroachlabs/[email protected]
# or 
yarn add @cockroachlabs/[email protected]
yarn add @cockroachlabs/[email protected]
yarn add @cockroachlabs/[email protected]
yarn add @cockroachlabs/[email protected]

Installing Auto (https://intuit.github.io/auto/index) for automated
publishing. Since this repo has a number of labels already, I disabled
the default labels and added custom entries to match the labels that
were created.

I created a basic workflow for releasing that doesn't have anything
lerna specific (although `lerna` is used internally with `auto`) but run
the `release` npm script (which is `auto shipit --dry-run -v` for now).

Testing locally I ran into an issue where an lerna error will be thrown.
This issue seems to be known (see
intuit/auto#2129) with a workaround by adding
a "registry" entry to lerna.json (although seems to continue to fail
with --dry-run option).
@nathanstilwell nathanstilwell marked this pull request as ready for review October 10, 2022 21:11
@nathanstilwell nathanstilwell requested a review from a team as a code owner October 10, 2022 21:11
After testing the lerna comands locally, I'm removing `--dry-run` to
test publishing canary versions in a pull-request.
Copy link
Contributor

@sjbarag sjbarag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good start! We'll need to be mindful of https://intuit.github.io/auto/docs/welcome/quick-merge (and especially make sure the maintainers here are aware of that), but we'll see how things go and if that becomes an issue.

Thanks for getting this of the ground!

Comment on lines 30 to 32
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these personal tokens from your account, or do they map back to a particular github/npm account? It may be handy to add a comment pointing to those accounts :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generated both of these tokens. Mostly to get started, but later realized that NPM tokens can only be generated from an individual account (and maybe Github ones as well? they may have organizational tokens now). Since secrets are added in the Github settings anyone with repo access can edit them. I can add comments for the moment to document. I will also touch base with dev-inf to see how they want to manage this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, following the devinf process for getting tokens created. Tokens will eventually be generated an managed by devinf, but they (hopefully) be in the same place so shouldn't require a code change here.

.github/workflows/release.yml Show resolved Hide resolved
Comment on lines +34 to +35
yarn install --frozen-lockfile
yarn run release
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 are we missing a "build" step here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to look at this in testing. We have a prepare script in the packages that need to be build before publishing so I'm not sure it's strictly necessary to have an explicit build step. But a comment probably won't go amiss.

]
],
"repository": "cockroachdb/ui",
"author": "Cockroach Labs <[email protected]>",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to get more folks into this group :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a google group so I believe any CRL labs employee is free to join. But I'll check to see if I can add some folks explicitly.

Nathan Stilwell added 4 commits October 12, 2022 11:22
Using `prepare` npm lifecycle script for all packages (as opposed to
prepublishOnly) and consistently using `npm-run-all` for any package
that has multiple scripts to run during `prepare`.
@nathanstilwell nathanstilwell force-pushed the auto-install-and-setup branch 5 times, most recently from 487d555 to bd3ecdd Compare October 13, 2022 23:05
@nathanstilwell nathanstilwell added the 🤖 patch Increment the patch version when merged label Oct 17, 2022
@nathanstilwell nathanstilwell merged commit 603b1f0 into master Oct 17, 2022
@nathanstilwell nathanstilwell deleted the auto-install-and-setup branch October 17, 2022 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 patch Increment the patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants