-
Notifications
You must be signed in to change notification settings - Fork 75
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: deploy hotfixes as prerelease #9469
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jcfranco
approved these changes
May 31, 2024
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.
✨🦾🤖✨
Closing in favor of #9514 |
benelan
added a commit
that referenced
this pull request
Jun 10, 2024
**Related Issue:** #9469 will be closed in favor of this PR ## Summary Make CI changes for a new release workflow that supports hotfixes as patch bumps without causing friction with the versioning and changelog generation setup. - All PRs are switched to target the `dev` branch instead of `main` - When it's time for a release, create a branch off of `dev`, open a PR targeting `main`, and use the [rebase merge](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/about-merge-methods-on-github#rebasing-and-merging-your-commits) method when installing. - Install the Release Please PR generated via the step above, which creates the github releases and git tags on `main` (where they currently are for all previous releases) and deploys to NPM. - Checkout a branch off of and create/install a PR to `dev` containing the cherry-picked the release commit (changelog and package.json version modifications) from `main`. - Continue development on `dev`, where `next` releases are deployed from. - Commits for a hotfix get cherry-picked from `dev` to `main` as needed. - When its time for a hotfix release, install the Release Please PR into `main` and cherry-pick the release commit back to `dev` - Cycle continues... ## Notes - The default branch will be changed to `dev` and `main` will be our release branch, since that's where all of the tags already exist. - We need to rebase merge `dev` to `main` due to our changelog generation and versioning setup: - squashing won't work, since all of the commits need to be on `main` - a normal merge won't work, since a linear history is required - There won't be duplicate commits from syncing back and forth because rebasing automatically drops cherry-picked commits. - Unfortunately, GitHub doesn't support per-branch merge methods, so we will need to remember to: - enable rebase-merge method in the repo settings ![image](https://github.com/Esri/calcite-design-system/assets/10986395/9fa8be42-7923-47f9-b2d8-df65416e88cc) - switch the method to rebase-merge in the PR when installing changes from `dev` to `main` ![image](https://github.com/Esri/calcite-design-system/assets/10986395/fcbfa86d-950f-459f-8ecd-e468d4373415) - disable rebase-merge in the repo settings
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
chore
Issues with changes that don't modify src or test files.
skip visual snapshots
Pull requests that do not need visual regression testing.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Change the hotfix deployment CI to use pre-releases, e.g.
2.9.0-hotfix.0
.Why though?
The need to publish hotfixes as pre-releases is related to Calcite's continuous integration setup. Calcite uses Release Please, which requires a linear git history to properly handle versioning and changelog generation. Release Please finds the most recent GitHub release's tag and uses it to determine the version bump (major, minor, patch) and which commits to add to the changelog.
In Calcite's workflow, the commits on the
hotfix
branch are synced tomain
after a hotfix is released. If hotfixes are released as semver patch bumps, Release Please will ignore all the commits that happened before the hotfix landed onmain
, which will omit items from the changelog and potentially release as the wrong version.For example, let's say a
v2.8.0
latest release was deployed, av2.8.1
hotfix was needed/deployed, and then a newlatest
release is ready to deploy. This is the state of the git history in the example:Git history generation script for example
The upcoming latest release should be deployed as
v2.9.0
and the changelog section should have entries for the commits that landed onmain
but nothotfix
.The changelog should look like this
However, Release Please will stop looking at commits once it finds the most recent
latest
release tag, in this case thev2.8.1
hotfix. This means the release will be deployed asv2.8.2
, since there is one "fix" commit sincehotfix
was synced tomain
.The changelog will incorrectly look like this
Calcite's solution to this issue is deploying hotfix
v2.8.1-hotfix.0
instead ofv2.8.1
,v2.8.1-hotfix.1
instead ofv2.8.2
, etc., because GitHub Releases aren't created for pre-releases. This means Release Please will ignore their tags, so the version bump and changelog generation will be correct.