Sourcegraph releases
This document describes how we release Sourcegraph.
Release policies
Release Schedule
As of March 2023, Sourcegraph releases features quarterly (see RFC 770) The 2023-2024 schedule is follows (version numbers are subject to change):
Version | Feature Freeze Date | Code Freeze Date | Release Date |
---|---|---|---|
5.3 | January 31, 2024 | February 12, 2024 | February 14, 2024 |
These releases may require manual migration steps.
Current patch schedule
Patch date |
---|
October 18, 2023 |
November 01, 2023 |
November 15, 2023 |
November 29, 2023 |
December 13, 2023 |
January 10, 2024 |
January 24, 2024 |
Releases are the responsibility of the Release Guild, and are performed by a release captain selected from the guild.
Feature releases may be in a minor version (3.0.0
-> 3.1.0
), or a major version (3.0.0
-> 4.0.0
). Releases are published with semantic versioning syntax, though Sourcegraph releases do not necessarily follow the versioning semantics.
Selecting Release Dates
Generally speaking when selecting release dates consider the following criteria:
- Prefer tuesdays near the middle of the month, giving plenty of time during the week to respond to issues that may arise
- Avoid releasing anywhere near the end of November or December to avoid common holiday seasons
A release refers to a minor version increase of Sourcegraph (e.g. 3.0.0 -> 3.1.0).
Patch releases
A patch release refers to a patch version increase of Sourcegraph (e.g. 3.0.0
-> 3.0.1
).
Generally speaking patches will only include bug fixes for previously released features. In some occasions we may release improvements to address issues that may not technically a bug fix, and in some occasions we may backport features provided they are:
- Behind a feature flag
- Low risk and well tested (with flag on and flag off)
Patch Schedule
Patches are scheduled regularly throughout the release quarter once every other week, with 5 patches per release cycle. For example if a release was scheduled on June 13, 2023, the patch schedule would be:
Patch Date |
---|
These releases never require any manual migration steps.
We will also release patches out of band from the schedule above if there are urgent incidents to resolve, such as a security incident or other critical issue affecting the usage of Sourcegraph.
Requesting a patch
- To request a patch release, please fill out a patch release request.
- Notify the release guild (#ask-release-guild)
Key concepts and components
This section documents the process used to create releases at Sourcegraph.
Release captain
The release captain is responsible for managing the release process and ensuring release is executed successfully. The release captain may delegate work to other teammates, but such delegation does not absolve the release captain of their responsibility to ensure that delegated work gets done.
The release captain should create a tracking issue using the release issue template at the beginning of the release cycle.
Release captain responsibilities are currently owned by the Release guild.
Release tooling
The Sourcegraph release tool is used to generate releases as associated materials (such as tracking issues). It leverages the following issue templates, which list all individual steps that needs to be performed, for each type of release:
Release branches
Each major and minor release of Sourcegraph has a long lived release branch (e.g. 3.0
, 3.1
).
Individual releases are tagged from these release branches (e.g. v3.0.0-rc.1
, v3.0.0
, v3.0.1-rc.1
, and v3.0.1
would be tagged from the 3.0
release branch).
To avoid confusion between tags and branches:
- Tags are always the full semantic version with a leading
v
(e.g.v2.10.0
) - Branches are always the dot-separated major/minor versions with no leading
v
(e.g.2.10
).
Development always happens on main
and changes are cherry-picked onto release branch as necessary with the approval of the release captain.
Example
Here is an example git commit history:
- The release captain creates the
3.0
release branch at commitB
. - The release captain tags the release candidate
v3.0.0-rc.1
at commitB
. - A feature is committed to
main
in commitC
. It will not ship in3.0
. - An issue is found in the release candidate and a fix is committed to
main
in commitD
. - The release captain cherry-picks
D
frommain
into3.0
. - The release captain tags
v3.0.0
on the3.0
release branch. - Development continues on
main
with commitsE
,F
,G
,H
. - Commit
F
fixes a critical bug that impacts 3.0, so it is cherry-picked onto the3.0
release branch andv3.0.1
is tagged. - The release captain (different person) for 3.1 creates the
3.1
release branch at commitH
and a new release cycle begins. - Commit
J
fixes a critical bug that impacts both 3.0 and 3.1, so it is cherry-picked into both3.0
and3.1
release branches and new releases are tagged (v3.0.2
,v3.1.2
).
A---B---C---D---E---F---G---H---I---J---K---L (main branch)
\ \
\ `---v3.1.0-rc.1---I'---v3.1.0---J'---v3.1.2 (3.1 release branch)
\
`---v3.0.0-rc.1---D'---v3.0.0---F'---v3.0.1---J'---v3.0.2 (3.0 release branch)
Issues
This section documents how do we deal with issues that are found during the release process.
Blocking
The release always ships on time, even if it’s missing features or bug fixes we hoped to get in (why?).
There are only three kinds of issues that are eligible to block a release:
- Issues that literally prevent us from tagging a release (i.e. our CI logic to produce builds from git tags is broken).
- Issues that fundamentally break our product for a majority of our customers and don’t have acceptable workarounds.
- Critical security regressions from the previous release.
Only the release captain can label something as release blocking.
The release captain has unlimited power to make changes to the release branch to resolve release blocking issues. As soon as a release blocking issue is identified, the release captain should decide the least risky way to resolve the issue as soon as possible. A good default action is to identify and revert offending commits from the release branch. In the worst case, this could involve recreating the release branch from an earlier commit on main
. Project owners can work on main
to fix the issue, and if the issue is resolved in time, revert the revert and cherry-pick the fix on the release branch.
Non-blocking
Most issues are non-blocking. Fixes to non-blocking issues can be fixed in main
by the code owner who can then git cherry-pick
those commits into the release branch with the approval of the release captain. Alternatively, broken features can be reverted out of the release branch or disabled via feature flags if they aren’t ready or are too buggy.
CHANGELOG.md
When releasing a new version, the Release Captain may need to manually update the CHANGELOG.md. Follow the instruction below:
- Check past entries in CHANGELOG.md to understand the changelog format.
- Create a new H2 title named
{major}.{minor}.{patch}
(the new version) after theUnreleased
section if it doesn’t already exist. - Copy all changelog entries of the commits belong to this patch release into the new H2 title
## {major}.{minor}.{patch}
, grouped into the types they were originally in (e.g.### Added
,### Changed
,### Fixed
,### Removed
).
Support for older versions
At Sourcegraph, we’re committed to providing the best support possible for our users. As such, we offer support for the latest version (N) and its previous major version (N-1). For instance, if version 5.x is the most recent release, we provide support for both 5.x and 4.x. However, once we release a new major version (e.g., 6.x), we will discontinue support for 4.x.
Please note that if you encounter any issues that can be resolved with an upgrade or are caused by using an outdated version, we will be unable to provide support. We recommend keeping up-to-date with the latest features and improvements to ensure the best experience.
Cody clients and backwards compatibility
Cody client extensions, such as the VS Code extension, need to maintain backwards compatibility with Sourcegraph servers back to 5.0.0. The Sourcegraph server has no backward compatibility requirements with respect to the clients. However, the server should try to maintain backwards compatibility with clients on a best effort basis.
Why only back to 5.0 instead of our standard policy of latest version and previous major version? That will eventually be our policy. However, since Cody was new to 5.0.0, it’s a necessary exception to that policy.
Minor release process
1) Start a minor release
Major and minor releases are released on a fixed schedule, see when we release.
2) Minor release tracking issue
The tracking issue for the current minor release is created as a part of the post-release step from the previous minor release. Learn more from the release issue template.
The Release Captain should review and follow the instruction in the release tracking release for the next steps. At a high level, it includes the following steps:
- Build a release candidate and verify CI passes
- Publish final images
- Update documentation
- Update references of the image tag to the new version using batch change
3) Wrapping up
Follow the instruction from post-release in the release tracking issue to wrap up the release and schedule the next minor release.
Patch release process
You can reference our patch release process recording on Google Drive.
1) Kickstart a patch release using the Sourcegraph release tool
CE or the products team will start requesting a patch release by submitting a patch release request. Learn more from the patch release issue template.
Upon the Delivery team or the Release Captain receives the patch release request and we have decided to roll out a new patch release, the Release Captain should follow the instruction in the patch release request issue to kickstart the patch release process. The instruction is located at the bottom of the patch release request.
2) Patch release tracking issue
The Sourcegraph release tool creates a patch release tracking issue which contains a list of action items the Release Captain has to perform. Learn more from the patch release issue template.
The Release Captain should review and follow the instruction in the patch release tracking release for the next steps. At a high level, it includes the following steps:
- Build a release candidate and verify CI passes
- Publish final images
- Update documentation and changelog
- Update references of the image tag to the new version using batch change
3) Revisit patch request issue
Now it’s a good time to go back to the original patch release request and close it.