🤖 ci: enforce merge queue required CI checks#14
Merged
Conversation
Enable CI to run on merge_group events and force lint/test/action lint jobs to execute for merge queue builds. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.19`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.19 -->
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Member
Author
Skip dorny/paths-filter execution during merge_group events and emit explicit default outputs instead, so merge queue runs do not fail while computing a merge base against queue refs. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.19`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.19 -->
Member
Author
|
@codex review |
Disable zizmor online audits in CI to avoid transient upstream GitHub API failures during merge_group jobs while keeping offline workflow security linting enabled. --- _Generated with `mux` • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.19`_ <!-- mux-attribution: model=openai:gpt-5.3-codex thinking=xhigh costs=0.19 -->
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Member
Author
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
This PR makes merge queue runs execute and enforce the same CI checks as pull requests.
Background
The
mainbranch already enforced merge queue, but required status checks were not configured and CI did not run onmerge_groupevents. That allowed queued entries to proceed without guaranteed re-validation in merge-group context.Implementation
merge_group(checks_requested) as a trigger in.github/workflows/ci.yaml.lint,test, andlint-actionsjob conditions to always run onmerge_groupwhile preserving path-filtered behavior for PR/push events.Codex CommentsPR-only.12597808(main) to include required status checks:Detect changed pathslinttestLint GitHub ActionsValidation
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.10make verify-vendormake testmake buildgh ruleset check main --repo coder/coder-k8sgh api repos/coder/coder-k8s/rulesets/12597808 --jq '.rules[] | select(.type=="required_status_checks")'Risks
merge_groupevents and branch-protection enforcement via required checks.📋 Implementation Plan
Plan: make merge queue enforce and rerun CI checks correctly
Context / Why
The repository already has a merge queue enabled on
main, but queued merges currently are not guaranteed to run the same CI checks that PRs run. To make merge queue behavior match expectations (re-run checks on merge groups and block merges on failures), we need to:merge_groupevents.mainruleset.This closes the current gap where merge queue entries can proceed without required status-check enforcement.
Evidence
.github/workflows/ci.yamlcurrently triggers only onpull_requestandpush(on:block at lines 3–7); there is nomerge_grouptrigger.Detect changed paths,lint,test,Lint GitHub Actions, andCodex Comments.gh ruleset check main --repo coder/coder-k8scurrently reports only four rules:deletion,non_fast_forward,required_linear_history,merge_queue(norequired_status_checks).gh api repos/{owner}/{repo}/rulesets/12597808confirms the activemainruleset hasmerge_queueparameters but norequired_status_checksrule.merge_groupfor required checks:Implementation details
1) Update CI workflow trigger for merge queue events
File:
.github/workflows/ci.yamlAdd
merge_grouptrigger (scoped tochecks_requested) alongside existing triggers.2) Ensure required jobs run for merge-group builds
File:
.github/workflows/ci.yamlTo avoid path-filter edge cases on
merge_group, make CI jobs run unconditionally for merge-group events while preserving current selective behavior for PR/push events.Keep
codex-commentsPR-only (do not make it required for merge queue):3) Add required status checks to the active
mainrulesetScope: GitHub repository settings/ruleset (not stored in repo files)
Update ruleset
12597808by adding arequired_status_checksrule. Recommended contexts:Detect changed pathslinttestLint GitHub ActionsDo not include
Codex Commentsas a required check (it does not run onmerge_group).Example update flow with
gh api:RULESET_ID=12597808 gh api repos/{owner}/{repo}/rulesets/$RULESET_ID > /tmp/ruleset.json jq ' .rules |= ( map(select(.type != "required_status_checks")) + [{ "type": "required_status_checks", "parameters": { "required_status_checks": [ {"context": "Detect changed paths"}, {"context": "lint"}, {"context": "test"}, {"context": "Lint GitHub Actions"} ], "strict_required_status_checks_policy": false } }] ) | {name, target, enforcement, conditions, bypass_actors, rules} ' /tmp/ruleset.json > /tmp/ruleset-update.json gh api \ --method PUT \ repos/{owner}/{repo}/rulesets/$RULESET_ID \ --input /tmp/ruleset-update.jsonWhy include
Detect changed pathsas required?That job always runs and provides a fast, deterministic check context for every PR/merge-group run. Requiring it helps avoid “missing required check” confusion when selective jobs (
lint,test,lint-actions) are skipped due to path filters.4) Validation checklist after implementation
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.10(workflow syntax/logic).gh ruleset check main --repo coder/coder-k8snow showsrequired_status_checksin effective rules.gh api repos/{owner}/{repo}/rulesets/12597808 --jq '.rules[] | select(.type=="required_status_checks")'returns configured contexts.merge_grouprun is created for workflow CI and reports the required checks.Constraints / prerequisites
Generated with
mux• Model:openai:gpt-5.3-codex• Thinking:xhigh• Cost:$0.19