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

Release tooling: Add label all patch PRs on stable promotions, fix sync of version files #23491

Merged
merged 12 commits into from
Jul 24, 2023

Conversation

JReinhold
Copy link
Contributor

@JReinhold JReinhold commented Jul 18, 2023

What I did

  • Add and use an --all flag to the label-patches script, that labels all pending patch PRs irregardless of if they are found in the git log or not. This is necessary when doing a stable release from next, as that will per definition include all patch PRs. (I did this manually for 7.1.0 per @shilman's request)
  • Documented that you need to update version JSONs manually whenever you're updating the changelog manually
  • Add the "sync next-release to main" step for stable promotions, based on doing it successfully, manually for 7.1.0. disabled, because we might have a better solution that we want to try out first.
  • Fix the sync version JSONs step trying to sync next.json when it should be latest.json

How to test

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "build", "documentation", "maintenance", "dependencies", "other"]

@JReinhold JReinhold self-assigned this Jul 18, 2023
@JReinhold JReinhold added patch:yes Bugfix & documentation PR that need to be picked to main branch build Internal-facing build tooling & test updates labels Jul 18, 2023
@@ -121,11 +121,13 @@ jobs:
if: github.ref_name == 'latest-release'
run: git fetch --tags origin

# when this is a patch release from main, label any patch PRs included in the release
# when this is a stable release from next, label ALL patch PRs found, as they will per definition be "patched" now
Copy link
Contributor Author

@JReinhold JReinhold Jul 18, 2023

Choose a reason for hiding this comment

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

This is technically not true.

If we're doing a stable release from next, and while that is being done and frozen, a new PR is merged to next with the patch label, that PR will not be part of the release, but it will be labeled as "patch:done" here, which is incorrect.

The only way to get around that would be to check that the merge commit of each patch PR found is also found in the git log on next-release. This is not trivial to do, but doable.

WDYT @kasperpeulen @shilman ?

Comment on lines 184 to 197
if: steps.publish-needed.outputs.published == 'false' && steps.target.outputs.target == 'next' && !steps.is-prerelease.outputs.prerelease
working-directory: .
run: |
git fetch origin next-release
git checkout next-release
git pull
git fetch origin main
git checkout main
git pull
git merge --no-commit -s ours next-release
git rm -rf .
git checkout next-release -- .
git commit -m "Sync next-release to main"
git push origin main
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ndelangen came up with a better approach, because this doesn't get all of next history into main, it squashes it all into one commit.

Instead we could create a branch from main, called release-7.1, and then reset main to point to next and force push.
This would ensure that the history of main is the one from next - which is correct - and we'd still be able to find the history for 7.1 by looking at the release-7.1 branch, because the commits are still intact.

Copy link
Contributor

@kasperpeulen kasperpeulen left a comment

Choose a reason for hiding this comment

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

LGTM

@JReinhold JReinhold merged commit 6850a8f into next Jul 24, 2023
@JReinhold JReinhold deleted the fix-release-promotions branch July 24, 2023 08:13
storybook-bot pushed a commit that referenced this pull request Jul 24, 2023
Release tooling: Fixes from stable promotion

(cherry picked from commit 6850a8f)
storybook-bot pushed a commit that referenced this pull request Jul 24, 2023
Release tooling: Fixes from stable promotion

(cherry picked from commit 6850a8f)
@JReinhold JReinhold changed the title Release tooling: Fixes from stable promotion Release tooling: Add label all patch PRs on stable promotions, fix sync of version files Jul 24, 2023
@github-actions github-actions bot added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jul 24, 2023
@github-actions github-actions bot mentioned this pull request Jul 26, 2023
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Internal-facing build tooling & test updates ci:normal patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants