The user-facing documentation lives in sourcegraph/website. Quick links:
- https://github.com/sourcegraph/website/blob/master/data/docs/server/docs.md
- https://about.sourcegraph.com/docs/server/
This file documents information relevant to developers at Sourcegraph.
-
Update CHANGELOG on
master(even if the release will be cut from a different branch).- If this is a major or minor release, move any
Unreleased changesunder their own section for the newVERSIONyou are releasing. - If this is a patch release, create a new section for the
VERSIONyou are releasing and selectively move changelog items fromUnreleased changesto this section.
Remove any empty sections in the changelog.
- If this is a major or minor release, move any
-
Commit and
git pushthis change directly to upstreammaster.
- New major releases (e.g.
v3.0.0) should be tagged frommaster. Once you have tagged the release, create a long lived branch from that tag for patches to that release (e.g.3.0). - New minor releases (e.g.
v3.1.0) should be tagged frommaster. Once you have tagged the release, create a long lived branch from that tag for patches to that release (e.g.3.1). - New patch releases (e.g.
v3.1.1) should be tagged from the existing patch branch for the release being patched (e.g.3.1).- Commits necessary for a patch release are cherry-picked from
masterinto the patch branch before tagging a release. - Do NOT commit any fixes or features into a patch release that are not yet in
master. Otherwise, you will end up breaking the validity of the changelog, as such orphaned updates will be silently regressed in the next major/minor release.
- Commits necessary for a patch release are cherry-picked from
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).
Push your release branch upstream. Remember the commit hash. This is the commit you will tag as the official release if testing goes well.
If you are creating a patch release, you will want to push to docker-images-patch/server to create a docker image that you can test.
-
Look in Buildkite to find the image hash (e.g.
sha256:043dce9761dd4b48f1211e7b69c0eeb2a4ee89d5a35f889fbdaea2492fb70f5d) for thesourcegraph/serverdocker image step (example) of the release candidate build you just created in step 2. -
Run the latest container from a clean state:
CLEAN=true IMAGE=sourcegraph/server@$IMAGE_HASH ./dev/run-server-image.sh -
Do some manual testing:
- Create admin account
- Add a repo
- Do a search
- Open a code file and see code intel working
-
Run the previous minor version (e.g. if releasing 2.9.0 then install 2.8.0) from a clean state:
CLEAN=true IMAGE=sourcegraph/server:$PREVIOUS_VERSION ./dev/run-server-image.sh -
Do some manual testing to create state that we can ensure persists after the update:
- Create admin account
- Add a repo
- Do a search
- Open a code file and see code intel working
-
Stop the old container and run the new container without cleaning the data:
CLEAN=false IMAGE=sourcegraph/server@$IMAGE_HASH ./dev/run-server-image.sh -
Verify that
- You don't need to recreate an admin account.
- The repo you added is still added.
- Search works.
- Code intelligence works.
git fetch
git tag v$VERSION ${COMMIT_FROM_STEP_2}
git push --tags- Check out a new branch in the sourcegraph/website repository.
- Update the old version number in the documentation to be the version number you are releasing by editing this React component.
- Copy over the new changelog entries from sourcegraph/sourcegraph.
- Copy the schema from the released git commit to the sourcegraph/website repo:
cd $WEBSITE_REPO cp $GOPATH/src/github.com/sourcegraph/sourcegraph/schema/site.schema.json utils/
- Create the PR on the website repository and merge it.
- Checkout the
masterbranch in the sourcegraph/sourcegraph repository. - Update ../cmd/frontend/internal/app/pkg/updatecheck/handler.go's
latestReleaseServerBuildto the semver version string of the new version. - Commit and
git pushthis change directly to themasterbranch.
Sourcegraph Server version VERSION has been released!
You should also release Data Center.
- Ensure that the latest version of the language server is uploaded
to
us.gcr.io/sourcegraph-dev/xlang-$LANG:$VERSION. ./cmd/server/release-codeintel.sh $LANG $VERSIONe.g../cmd/server/release-codeintel.sh go 16903_2018-06-13_060942e