Skip to content

Commit 1a5048c

Browse files
committed
fix(ci): validate release branch updates
1 parent abacf98 commit 1a5048c

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
types: [opened, synchronize, reopened, edited, labeled, unlabeled]
99
merge_group:
1010
types: [checks_requested]
11+
workflow_dispatch:
1112

1213
concurrency:
1314
group: ci-${{ github.workflow }}-${{ github.ref }}

.github/workflows/release-please.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ jobs:
8383
git add uv.lock
8484
git commit -m "chore(release): synchronize uv lock"
8585
git push origin "HEAD:$RELEASE_BRANCH"
86+
- name: Dispatch release candidate CI
87+
if: steps.validated-head.outputs.current == 'true' && steps.release.outputs.prs_created == 'true'
88+
env:
89+
GH_TOKEN: ${{ github.token }}
90+
RELEASE_BRANCH: release-please--branches--main--components--jacobian
91+
run: >-
92+
gh workflow run ci.yml
93+
--repo "$GITHUB_REPOSITORY"
94+
--ref "$RELEASE_BRANCH"
8695
- name: Dispatch release publishing
8796
if: steps.release.outputs.release_created == 'true'
8897
env:

tests/unit/tooling/test_release_workflow.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
RELEASE_PLEASE_CONFIG = ROOT / "release-please-config.json"
77
SERVER_METADATA = ROOT / "server.json"
88
WORKFLOW = ROOT / ".github" / "workflows" / "release.yml"
9+
RELEASE_PLEASE_WORKFLOW = ROOT / ".github" / "workflows" / "release-please.yml"
10+
CI_WORKFLOW = ROOT / ".github" / "workflows" / "ci.yml"
911

1012

1113
def test_release_build_resolves_and_verifies_one_immutable_sha() -> None:
@@ -24,6 +26,24 @@ def test_release_build_resolves_and_verifies_one_immutable_sha() -> None:
2426
)
2527

2628

29+
def test_release_candidate_dispatches_full_ci_after_lockfile_sync() -> None:
30+
release_please = RELEASE_PLEASE_WORKFLOW.read_text(encoding="utf-8")
31+
ci = CI_WORKFLOW.read_text(encoding="utf-8")
32+
33+
ci_triggers = ci.split("on:", 1)[1].split("concurrency:", 1)[0]
34+
assert "workflow_dispatch:" in ci_triggers
35+
assert "plan_output=$(.github/scripts/classify-ci-paths --force-exhaustive)" in ci
36+
37+
lockfile_sync = release_please.index("name: Synchronize release lockfile")
38+
candidate_dispatch = release_please.index("name: Dispatch release candidate CI")
39+
assert lockfile_sync < candidate_dispatch
40+
41+
dispatch = release_please[candidate_dispatch:]
42+
assert "steps.release.outputs.prs_created == 'true'" in dispatch
43+
assert "gh workflow run ci.yml" in dispatch
44+
assert '--ref "$RELEASE_BRANCH"' in dispatch
45+
46+
2747
def test_mcp_publisher_is_verified_before_oidc_or_publication() -> None:
2848
source = WORKFLOW.read_text(encoding="utf-8")
2949
publisher = source[source.index("publish-mcp:") :]

0 commit comments

Comments
 (0)