question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for canary releases based on changesets?

See original GitHub issue

Hi there!

We at The Guild are working with changesets extensively. One of the solution we implement on top of the current implementation of changesets is the ability to easily connect canary/alpha releases, based on active changesets.

To do that, we are applying a minimal patch file to changesets code, in order to allow flexibility in the release flow.

I’m sharing an overview of the technical changes we are doing today, and I can also create a PR if this makes sense. I was thinking of a workflow of changesets version canary in the CLI.

The canary / alpha workflows

  1. To release a canary based on changesets, we are scanning and reading all relevant changesets that are currently available in the repo.
  2. Then, we run assembleReleasePlan and builds the complete plan as changesets plan to release it (on the next release planned)
  3. Then, we modify the version to be {plannedVersion}-canary.{COMMIT_ID}
  4. Run applyReleasePlan to apply the change temporarily
  5. Run changesets publishing script with --tag canary

Here’s the script we are using: https://github.com/B2o5T/graphql-eslint/blob/master/scripts/canary-release.ts

This way - changesets are used as the source of truth to the packages that actually was changed and needs to be released - and we apply an empheral change to the versioning before publishing it to npm.

Allowing non-ranged publishing

As part of the canary release workflows, we want to make sure to get rid of all possible ranges (^ / ~) in the internal packages dependencies, to make sure to get the exact versions of the canary changes.

To do that, we added a new argument to versionPackage function, called ignoreRange

Reference: https://github.com/B2o5T/graphql-eslint/blob/master/patches/%40changesets%2Bapply-release-plan%2B6.0.0.patch#L19

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:6
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
Andaristcommented, Jun 30, 2022

It might actually be somewhat nice to have those generated because you might always easily check in the package itself what kind of a change has been published in a given snapshot release.

2reactions
emmatowncommented, Jun 29, 2022

This sounds like snapshot releases (or at least the intent behind them).

{plannedVersion}-canary.{COMMIT_ID}

Using plannedVersion instead of 0.0.0 can be done with ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.useCalculatedVersionForSnapshots though you can’t currently use a commit.

@Andarist I’m kinda thinking we should have a “snapshot version template” config option,

So you could make have some variables that we provide like:

  • tag
  • commit
  • timestamp
  • plannedVersion (v not sure about this name)

and the default would be 0.0.0-{tag}-{timestamp} to align with the current behavior and you could express whatever and it would replace ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH.useCalculatedVersionForSnapshots and #830.

Allowing non-ranged publishing

Snapshot releases should definitely use exact versions for dependencies (I’m surprised that’s not already true tbh). Do you want to create a PR for that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Comprehensive Guide to Canary Releases | by Daniel Bryant
A canary release is a software testing technique used to reduce the risk of introducing a new software version into production by gradually...
Read more >
Releasing prerelease versions without modifying package ...
There should be a way to publish prerelease versions without modifications to package.json files. This way, only the regular publishes on master ...
Read more >
What Is Canary Deployment? - Semaphore CI
A canary release is an early build of an application. Splitting stable and development branches is a widespread strategy in the open-source ...
Read more >
CanaryRelease - Martin Fowler
Canary release is an application of ParallelChange, where the migrate phase lasts until all the users have been routed to the new version....
Read more >
The Salesforce Release Train: A Practical Approach ... - Toptal
It supports create , read , update , and delete methods. You can use Change Sets, the Force.com IDE, and the Ant Migration...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found