Conversation
| trap 'rm ./changelog 2>/dev/null || true' EXIT | ||
|
|
||
| # Grab the token from sourcegraph-devx-bot | ||
| DEVX_GH_TOKEN="$(gcloud secrets versions access latest --secret=DEVX_SERVICE_GH_TOKEN --quiet --project=sourcegraph-ci)" |
There was a problem hiding this comment.
Since this runs in CI DEVX_SERVICE_GH_TOKEN should exist in the environment (like RELEASE_REGISTRY_TOKEN used below). Should we not just use it directly?
We can also then add it as an env requirement in the release manifest?
There was a problem hiding this comment.
Sorry should've mentioned this earlier
There was a problem hiding this comment.
Good point, especially this steps only happens in CI
|
|
||
| chmod +x changelog | ||
|
|
||
| pr_url=$(./changelog \ |
There was a problem hiding this comment.
I think it would help to put some comments on each flags, it's a bit lenghty
There was a problem hiding this comment.
In the same note, are there any docs on the changelog tool?
There was a problem hiding this comment.
Here you go :) https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c?pvs=4 (still WIP)
burmudar
left a comment
There was a problem hiding this comment.
approving with one small comment which will be addressed :D
jdpleiness
left a comment
There was a problem hiding this comment.
Looks good, I just added a few questions that aren't blocking 🚀
|
|
||
| chmod +x changelog | ||
|
|
||
| pr_url=$(./changelog \ |
There was a problem hiding this comment.
In the same note, are there any docs on the changelog tool?
| # - name: 'validate promotion criteria' | ||
| # cmd: | | ||
| # echo "validating promotion criteria" | ||
| # body=$(wget --content-on-error -O- --header="Content-Type: application/json" "https://releaseregistry.sourcegraph.com/v1/releases/sourcegraph/{{version}}") | ||
| # exit_code=$? | ||
| # | ||
| # if [ $exit_code != 0 ]; then | ||
| # echo "❌ Failed to fetch release on release registry, got:" | ||
| # echo "--- raw body ---" | ||
| # echo $body | ||
| # echo "--- raw body ---" | ||
| # exit $exit_code | ||
| # fi | ||
| # if [ $exit_code != 0 ]; then | ||
| # echo "❌ Failed to fetch release on release registry, got:" | ||
| # echo "--- raw body ---" | ||
| # echo $body | ||
| # echo "--- raw body ---" | ||
| # exit $exit_code | ||
| # fi | ||
| # | ||
| # is_development=$(echo "$body" | jq -r '.is_development') | ||
| # if [ "$is_development" = "true" ]; then | ||
| # echo "cannot promote a development release" | ||
| # exit 1 | ||
| # fi | ||
| # is_development=$(echo "$body" | jq -r '.is_development') | ||
| # if [ "$is_development" = "true" ]; then | ||
| # echo "cannot promote a development release" | ||
| # exit 1 | ||
| # fi |
There was a problem hiding this comment.
Kind of out of scope of this PR, but looks like this is a guard to make sure we don't promote development releases, so why is this commented out atm?
There was a problem hiding this comment.
It was like this before I made my changes, cc @BolajiOlajide
There was a problem hiding this comment.
Yeah, the recent change to the release registry would require a rework of this logic. This endpoint now returns an array of objects because we can have two releases with the same version, because one of them could be a development release.
|
@sourcegraph/release I added a note about this here: https://www.notion.so/sourcegraph/How-to-Create-a-Sourcegraph-Release-43dc0d5b608b4dad82057553af46cee2?pvs=4#0bfee201865d48e1920851a8ca24b9f8, so that hopefully we can remove most (all?) of the manual changelog steps when we use this code 💪 |
Please see RFC912 for the context before that PR.
This PR plugs in the
changelogtool that lives insourcegraph/devx-service(a private repo) and uses itsupdate-as-prcommand to automatic open a pull request against the docs repo, which hosts the changelog for Sourcegraph itself.You can see an example output over: https://github.com/sourcegraph/docs/pull/350/files for
5.4.2198.The Changelog PR is created as part of the finalization process when promoting to the public.
We fetch the binary straight for the releases over https://github.com/sourcegraph/devx-service, which is a private repository. I've made the choice to not integrate this within Bazel, to avoid having the local environment depending on a private repository. This would have been okay, but it's simpler to keep things separate, at least for now.
Test plan
I tested all of this over a few different steps:
An annotation is also submitted, to find the changelog PR easily.