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: Defer version bumping to the publish step #23393

Merged
merged 13 commits into from
Jul 12, 2023

Conversation

JReinhold
Copy link
Contributor

@JReinhold JReinhold commented Jul 11, 2023

I will manually cherry-pick this back to main in follow-up PR

What I did

This PR changes the release flow to defer the actual version bump to the publish step instead of when preparing the release PRs. This makes it possible to run CI on the release PRs. It will still calculate the version bump up front.

The release:version script now take two additional flags:

  • --deferred: This will keep the same bumping logic, except instead of bumping the versions in all the packages it will simply set a "deferredNextVersion" property in code/package.json and exit.
  • --apply: This will apply the version set at "deferredNextVersion", by actually bumping all the package's versions as usual. It's invalid to use this flag with --release-type or --pre-id, since --apply will not do any increment calculation.

The release preparation workflows then uses --deferred to set the deferred version.
The publish workflow will look for the "deferredNextVersion" and if it is set, it will run release:version with --apply and commit the changes. It will not be set in cases where patch releases don't contain any releasable changes.

This deferred workflow doesn't make much sense to run locally, and it's not necessary to do so, but it can be if you want to.

How to test

  • cd scripts
  • yarn release:version --release-type preminor --pre-id test
  • See that "deferredNextVersion" is not set in code/package.json
  • yarn release:version --apply
  • See that all packages have been bumped and that "deferredNextVersion" is removed again

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

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

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

@JReinhold JReinhold marked this pull request as draft July 11, 2023 06:01
@JReinhold JReinhold added the build Internal-facing build tooling & test updates label Jul 11, 2023
@JReinhold JReinhold marked this pull request as ready for review July 11, 2023 06:29
@JReinhold JReinhold self-assigned this Jul 11, 2023
@JReinhold JReinhold requested a review from shilman July 11, 2023 06:29
@shilman shilman changed the title Releaase tooling: Defer version bumping to the publish step Release tooling: Defer version bumping to the publish step Jul 11, 2023
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Great work @JReinhold 🙌 Looks great

@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Jul 11, 2023
@JReinhold JReinhold merged commit a930066 into next Jul 12, 2023
@JReinhold JReinhold deleted the delay-version-bump branch July 12, 2023 08:14
@github-actions github-actions bot mentioned this pull request Jul 12, 2023
15 tasks
JReinhold added a commit that referenced this pull request Jul 12, 2023
Release tooling: Defer version bumping to the publish step

(cherry picked from commit a930066)
JReinhold added a commit that referenced this pull request Jul 12, 2023
…oning

Release tooling: Defer version bumping to the publish step - Cherry picking #23393
storybook-bot pushed a commit that referenced this pull request Jul 12, 2023
Release tooling: Defer version bumping to the publish step

(cherry picked from commit a930066)
@github-actions github-actions bot mentioned this pull request Jul 12, 2023
27 tasks
storybook-bot pushed a commit that referenced this pull request Jul 12, 2023
Release tooling: Defer version bumping to the publish step

(cherry picked from commit a930066)
storybook-bot pushed a commit that referenced this pull request Jul 12, 2023
Release tooling: Defer version bumping to the publish step

(cherry picked from commit a930066)
@github-actions github-actions bot added patch:done Patch/release PRs already cherry-picked to main/release branch labels Jul 12, 2023
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 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