diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 2ec90e33b..e78244381 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -5,7 +5,7 @@ name: Conformance on: pull_request: - branches: [ main, 'release/**' ] + branches: [ main, 'release/**', 'hotfix/**' ] # "Upgrade-relevant code" allowlist (spec-f7.md §2.4): any non-test Go # change, build input, or this workflow's own inputs. Kept byte-for-byte # identical (modulo each workflow's own file/script entries) across diff --git a/.github/workflows/cross-version-smoke.yml b/.github/workflows/cross-version-smoke.yml index 7dc520fc2..21076f00c 100644 --- a/.github/workflows/cross-version-smoke.yml +++ b/.github/workflows/cross-version-smoke.yml @@ -10,7 +10,7 @@ on: # feedback. Release-targeted PRs are exactly the ones where cross-version # upgrade breakage is most expensive to discover at tag time. pull_request: - branches: [ main, 'release/**' ] + branches: [ main, 'release/**', 'hotfix/**' ] # "Upgrade-relevant code" allowlist (spec-f7.md §2.4): kept identical # (modulo each workflow's own file/script entries) across conformance.yml, # migration-test.yml and cross-version-smoke.yml, and pinned by diff --git a/.github/workflows/pr-risk.yml b/.github/workflows/pr-risk.yml index 3a632f71b..fcfa882b8 100644 --- a/.github/workflows/pr-risk.yml +++ b/.github/workflows/pr-risk.yml @@ -2,7 +2,7 @@ name: PR Risk on: pull_request: - branches: [ main, 'release/**' ] + branches: [ main, 'release/**', 'hotfix/**' ] merge_group: concurrency: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 54fa45d04..ec4c044d4 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -5,7 +5,7 @@ on: # release/** is here because release-prep and release-fix PRs are based on # the release branch, not on main. Without it they run almost no CI and the # first full signal is the tag build, where a failure burns the tag. - branches: [ main, 'release/**' ] + branches: [ main, 'release/**', 'hotfix/**' ] merge_group: concurrency: diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index a304df6d8..52c03931f 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -5,7 +5,7 @@ on: push: branches: [main] pull_request: - branches: [main, 'release/**'] + branches: [main, 'release/**', 'hotfix/**'] # Allow manual trigger workflow_dispatch: diff --git a/CHANGELOG.md b/CHANGELOG.md index bb10eb841..6d809cba9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 the `.githooks` markers and `uv.lock` and leaves any other drifted file as it was. ### Fixed +- **PRs based on `hotfix/**` branches now run full CI, not just + cross-version historical smokes and triage labeling.** `pr.yml`, + `pr-risk.yml`, `conformance.yml`, `cross-version-smoke.yml` and + `regression.yml` all trigger `pull_request` on `main` and `release/**`, + but not on `hotfix/**` — a backport PR based on a hotfix line (the same + position `release/**` was added for) got no unit shards, no lint, no + risk gate, and no required CI Gate at all: 15 passing cross-version + smokes and triage jobs, nothing else. Added `hotfix/**` alongside + `release/**` in all five (#7148). + - **Concurrent `bd init --shared-server` runs in different projects no longer refuse each other.** Every shared-server project gates the one shared diff --git a/scripts/ci_workflow_test.go b/scripts/ci_workflow_test.go index 4a195f97a..5565102fc 100644 --- a/scripts/ci_workflow_test.go +++ b/scripts/ci_workflow_test.go @@ -92,6 +92,42 @@ func TestCIWorkflowArtifactOwnership(t *testing.T) { } } +// TestPullRequestWorkflowsTriggerOnHotfixBranches is the #7148 regression. +// pr.yml's own comment states why release/** is in the pull_request +// trigger: "release-prep and release-fix PRs are based on the release +// branch, not on main. Without it they run almost no CI and the first +// full signal is the tag build, where a failure burns the tag." A hotfix +// backport PR (hotfix/1.3.1 and its siblings) is in exactly that position +// — based on a branch other than main — so it needs the same trigger, +// alongside release/**, not instead of it. +func TestPullRequestWorkflowsTriggerOnHotfixBranches(t *testing.T) { + type triggers struct { + On struct { + PullRequest struct { + Branches []string `yaml:"branches"` + } `yaml:"pull_request"` + } `yaml:"on"` + } + root := sourceRepoRoot(t) + for _, name := range []string{ + "pr.yml", prRiskWorkflowName, "conformance.yml", "cross-version-smoke.yml", "regression.yml", + } { + t.Run(name, func(t *testing.T) { + var doc triggers + if err := yaml.Unmarshal([]byte(readPolicyFile(t, root, ".github/workflows/"+name)), &doc); err != nil { + t.Fatal(err) + } + branches := doc.On.PullRequest.Branches + if !slices.Contains(branches, "release/**") { + t.Fatalf("%s pull_request.branches = %v, want release/** present (this test asserts the baseline it extends)", name, branches) + } + if !slices.Contains(branches, "hotfix/**") { + t.Errorf("%s pull_request.branches = %v, want hotfix/** alongside release/** — a hotfix backport PR is based on a branch other than main, same as a release-prep PR", name, branches) + } + }) + } +} + func TestPRCIGateRequiresPolicyAndLintWrappers(t *testing.T) { gate := readCIWorkflow(t, "pr.yml").job(t, "ci-gate") gateEnv := gate.step(t, "Evaluate CI gate").Env