ci: add required aggregate check#281
Merged
Merged
Conversation
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.
Summary
merge_grouptrigger so CI runs for merge queue entriesRequiredRequiredfail unless both existing required test jobs succeedValidation
PATH=/home/coder/.local/bin:$PATH mise run allNotes
This PR implements Phase 1 of the repo-protection rollout. Repository merge settings have already been updated separately to mux parity. The active ruleset and classic branch protection removal should wait until this PR is merged and
Requiredexists onmain.📋 Implementation Plan
Plan: Make
coder/claudecode.nvimresemblecoder/muxrepo protectionGoal
Move
coder/claudecode.nvimtoward the repository/branch protection posture observed incoder/mux: squash-only merges, auto-merge/update/delete-branch enabled, an active default-branch ruleset, a merge queue, linear-history enforcement, default-branch creation/deletion/non-fast-forward protection, and a single aggregate required GitHub Actions check namedRequired.Evidence gathered
originishttps://github.com/coder/claudecode.nvim; default branch ismain.ThomasK33hasmaintainoncoder/muxandadminoncoder/claudecode.nvim.coder/muxhas no classicmainbranch protection returned by the branch-protection endpoint; protection comes from repository rulesetmain(id: 8733738) targeting~DEFAULT_BRANCH, enforcementactive.coder/muxruleset rules:creation,deletion,non_fast_forward,required_linear_history,required_status_checks, andmerge_queue.coder/muxrequired status check: contextRequired, observed integration id15368(GitHub Actions), strict/up-to-date requirement disabled. Treat the id as evidence from mux, not guaranteed portability until GitHub accepts it forclaudecode.nvim.coder/muxmerge queue parameters: squash merge,ALLGREEN, max build entries 5, min merge entries 1, max merge entries 5, min wait 5 minutes, check response timeout 60 minutes.coder/claudecode.nvimcurrently has classic branch protection onmain, no repository rulesets, no active branch rules, no required checks, one required PR review, force pushes allowed, and branch deletion allowed.coder/claudecode.nvimcurrent workflow.github/workflows/test.ymlexposesunit-testsandintegration-tests (stable), but noRequiredaggregate check.Key differences to close
coder/muxtargetcoder/claudecode.nvimRequiredcheckunit-tests,integration-tests (stable)onlyRequiredaggregate job first~DEFAULT_BRANCHmainrequired_linear_historyrulenon_fast_forwardruledeletionrulecreationruleRequired, non-strictRequired,strict_required_status_checks_policy: falseRecommended rollout
Phase 1 — Add the
Requiredaggregate CI check.github/workflows/test.ymlto addmerge_groupto the workflow triggers, because merge queues create merge-group check runs and required checks must run there too.Required.unit-testsintegration-testsif: ${{ always() }}so the aggregate check still runs when dependencies fail, are cancelled, or are skipped by upstream failures.success.skippedshould fail.integration-testscurrently depends onunit-tests, so ifunit-testsfails,integration-testsmay be skipped. The aggregate job must still fail.${{ needs.unit-tests.result }}and${{ needs.integration-tests.result }}(ortoJSON(needs)for debugging) over a permissivesuccess()expression so failures are visible and easy to audit.Quality gate after Phase 1:
Requiredfrom GitHub Actions.Requiredonce merge queue is enabled.Requiredsucceeds when both existing jobs succeed.Requiredfails when either required underlying job fails.Requiredin repository settings.Acceptance criteria for Phase 1:
Requiredexists on pull requests and onmainpushes.Requiredis produced by GitHub Actions.unit-testsandintegration-testsbehavior remains unchanged.Phase 2 — Update repository merge settings to mux parity
Use GitHub repository settings or
gh apito set:allow_squash_merge: trueallow_merge_commit: falseallow_rebase_merge: falseallow_auto_merge: trueallow_update_branch: truedelete_branch_on_merge: truesquash_merge_commit_title: PR_TITLEsquash_merge_commit_message: PR_BODYQuality gate after Phase 2:
repos/coder/claudecode.nvimvia GitHub API and compare these fields withcoder/mux.Acceptance criteria for Phase 2:
Phase 3 — Create a mux-like default-branch repository ruleset
Create repository ruleset
maintargeting branches and applying to~DEFAULT_BRANCH. The payload below is illustrative; keep theRequiredcontext exact, but validate or adjust the GitHub Actions integration id forclaudecode.nvimbefore applying.{ "name": "main", "target": "branch", "enforcement": "active", "conditions": { "ref_name": { "include": ["~DEFAULT_BRANCH"], "exclude": [] } }, "rules": [ { "type": "deletion" }, { "type": "non_fast_forward" }, { "type": "creation" }, { "type": "required_linear_history" }, { "type": "required_status_checks", "parameters": { "strict_required_status_checks_policy": false, "do_not_enforce_on_create": false, "required_status_checks": [ { "context": "Required", "integration_id": 15368 } ] } }, { "type": "merge_queue", "parameters": { "merge_method": "SQUASH", "max_entries_to_build": 5, "min_entries_to_merge": 1, "max_entries_to_merge": 5, "min_entries_to_merge_wait_minutes": 5, "grouping_strategy": "ALLGREEN", "check_response_timeout_minutes": 60 } } ] }Implementation notes:
gh api repos/coder/claudecode.nvim/rulesetswith the equivalent payload.integration_id: 15368only if GitHub accepts it forclaudecode.nvim; otherwise selectGitHub Actions / Requiredin the ruleset UI, omit the integration id if the API accepts that shape, or use the app id GitHub exposes for this repo'sRequiredcheck. Do not change the context name away fromRequiredwithout re-evaluating parity.activebefore removing classic protection; this avoids a protection gap.Quality gate after Phase 3:
repos/coder/claudecode.nvim/rulesets?includes_parents=trueand the created ruleset by id.repos/coder/claudecode.nvim/rules/branches/mainand confirm the active rule list is:creation,deletion,non_fast_forward,required_linear_history,required_status_checks,merge_queue.Required, non-strict checks, and GitHub Actions as the integration.Acceptance criteria for Phase 3:
mainis protected by an active repository ruleset equivalent to mux.~DEFAULT_BRANCH, not a hard-coded branch name unless GitHub UI forces equivalent behavior.Phase 4 — Remove or intentionally retain classic branch protection
Make an explicit maintainer decision before changing classic branch protection:
mainafter the ruleset is active and verified.Recommended default for this plan is strict mux parity, because the user asked for
claudecode.nvimto resemble mux.Rationale:
main; its effective protections came from the ruleset.claudecode.nvimdifferent even after the mux-like ruleset is added.Quality gate after Phase 4:
repos/coder/claudecode.nvim/branches/main/protection.repos/coder/claudecode.nvim/rules/branches/main; the mux-like rules should still be active.Acceptance criteria for Phase 4:
Phase 5 — End-to-end verification and dogfooding
Use a disposable test branch and PR after settings are changed.
Dogfooding setup:
mainwith a harmless documentation-only commit.gh pr create/ PR URL creation,gh pr checks --watch,gh api repos/coder/claudecode.nvim/rules/branches/main,gh api repos/coder/claudecode.nvimfiltered to merge settings.Required,mainruleset and active rules,Functional checks:
Requiredpasses only after underlying test jobs pass.mainis blocked for ordinary contributors, verified through API/UI and only through a controlled expected-failure attempt from a non-admin/non-bypass account if maintainers explicitly approve that test.main.Acceptance criteria for Phase 5:
coder/muxandcoder/claudecode.nvimshows matching values for the intended settings/rules.Final verification commands
Use direct tool paths if local shims trigger mise trust errors:
Rollback / emergency recovery
If the ruleset or merge queue blocks normal work unexpectedly:
mainruleset or temporarily change enforcement fromactivetoevaluate/disabled.Requiredfrom the ruleset's required status checks or correct theRequiredworkflow trigger/check context.Rollback acceptance criteria:
Risks and mitigations
Requiredcheck blocks merging: add and merge the aggregate CI job before requiring it in the ruleset, and includemerge_groupso the check appears for merge queue runs.Required; if15368is rejected, select the check through GitHub UI or use the integration id GitHub exposes for the repo's GitHub Actions check.Advisor review status
merge_group, rollback, portable integration id handling, skipped-job semantics, Phase 4 decision clarity, and safe dogfooding.Generated with
mux• Model:openai:gpt-5.5• Thinking:xhigh