Skip to content

Commit e71a40e

Browse files
authored
fix(ci): remove validate from testing branch protection to unblock sync (#1014)
* fix(ci): remove validate from testing branch protection to unblock sync The validate job in build.yml only fires on pull_request events. A direct push from sync-main-to-testing never triggers it, so the required status check could never be satisfied — GITHUB_TOKEN is always rejected by the protected branch rule. PRs to testing still run validate before entering the merge queue. Removing the branch-level requirement adds no risk and unblocks the automated post-promotion sync needed for Tuesday releases. Assisted-by: Claude Sonnet 4.6 via GitHub Copilot * docs(skills): fix sync lesson — testing is loose integration branch, no PR CI gate The initial entry incorrectly claimed PRs to testing are gated by validate before merge queue entry. In reality, without a required status check on testing, gh pr merge --auto fails and pr-triage falls back to direct squash immediately. PRs merge to testing without waiting for CI. Update ci-reference.md lesson to describe the actual tradeoff accurately. Update pr-review.md to clarify validate+e2e are required on main only. Assisted-by: Claude Sonnet 4.6 via GitHub Copilot
1 parent 4579629 commit e71a40e

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

.github/workflows/sync-main-to-testing.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ name: Sync main → testing
55
# main back into testing automatically so the next promotion PR is not blocked.
66
#
77
# Reusable logic lives in projectbluefin/actions. This is a thin caller.
8-
# No GitHub App token needed — GITHUB_TOKEN can push to testing (same as the
9-
# promote job in publish.yml which already fast-forwards testing directly).
8+
# No GitHub App token needed: testing branch protection has no required status
9+
# checks for direct pushes. The `validate` job only runs on pull_request events
10+
# and must NOT be a required status check on testing — it would block every
11+
# direct push including this sync (no PATs or bypasses allowed).
1012

1113
on:
1214
push:

docs/skills/ci-reference.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,3 +1833,25 @@ a synchronous kernel scan — nodes are ready immediately.
18331833
**Note:** The boot-check gate never passed from PR #849 (2026-06-13) through
18341834
PR #895 (2026-06-16) due to iterating on the wrong approach. The fix was
18351835
always to use `--via-loopback` as documented. The image works on real hardware.
1836+
1837+
### sync-main-to-testing fails: `validate` required status check blocks direct push (2026-06-21)
1838+
1839+
**Symptom:** `Sync main → testing` workflow fails with:
1840+
```
1841+
remote: error: GH006: Protected branch update failed for refs/heads/testing.
1842+
remote: - Required status check "validate" is expected.
1843+
```
1844+
1845+
**Root cause:** The `validate` job in `build.yml` only runs on `pull_request` events. A direct push from the sync workflow never triggers it, so the required status check can never be satisfied — GITHUB_TOKEN is always rejected.
1846+
1847+
**Fix:** Remove `validate` from `testing` branch required status checks:
1848+
```bash
1849+
gh api /repos/projectbluefin/dakota/branches/testing/protection/required_status_checks \
1850+
-X PATCH --input - <<'PAYLOAD'
1851+
{"strict": false, "contexts": []}
1852+
PAYLOAD
1853+
```
1854+
1855+
**Why this is safe:** `testing` is a loose integration branch — not a stability gate. PRs to testing still trigger the `validate` job (visible as an informational PR check), but without a required status check, `gh pr merge --auto` fails and pr-triage falls back to a direct squash merge immediately. PRs merge to testing without waiting for CI. The real quality gates are (a) at `main` where `validate` IS required, and (b) at the `production` Environment requiring 2 distinct human approvals. Removing `validate` from `testing` branch protection trades PR-time CI enforcement on the integration branch for a working automated sync.
1856+
1857+
**Do NOT add PATs or tokens to the sync workflow — banned.** Fix is always at the branch protection level.

docs/skills/pr-review.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Use when asked to review any Dakota PR, including feature PRs, dep-update PRs, o
3737

3838
1. **Branch hygiene** — PR must branch from `upstream/main`, not a fork's local `main`. Verify with `git diff upstream/main...HEAD --stat` — it should be minimal and contain only the PR's changes.
3939
2. **Checklist compliance** — verify the relevant items from `pr-checklist.md` for the type of change (junction bump, patch, OCI, element, etc.).
40-
3. **CI gate status**`validate` and `e2e` are required status checks. If CI hasn't run, note it. If `e2e` was skipped (non-image paths), that counts as passing.
40+
3. **CI gate status**`validate` and `e2e` are required status checks on `main`. PRs targeting `testing` have no required status checks (testing is a loose integration branch; the quality gate is at `main` + `production` Environment). If CI hasn't run on a main-targeting PR, note it. If `e2e` was skipped (non-image paths), that counts as passing.
4141
4. **Scope discipline** — one logical change per PR. Junction bumps must not include patch modifications in the same commit.
4242
5. **Correctness** — element syntax, layer kind (`compose` not `stack`), cargo sources generated not hand-written, systemd units enabled via BST install commands.
4343

0 commit comments

Comments
 (0)