Skip to content

Commit 7dee37e

Browse files
authored
SEP-1212: Split release CI into prep + rc1 steps for pre-RC1 internal QA day (#760)
## Summary Split the `Release` GitHub Actions workflow into two dispatches so the GAS team can validate a SHA-tagged internal-registry image during a 1-day internal QA window before `rc1` publishes to Docker Hub. - **New `release_type: prep`** (Day 27) — `cmd_prep` + `make release-prep` create `release/vX.Y.Z` from main HEAD, fire the rule #16 Jira version-create webhook, open the `main → vX.Y+1.0.dev0` dev-bump PR, build the wheel, and trigger Jenkins with `pushImageDocker=false` (SHA-tagged internal-registry image only). No version bump, no tag. - **`cmd_rc(RC=1)` made idempotent against a prior prep** — probes `origin` for the existing release branch and switches into an after-prep path: syncs non-destructively to `origin/{branch}` (refuses to reset when local is ahead), re-fires the rule #16 webhook (rule is naturally idempotent), and gates the dev-bump PR call on `origin/main`'s actual `pyproject.toml` version. The fresh-from-main path is bit-for-bit unchanged (AC #6). - **`make trigger-jenkins` parameterised** with `PUSH_IMAGE_DOCKER` (default `true`). Deviation from the AC's literal wording (`trigger-jenkins-internal SHA=<sha>` or `MODE=internal`): chose this variable-on-existing-target approach as a finer-grained third path. Pre-approved in the implementation plan. - **Workflow YAML** adds `prep` to the choices, validates `rc_number` must be empty for prep, and dispatches to `make release-prep`. - 22 new unit tests cover `cmd_prep` happy path + preconditions + ordering + head-sha → Jenkins, `cmd_rc` after-prep idempotency (webhook re-fire, dev-bump skip-when-main-bumped, error-when-PR-unmerged, non-destructive sync, refuse-when-local-ahead, abort-on-rev-list-failure, still-bumps-and-tags), `_remote_branch_exists` exit-code switch (0 / 2 / 128), and `prep` argparse plumbing. The workflow doc (release-process.md) is documented separately and synced to Notion — the file is gitignored locally and does not ship in this PR. ## Tested - [ ] N/A — pure CI tooling. Tested via `pytest tests/scripts/test_release.py -v` (57 tests pass), `make -n release-prep VERSION=0.99.0`, `make -n trigger-jenkins TAG=abc PUSH_IMAGE_DOCKER=false`, and `python3 scripts/release.py --help`. The real integration test is the next release cycle's Day 27 dispatch by the release manager. ## Checklist - [x] New/modified functions have type hints and rST docstrings - [x] New tests added for new features or bug fixes - [x] ~~Database migrations generated if models changed (`make makemigrations`)~~ *(N/A — no model changes)* - [x] ~~User-facing changes documented (README, inline help, UI text)~~ *(N/A — release process change, documented in the workflow doc)* - [x] Configuration changes documented with examples
1 parent 1388c9c commit 7dee37e

4 files changed

Lines changed: 1159 additions & 99 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ on:
88
required: true
99
type: choice
1010
options:
11+
- prep
1112
- rc
1213
- stable
1314
version:
1415
description: "Version number (e.g. 0.11.0)"
1516
required: true
1617
type: string
1718
rc_number:
18-
description: "RC number (e.g. 1) — required for RC releases"
19+
description: "RC number (e.g. 1) — required for RC releases, must be empty for prep"
1920
required: false
2021
type: string
2122

@@ -54,6 +55,10 @@ jobs:
5455
exit 1
5556
fi
5657
fi
58+
if [ "$RELEASE_TYPE" = "prep" ] && [ -n "$RC_NUMBER" ]; then
59+
echo "::error::rc_number must be empty when release_type is 'prep'"
60+
exit 1
61+
fi
5762
5863
- name: Checkout repository
5964
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -81,6 +86,8 @@ jobs:
8186
run: |
8287
if [ "$RELEASE_TYPE" = "rc" ]; then
8388
make release-rc VERSION="$VERSION" RC="$RC_NUMBER" SIGN_VIA_API=1
89+
elif [ "$RELEASE_TYPE" = "prep" ]; then
90+
make release-prep VERSION="$VERSION" SIGN_VIA_API=1
8491
else
8592
make release-stable VERSION="$VERSION" SIGN_VIA_API=1
8693
fi

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ changelog-list:
176176
@$(PYTHON) scripts/changelog.py list
177177

178178
SIGN_FLAG := $(if $(SIGN_VIA_API),--sign-via-github-api,)
179+
PUSH_IMAGE_DOCKER ?= true
180+
181+
release-prep:
182+
ifndef VERSION
183+
$(error VERSION is required. Usage: make release-prep VERSION=X.Y.Z)
184+
endif
185+
@$(PYTHON) scripts/release.py prep --version "$(VERSION)" $(SIGN_FLAG)
179186

180187
release-rc:
181188
ifndef VERSION
@@ -194,7 +201,7 @@ endif
194201

195202
trigger-jenkins:
196203
ifndef TAG
197-
$(error TAG is required. Usage: make trigger-jenkins TAG=vX.Y.Z [WEBHOOK_URL_ENV=... WEBHOOK_AUTH_ENV=...])
204+
$(error TAG is required. Usage: make trigger-jenkins TAG=vX.Y.Z [PUSH_IMAGE_DOCKER=false] [WEBHOOK_URL_ENV=... WEBHOOK_AUTH_ENV=...])
198205
endif
199206
@set -euo pipefail; \
200207
if [ -n "$${JENKINS_URL:-}" ] && [ -n "$${JENKINS_USER:-}" ] && [ -n "$${JENKINS_API_TOKEN:-}" ]; then \
@@ -204,7 +211,7 @@ endif
204211
--data-urlencode "releaseTag=$(TAG)" \
205212
--data-urlencode "notifySlack=true" \
206213
--data-urlencode "pushImage=true" \
207-
--data-urlencode "pushImageDocker=true" 2>&1; then \
214+
--data-urlencode "pushImageDocker=$(PUSH_IMAGE_DOCKER)" 2>&1; then \
208215
echo " Jenkins build triggered successfully."; \
209216
if [ -n "$(WEBHOOK_URL_ENV)" ] && [ -n "$(WEBHOOK_AUTH_ENV)" ]; then \
210217
$(PYTHON) scripts/post_jira_webhook.py \
@@ -219,4 +226,4 @@ endif
219226
echo "Note: JENKINS_URL/JENKINS_USER/JENKINS_API_TOKEN not all set, skipping Jenkins trigger."; \
220227
fi
221228

222-
.PHONY: venv build pack builder image format ruff djlint lint audit run-pre-commit dev-backend dev-frontend pip-audit bandit makemigrations makemigrations-plugin migrate checkmigrations test release-rc release-stable trigger-jenkins changelog-add changelog-check changelog-list
229+
.PHONY: venv build pack builder image format ruff djlint lint audit run-pre-commit dev-backend dev-frontend pip-audit bandit makemigrations makemigrations-plugin migrate checkmigrations test release-prep release-rc release-stable trigger-jenkins changelog-add changelog-check changelog-list

0 commit comments

Comments
 (0)