Repository navigation
ci: validate main after every merge and require branches up to date before merging (#679) - #685
Merged
Merged
Conversation
…efore merging (#679) PR CI validates a PR head against that PR's merge-base, and nothing validated main after a merge. Two PRs that each pass against their own base can combine into a state neither was ever tested in — #671 and #672 each added CNI metric registrations against a base without the other, and the second squash put newCNIMetrics at gocognit 16/15 on main, surfacing days later on the unrelated PRs #676/#677. Add .github/workflows/main.yaml (`main-post-merge`): on every push to main it runs the same build+lint+unit-test leg ci.yaml runs, with the bazel-diff impact set computed as the merge commit vs its first parent (HEAD^), falling back to a full //... build+test when bazel-diff cannot compute it. --config=ci implies --config=remote, which pins TestRunner to the local strategy, so tests stay local exactly as they are on the PR path. The pull_request path is untouched and `ci` remains the only required status check. ci-impacted-targets.sh never assumed a PR merge-base functionally, but its docs did; retitle them for the two callers and add the new workflow to the seed-file list so editing it forces a full run. The preventive half — branch protection required_status_checks.strict — is a repo settings change applied alongside this PR, not code. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The merge-skew instance
PR CI validates a PR head against that PR's merge-base. Nothing validated
mainafter a merge. Two PRs that each pass against their own base can therefore combine into a state neither was ever tested in:763f5b3spiffe_id_override_rejected)f5d540acf68f1bnewCNIMetricslanded onmainat gocognit 16/15 and no PR ever failed for it. It surfaced days later on two unrelated PRs — #676 (mesh-dns forward pool) and #677 — because//agent/internal/cni/server:serveris in their reverse-transitive impact set viaxds/cache. Cleared by #678; the class remained.What this PR adds —
main-post-merge(the detector)New
.github/workflows/main.yaml, workflow namemain-post-merge, jobsdiff+test. On every push tomainit runs the same legsci.yaml'stestjob runs:bazel build --config=ciover the impacted build set (compile + the--config=lintaspects,--fail_on_violation— this is the leg that catches gocognit),bazel test --config=ciover the impacted unit set,scripts/check-proxy-ready-deps.sh --config=ci(proxy readiness probe re-execs the whole agent binary every 2s: >=31% of supervisor CPU is Go package init #673 linkage guard).Impact set = the merge commit vs its first parent (
HEAD^), i.e. exactly what the merge added tomain, evaluated against the tree that now exists.scripts/ci-impacted-targets.shalready falls back to a full//...build+test whenever bazel-diff cannot compute a set (no first parent, unreachable base, tool failure), somainis never silently under-validated.Constraints preserved:
--config=ci→--config=remote; the same--remote_header=x-buildbuddy-api-keyis passed on build and test.build:remote --strategy=TestRunner=localin.bazelrc. Nothing here overrides it.pull_requestpath is untouched.ciremains the only required status check; this workflow reports nothing required, so a redmain-post-mergeis a redmain, not a blocked PR.paths-filterjob: there is no required check to keep reporting on this trigger, and a proxy-only merge yields an empty impact set anyway (proxy/is a sibling workspace outside//...), sotestjust skips.integration/e2eare not repeated:e2e.yamlalready coversmainpushes.scripts/ci-impacted-targets.shRead it — it takes
BASE_SHA/HEAD_SHAfrom the environment and never computes a merge-base itself, so there was no functional PR assumption to fix. Its docs did assume one; retitled for the two callers. One real fix:.github/workflows/main.yamladded to the seed-file list, so editing the new workflow forces a full run, same asci.yaml.Dry run
BASE_SHA=a3cde6c^ HEAD_SHA=a3cde6c(the squash of #681) against the modified script:The build set is exactly the packages #681 touched plus their reverse deps:
unit =
agent/internal/{cmd,cniconflist,cni/server,node}tests +agent/cmd/agent:image_test+ chart lint/template +website:site_test; integration =//agent/internal/cni/server:server_integration_test.actionlintv1.7.7 on the new file: clean (exit 0). Over all workflows it reports only the two pre-existinggithub.head_reffindings inci.yamlandproxy.yml, untouched here.Part B — branch protection (settings change, not code)
The issue's recommended fix is
required_status_checks.strict = true("require branches up to date before merging"). Findings:repos/bpalermo/aether/branches/main/protectionreturns 404 Branch not protected —mainis guarded by a repository ruleset (main, id12650911,~DEFAULT_BRANCH, enforcementactive), not legacy branch protection. The PATCH in the issue therefore 404s.required_status_checks.strict_required_status_checks_policy: true, with contextsciandproxy(unchanged, not touched). Alsodo_not_enforce_on_create: true, plusdeletion,non_fast_forward,required_linear_history, andpull_request(1 approval, code-owner review, squash only).bypass_actors: [{actor_id: 5 (RepositoryRole = admin), bypass_mode: "always"}], andcurrent_user_can_bypass: "always". Rule-suite history confirms it: every recent push torefs/heads/main, includinga3cde6c,e1b6557,623c254, is recorded withresult: bypass. The strict up-to-date requirement is configured but never evaluated for the only person who merges.No protection field was changed:
strictwas alreadytrue, and narrowingbypass_actorsis a different field and a policy call for the repo owner. To actually close the class, the admin bypass has to go (Settings → Rules →main→ Bypass list → remove "Repository admin", or set its mode to "Pull requests only"); until then this PR'smain-post-mergejob is the working half — it turns the skew into an unmistakable red run onmaininstead of a mystery failure on a bystander PR days later.Closes #679
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr