- Status: accepted
- Deciders: Chris Simon
- Date: 2022-01-07
Use the semantic-release package to manage version changes, change logs and release activities. Use branches for feature development and merge to main
when a feature is complete.
When ready to cut a release, manually trigger a GitHub Actions workflow which will call semantic-release to create a GitHub Release. A separate GitHub Actions workflow will be triggered from the Github Release being published, and will do a matrix strategy build to generate platform-specific builds and publish them to the VSCode marketplace.
Since semantic-release
doesn't support major versions < 1, a v1.0.0 tag will be added manually to the latest manually created release to serve as the baseline for the first semantic-release
managed release.
There are two areas of Release management that are determined in this ADR:
A process needs to be created to determine when a version is ready for release and initiating the release activities for that version.
When a release is triggered, a series of steps needs to be actioned:
- Validating the proposed release (automated tests)
- Compiling and packaging the Language Server for all target platforms & architectures
- Preparing release notes
- Committing & pushing changes to the version number (package.json) and changelog into the repo, tagging the commit with the release
- Packaging the Visual Studio Code extension (including the new version number in the package)
- Creating a github release, including the packages as files attached to the release
- Uploading the extension packages (1 per target platform) to the VS Code Extension marketplace(s)
- Processes that require manual steps are likely to be inconsistently executed
- There is a preference to invest time in developing software unique to Contextive and leveraging existing systems and tools for common/generic functionality
- There is currently no need for a pre-release or beta channel (this may change in the future)
Key decision drivers are:
- Amount of manual effort (lower the better)
- Investment in custom build of tooling or automation (lower the better)
- Alignment with industry standards/practices
- manual
- Commits to
main
branch - Commits to a
release
branch - Tag convention
- Manual
- Custom automation
- semantic-release
- Manually trigger a workflow
- Initial experiments with releasing off every commit to
main
indicated that there would be too high a release frequency, prompting too many updates and a change log that doesn't group related changes. - Experiments with releasing by merging to a
release
branch shows that the manual effort in creating the merge and the merging the release commit back tomain
is unnecessarily excessive. - Experiments with releasing by manually triggering a workflow linked to
main
indicated it is the best balance of release control and minimal effort. - Commits to
main
are to be done by squash merges from a merge request from a feature branch, with the squash merge commit message using conventional commits
- Initial experiments with releasing off every commit to
- Release Process managed by semantic-release
- because it provides repeatable, industry conventional approaches and already includes plugins for all the services currently needed.
- the release process will update changelogs and embedded versions, and commit those changes into the repo with a
[skip ci]
commit message and tagged with the release
- Maintainers will have control over release schedule - in the future, this may be further automated
- All mechanisms involved in releasing will be fully automated, making releasing a very simple task (simply merge from
main
torelease
). - Semantic-release necessitates the use of conventional commits which will improve the quality and consistency of git commit logs
- Change logs/release notes will be based on git commit history automatically
- Although there are tools to enforce the conventional commit approach when committing locally, squash merges of merge requests via the github UI do not allow to enforce a commit message structure.
- semantic-release is tailored for javascript packages. Contextive expects to have other types of packages in the future (e.g. Visual Studio extension) which may not be as amenable to it's use. This will need to be revisited when that extension is added.
A human clicks a button to initiate a release from the current head of a nominated branch.
- Good, because full control over the release schedule
- Bad, because releases may be inconsistent
- Bad, because extra effort spent determining the need for a release and initiating a release
Any commit to main
will initiate a release process.
- Good, because releases are predictable & consistent
- Good, because the process is simple and easy to understand
- Bad, because there may be multiple commits to
main
in a day, which may create too many releases, negatively affecting users with automatic updates turned on
Any commits to a dedicated release
branch will initiate a release process
- Good, many commits can accumulate on
main
before being released, so the release cadence can be more measured than the commit cadence - Bad, because releases may be inconsistent
- Bad, because extra effort spent determining the need for a release and initiating a release
- Bad, because the release effort is higher - merge from
main
torelease
and then back fromrelease
tomain
to keep release tags inmain
's history
- Bad, because lots of effort, which will likely lead to infrequent releases
- Bad, because likely to lead to inconsistent or incorrect steps
- Good, because less effort to create a release
- Bad, because extra effort to create the custom automation
- Bad, because the custom automation will need maintaining
- Good, because less effort to create a release
- Good, because plugins already exist to carry out all the required steps, so less effort to configure
- Good, because it enforces conventional commits, improving commit history quality
- Bad, because uncertain how it will work with non-JavaScript package types (e.g. Visual Studio extension)