-
Notifications
You must be signed in to change notification settings - Fork 12
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
ci: automatic releases #166
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files |
f46892c
to
c5bb14d
Compare
@ChALkeR Can you please review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK (let's wait for @ChALkeR before merging)
@RyanZim we need an npm automation token with access to We also still need a I can't do any of this and I also can't look at the repo configuration since I don't have admin access |
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: yarn --frozen-lockfile | ||
- run: yarn --frozen-lockfile --ignore-engines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are installing dev dependencies here as well and semantic-release requires node >= 18, so this is required to silence yarn about the engine mismatch
I'm unsure why exactly this would be helpful. The main chores of this lib are not releases per se, but logic fixes, and autorelease functionality adds some amount of complexity. Which could be more than the release complexity it reduces. A more helpful setup would be to always (when actual) have an PR which updates json-schema-test-suite gitmodule to latest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking visibly until the exact mechanism is figured out that doesn't degrade security.
#165 is understandable and should be fixed, but this approach just makes things worse at the current state (explained via other channels). It can make things better if configured properly though. |
the whole premise of this PR is to have an adequate branch protection rule. I don't have admin access and cannot see what's currently configured. You will have to take the lead here, but some suggestions:
|
aa4e058
to
26ef5bf
Compare
@sparten11740 Yeah, a proper branch configuration and removing npm users write access first would unblock this. |
@@ -12,7 +12,7 @@ jobs: | |||
- uses: actions/checkout@v2 | |||
- uses: actions/setup-node@v1 | |||
with: | |||
node-version: '14' | |||
node-version: 18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's file a separate PR for this (and bump that to 20)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's either this or running yarn install with --ignore-engines
. I prefer the node version update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to 20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are actually getting test failures here in node 20, reverted back to 18
.github/workflows/nodejs.yml
Outdated
@@ -14,12 +14,12 @@ jobs: | |||
node-version: [10.x, 14.x, 16.x, 18.x] | |||
|
|||
steps: | |||
- uses: actions/checkout@v2 | |||
- uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do this in a separate PR, unclear what the differences are yet and this is an orthogonal change
on: | ||
push: | ||
branches: | ||
- master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above comments
perhaps we should create a more protected release
branch and publish from it? Making releases separate prs to the release branch and require them to have more than 2 reviews
I don't see much of an advantage in that, the amount of time for the changes to get released would probably be the same, if not even more. The reviewing effort increases and we potentially have to backport fixes from issues found in the release PRs. |
@RyanZim can you create a new environment named |
c9969f0
to
89bf14b
Compare
@ChALkeR, Ryan is not admin. Would you mind doing this? He'll keybase the token |
for now, i vote we keep the merge policy for master strict and do auto-releases and revisit this later. Otherwise we’ll have to review release PRs, which is extra pain (plus we’ll have to re-review everything merged since the previous release if we don’t trust master anymore) the DX pain on master only exists when there are multiple PRs open at the same time. We can potentially improve this in the future as follows (discussed in DM with @sparten11740):
the above setup could be useful for any of our repos, but isn’t a high priority atm |
Done |
20ec800
to
5cec034
Compare
what's the plan here? |
Automates releases by releasing on merge to master for relevant commit types (
feat
,fix
,perf
, and breaking changes).If we want to useDecided to use@semantic-release/git
, which we should, we'll have to use a PAT of the machine account and empower that machine account to bypass branch protection rules. The plugin is responsible for updating the version inpackage.json
and adding theCHANGELOG.md
!@semantic-release/github
instead for tighter security so we don't have to allow the machine user to bypass the branch protection rule. This will result in stale package versions in git, but still have the correct version in the published package.Todos:
NPM_PUBLISH_TOKEN
secret that has an NPM automation token for the account that will get exclusive access to@exodus/schemasafe
Testplan
A first sanity check of the configuration can be done using the dry run mode locally.
yarn release -d
. verifyecho $?
returns0
and you see some nice release notes in the stdout of the first commandThis doesn't test the full integration such as correctly configured PAT's and branch protection rules. We'll only be able to test these when this PR gets merged