From 3eca0f49f4b1bac17e8000a1ee614471746da002 Mon Sep 17 00:00:00 2001 From: Warren Gifford Date: Wed, 21 Oct 2026 10:32:29 -0700 Subject: [PATCH] release: Hand "Update main" PRs over to the releaseworker (#972) Promote finalize opens a draft "Update main: build vX" PR after every release, but none has ever been merged, so `main` here lags many releases behind. Its Buildkite build also always fails: `promote/release-vX-update-main` matches the `^promote\/release-.*` release steps, and `(promote) Release: test` stops with "did not find serialized config" (for example, [deploy-sourcegraph-k8s build 1187](https://buildkite.com/sourcegraph/deploy-sourcegraph-k8s/builds/1187)). The releaseworker now opens the "Update main" PR itself after the promote build passes, with squash auto-merge enabled and the Platform team requested as reviewers ([sourcegraph/sourcegraph#17347](https://github.com/sourcegraph/sourcegraph/pull/17347)). This PR: - removes the "Update main" steps from `promoteToPublic.finalize` in `release.yaml`, so the releaseworker and Buildkite don't both create it; - skips the `(promote) Release: test` and `(promote) Release: finalize` steps on `*-update-main` branches in `.buildkite/pipeline.yaml`. Ship this together with sourcegraph/sourcegraph#17347. Until both are live, a release either gets no "Update main" PR or a duplicate attempt that the releaseworker logs and skips. Part of [PLAT-881](https://linear.app/sourcegraph/issue/PLAT-881/close-release-generated-prs-when-release-is-complete). Matching changes: [docker#1443](https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/1443), [k8s#492](https://github.com/sourcegraph/deploy-sourcegraph-k8s/pull/492). ### Checklist - [ ] Follow the manual testing process: not applicable, no chart changes - [ ] Update changelog: not needed, release tooling only - [ ] Update Kubernetes update doc: not needed ### Test plan Both YAML files parse, and `promoteToPublic.finalize` now contains only the tag and release registry steps. The pipeline conditions still match `promote/release-v8.1.0` and no longer match `promote/release-v8.1.0-update-main`. The next release's promote build and "Update main" PR will exercise this end to end. (cherry picked from commit 44e0288b615e61f788b3320e56b2b9354e0dae0e) --- .buildkite/pipeline.yaml | 4 +- release.yaml | 97 ---------------------------------------- 2 files changed, 2 insertions(+), 99 deletions(-) diff --git a/.buildkite/pipeline.yaml b/.buildkite/pipeline.yaml index d8006e2e..ea77e63d 100644 --- a/.buildkite/pipeline.yaml +++ b/.buildkite/pipeline.yaml @@ -48,7 +48,7 @@ steps: sg release run test --workdir=. --config-from-commit - label: "(promote) Release: test" - if: build.branch =~ /^promote\/release-.*/ + if: build.branch =~ /^promote\/release-.*/ && build.branch !~ /-update-main$/ plugins: - ssh://git@github.com/sourcegraph/sg-buildkite-plugin.git#main: ~ command: | @@ -71,7 +71,7 @@ steps: sg release run internal finalize --workdir=. --config-from-commit - label: "(promote) Release: finalize" - if: build.branch =~ /^promote\/release-.*/ + if: build.branch =~ /^promote\/release-.*/ && build.branch !~ /-update-main$/ plugins: - ssh://git@github.com/sourcegraph/sg-buildkite-plugin.git#main: ~ command: | diff --git a/release.yaml b/release.yaml index 45107dcb..f633417f 100644 --- a/release.yaml +++ b/release.yaml @@ -516,100 +516,3 @@ promoteToPublic: echo "Build created, see:" echo $body | jq .web_url fi - - - name: "update main with latest version" - cmd: | - set -eu - branch="promote/release-{{version}}-update-main" - echo "Checking out origin/main" - git fetch origin main - git switch main - echo "Creating branch origin/${branch}" - git switch -c "${branch}" - - - name: sg ops:sourcegraph - cmd: | - set -eu - registry=index.docker.io/sourcegraph - sg ops update-images \ - -t {{inputs.server.tag}} \ - -k helm \ - --registry "${registry}" \ - --docker-username $DOCKER_USERNAME \ - --docker-password $DOCKER_PASSWORD \ - charts/sourcegraph/ - - - name: sg ops:dind - cmd: | - set -eu - registry=index.docker.io/sourcegraph - sg ops update-images \ - -t {{inputs.server.tag}} \ - -k helm \ - --registry "${registry}" \ - --docker-username $DOCKER_USERNAME \ - --docker-password $DOCKER_PASSWORD \ - charts/sourcegraph-executor/dind/ - - - name: sg ops:k8s - cmd: | - set -eu - registry=index.docker.io/sourcegraph - sg ops update-images \ - -t {{inputs.server.tag}} \ - -k helm \ - --registry "${registry}" \ - --docker-username $DOCKER_USERNAME \ - --docker-password $DOCKER_PASSWORD \ - charts/sourcegraph-executor/k8s/ - - - name: sg ops:migrator - cmd: | - set -eu - registry=index.docker.io/sourcegraph - sg ops update-images \ - -t {{inputs.server.tag}} \ - -k helm \ - --registry "${registry}" \ - --docker-username $DOCKER_USERNAME \ - --docker-password $DOCKER_PASSWORD \ - charts/sourcegraph-migrator/ - - - name: "chart:version" - cmd: | - comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml - comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph/examples/subchart/Chart.yaml - comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml - comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml - comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml - - - name: "chart:appVersion" - cmd: | - comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml - comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml - comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml - comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml - - - name: "update helm docs" - cmd: ./scripts/helm-docs.sh - - - name: "git:commit" - cmd: | - set -eu - branch="promote/release-{{version}}-update-main" - - git commit -am "prep update main: {{version}}" -m 'update main with latest release' - git push origin "${branch}" - - - name: "github:pr" - cmd: | - set -eu - # Create PR to merge release updates into main branch - gh pr create \ - --fill \ - --draft \ - --base main \ - --title "Update main: build {{version}}" \ - --body "Test plan: automated release PR, CI will perform additional checks" - echo "🚢 Please check the associated CI build to ensure the process completed". -