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

Add canary release workflow 🐥 #1178

Merged
merged 3 commits into from
Feb 8, 2024
Merged

Add canary release workflow 🐥 #1178

merged 3 commits into from
Feb 8, 2024

Conversation

sndrs
Copy link
Member

@sndrs sndrs commented Feb 7, 2024

What are you changing?

Adds a canary release option to PRs.

Why?

So we can test packages in external consumer codebases (@guardian/transparency-consent do this a lot, so it's needed for #1128).

How does it work?

It is based heavily on similar workflows in guardian/commercial#797 and guardian/consent-management-platform#849 (but with some slight differences):

  1. adding the 🐥 Canaries label to a PR will trigger the release of canary versions of all packages with waiting changesets1
  2. while the label is present, pushing changes to the PR head branch will also release a new set of canaries (so you don't have to remove and add it continually)
  3. removing the label will stop new releases (until you add it back)

Demo

You can see it running on this PR from #1178 (comment) onwards.

Footnotes

  1. This is maybe not expected, but also it's not obvious how you'd get round this. How do you know which package with unreleased changes the user wants to test? It feels like overkill but I think it kind of makes sense.

@sndrs sndrs self-assigned this Feb 7, 2024
@sndrs sndrs requested a review from a team as a code owner February 7, 2024 18:37
Copy link

changeset-bot bot commented Feb 7, 2024

⚠️ No Changeset found

Latest commit: 9530683

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

github-actions bot commented Feb 7, 2024

Tip

Once this PR is ready to go, add the run_chromatic label to run the Chromatic tests.

This saves us a lot of money by not running the tests before we need them.

@sndrs sndrs linked an issue Feb 7, 2024 that may be closed by this pull request
@sndrs sndrs added the 🐥 Canaries Triggers canary releases of any packages with changesets waiting. label Feb 7, 2024
@sndrs sndrs requested review from a team as code owners February 7, 2024 18:51
Copy link
Contributor

github-actions bot commented Feb 7, 2024

Note

The following canaries were published to NPM:

🐥

@sndrs sndrs removed the 🐥 Canaries Triggers canary releases of any packages with changesets waiting. label Feb 7, 2024
@sndrs sndrs added the run_chromatic Runs chromatic when label is applied label Feb 7, 2024
@sndrs sndrs changed the title Add canary release workflow Add canary release workflow 🐥 Feb 7, 2024
Copy link
Contributor

@joecowton1 joecowton1 left a comment

Choose a reason for hiding this comment

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

nice work!

@sndrs sndrs added 🐥 Canaries Triggers canary releases of any packages with changesets waiting. and removed 🐥 Canaries Triggers canary releases of any packages with changesets waiting. labels Feb 8, 2024
@sndrs sndrs merged commit dcaa821 into main Feb 8, 2024
40 checks passed
@sndrs sndrs deleted the sndrs/canaries branch February 8, 2024 11:31
@sndrs
Copy link
Member Author

sndrs commented Feb 9, 2024

currently this adds all releases to git, its possible this may change changesets/action#141 (which would be great)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run_chromatic Runs chromatic when label is applied
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add changesets beta releases process
2 participants