Release tooling: Add label all patch PRs on stable promotions, fix sync of version files#23491
Conversation
| 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 |
There was a problem hiding this comment.
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 ?
| 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 |
There was a problem hiding this comment.
@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.
Release tooling: Fixes from stable promotion (cherry picked from commit 6850a8f)
Release tooling: Fixes from stable promotion (cherry picked from commit 6850a8f)
What I did
--allflag to thelabel-patchesscript, 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 fromnext, as that will per definition include all patch PRs. (I did this manually for 7.1.0 per @shilman's request)Add the "syncdisabled, because we might have a better solution that we want to try out first.next-releasetomain" step for stable promotions, based on doing it successfully, manually for 7.1.0.next.jsonwhen it should belatest.jsonHow to test
Checklist
MIGRATION.MD
Maintainers
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli/src/sandbox-templates.ts["cleanup", "BREAKING CHANGE", "feature request", "bug", "build", "documentation", "maintenance", "dependencies", "other"]