Repository navigation
Description
Split from #7318.
Problem: devops repos onboard may have set a required check from a check run that was only skipped. The check name can come from a skipped reusable-workflow job or from a matrix leg. The bad required check blocks merges. Why deferred: The audit needs live access to each repository that onboard changed and to its ruleset. This issue cannot read those repositories from the source tree of devops-cli. Acceptance criteria: - For each repository that onboard changed, the audit lists each required check that no non-skipped check run reports. - The audit lists each required matrix leg name that has an aggregate check. - A person removes each listed check from the ruleset and records the result. - The audit lists no bad required check after the removals.
Proposed design
Problem statement
devops repos onboard could set a required check from a check run that only skipped, and the bad required check blocks merges. Row 10 of devops repos onboard --plan drops such a check only while a template pull request is open, because row 9 reads no check run once that pull request merged, so nothing lists the checks that the repositories onboard already changed still require. Add a read-only devops repos audit-required-checks that reads each target repository's effective required checks and the check runs of its default branch head, lists each bad check, and leaves the removal to a person.
Acceptance criteria
Requirement: Only skipped runs
The audit SHALL list each required check that only skipped check runs report.
Scenario: Required check has only skipped runs
- WHEN the rules of the default branch require
testand the default branch head holds only atestcheck run with conclusionskipped - THEN
devops repos audit-required-checks --repo example-org/example-repo --jsonliststestwith reasononly-skippedand exits 1
Requirement: Missing required check
The audit SHALL list each required check that no check run of the default branch head reports.
Scenario: Required check has no run
- WHEN the rules of the default branch require
lintand the default branch head holds nolintcheck run - THEN the audit lists
lintwith reasonmissingand exits 1
Requirement: Pending run is not missing
The audit SHALL NOT list a required check that holds a check run which has not ended.
Scenario: Required check is still running
- WHEN the rules of the default branch require
lintand the default branch head holds alintcheck run with statusin_progress - THEN the audit lists no bad check and exits 0
Requirement: Matrix leg with aggregate
The audit SHALL list each required matrix leg name whose job check run ended success.
Scenario: Matrix leg has a passing aggregate run
- WHEN the rules of the default branch require
test (3.11)and the default branch head holds atestcheck run with conclusionsuccess - THEN the audit lists
test (3.11)with reasonmatrix-aggregateand exits 1
Requirement: Valid required check
The audit SHALL NOT list a required check when a check run with the same name reports a conclusion other than skipped.
Scenario: Required check has a success run
- WHEN the rules of the default branch require
buildand the default branch head holds abuildcheck run with conclusionsuccess - THEN the audit lists no bad check and exits 0
Requirement: Repository selection
The audit SHALL audit each --repo argument, and SHALL audit the repositories of service.repos when no --repo is given.
Scenario: No repository argument
- WHEN the operator runs
devops repos audit-required-checks --jsonwithservice.reposset toexample-org/example-repo - THEN the command audits
example-org/example-repoand prints one result object for it
Requirement: No ruleset change
The audit command SHALL NOT change any repository ruleset.
Scenario: Audit finds a bad check
- WHEN the operator runs
devops repos audit-required-checks --repo example-org/example-repoon a repository with a bad check - THEN the command sends no ruleset update request and the ruleset stays the same
Requirement: Pending a person after the merge
A person SHALL remove each listed bad required check from the repository ruleset and record the result.
Scenario: Operator removes the listed checks
- WHEN the audit after the merge lists a bad check for a repository
- THEN the operator removes that check in the ruleset, records the result in a comment on the issue, and a later audit lists no bad check for that repository
Existing Tool Considered
No alternatives check has run. The open, maintained gidgethub 6.0.0 library covers the HTTP of each read (ADR 0006), and the project already holds the two reads: read_required_check_names for the required checks of a branch and read_check_runs for the check runs of a head. gidgethub and those readers lack the comparison, the matrix-leg match and the report, which the change builds: about 10k tokens to build and test, about 2k tokens a year to keep and fix, and about 2 hours elapsed.
Key questions
- Which command name and group should hold the audit?: Add
devops repos audit-required-checksunder the existingreposgroup insrc/devops_cli/commands/repos.py, besideonboard. (best practice) [sources: src/devops_cli/commands/repos.py:1064, docs/CLI_REFERENCE.md:63]- Chosen: devops repos audit-required-checks. It sits in the same group as
repos onboard, whose row 10 builds the required checks that it audits. - Rejected: Extend
devops repos onboard --planinstead of a new command. The archived design of fix(repos): onboard requires a skipped check name #7318 rejected a second command becauseruleset_rowalready reads each ruleset, but row 9 reads no check run once the template pull request merged (src/devops_cli/github/onboard/template_pr.py:238), so row 10 lists no check for the repositories this issue names. - Rejected: devops audit required-checks. It creates a new command group for one read-only audit.
- Chosen: devops repos audit-required-checks. It sits in the same group as
- Which repositories should the audit read by default?: The audit reads each repository named by a repeated
--repoargument. With no--repo, it reads the repositories ofservice.repos. (best practice) [sources: docs/CLI_REFERENCE.md:337, src/devops_cli/commands/repos.py:1050]- Chosen: Explicit
--repowithservice.reposdefault.devops roadmap inboxalready reads each repository ofservice.repos, or the one that--reponames (docs/CLI_REFERENCE.md:337), andservice.reposis the set that onboard changed. - Rejected: Explicit
--repoonly. The operator must repeat the full list and can omit a repository. - Rejected: Scan every repository of the account. It reads repositories that onboard did not change and needs wider permissions.
- Chosen: Explicit
- Which GitHub data should the audit compare with the required checks?: The audit reads the required check names that the rules of the default branch give, with the existing
read_required_check_names(GET /repos/{repository}/rules/branches/{branch}), and the latest run of each check of the default branch head withread_check_runs. That is the same pair of reads thatfailed_required_checksmakes for a pull request head, and the raw conclusion of each run is the item'sstate. (best practice) [sources: src/devops_cli/github/check_verdict.py:310, src/devops_cli/github/check_verdict.py:319, src/devops_cli/github/check_verdict.py:289, src/devops_cli/github/branch_update.py:141]- Chosen: Rules of the default branch and the check runs of its head. The rules endpoint applies each ruleset to the branch that merges, and the project already pairs it with a check-run read of a head (
src/devops_cli/github/branch_update.py:141). - Rejected: The
rulesetslisting and one read per ruleset. It repeats the rule matching thatrules/branches/<branch>does, and lists rulesets that do not apply to the default branch. - Rejected: The head of the newest template pull request, in any state. fix(repos): onboard requires checks of a merged template pull request #7476 records that a merged head can name a check that no workflow reports now (
src/devops_cli/github/onboard/template_pr.py:240), so it lists names that are not bad.
- Chosen: Rules of the default branch and the check runs of its head. The rules endpoint applies each ruleset to the branch that merges, and the project already pairs it with a check-run read of a head (
- Which required checks count as bad?: A required name is bad in three cases: every completed run of it on the head ended
skipped(only-skipped); no run of it reports (missing); or it is a matrix leg whose job run endedsuccess(matrix-aggregate). A name that holds a run which has not ended, or a run whose conclusion is notskipped, is not bad. (best practice) [sources: src/devops_cli/github/onboard/settings_rows.py:696, src/devops_cli/github/onboard/settings_rows.py:716, src/devops_cli/github/check_verdict.py:161, docs/repos/onboard.md:97]- Chosen: Skipped-only, missing, and a leg with a passing job. It states the defect of fix(repos): onboard requires a skipped check name #7318 in the two forms that row 10 drops (
src/devops_cli/github/onboard/settings_rows.py:716), and adds the missing name that the issue body names. - Rejected: Only the names that row 10 drops with
; dropped. Row 10 keeps a name that no run reports, because the head of the template pull request does not contradict it (src/devops_cli/github/onboard/settings_rows.py:706); the default branch head does, and the issue body asks for it. - Rejected: Every required name that no run reports on the newest template pull request head. A merged head can hold the names of workflows that no longer run (
src/devops_cli/github/onboard/template_pr.py:240).
- Chosen: Skipped-only, missing, and a leg with a passing job. It states the defect of fix(repos): onboard requires a skipped check name #7318 in the two forms that row 10 drops (
- How should the audit detect a matrix leg that has an aggregate check?: Reuse
_check_base_name, which splits<job> (<values>)with_LEG_PATTERNat the last space before the parenthesised values, and mark the leg when a run of<job>endedsuccess, the same rule that row 10 applies. (best practice) [sources: src/devops_cli/github/onboard/settings_rows.py:71, src/devops_cli/github/onboard/settings_rows.py:677, src/devops_cli/github/onboard/settings_rows.py:716, openspec/changes/archive/2026-11-27-7318-onboard-requires-a-skipped-check-name/design.md:7]- Chosen: Parse the name with
_LEG_PATTERNand look for asuccessrun of the job name. The project already parses the leg shape and drops a leg whose job endedsuccess(src/devops_cli/github/onboard/settings_rows.py:716). - Rejected: A regular expression on the values. The values vary by job,
shard 1 of 5at.github/workflows/ci.yml:144andrun 1 of 3, so one pattern misses a name. - Rejected: Read the Actions jobs of each workflow run. It misses required checks of other apps and needs one read per run.
- Rejected: Report every required name with parentheses. It lists valid checks whose job name holds parentheses.
- Chosen: Parse the name with
- What should the audit output and exit code be?: The audit prints a table by default and JSON with
--json, throughresolve_formatandemit_serializedas the other commands of the group do. It exits 0 when it lists no bad check and 1 when it lists at least one. (best practice) [sources: src/devops_cli/commands/repos.py:1004, docs/CLI_REFERENCE.md:63]- Chosen: Table by default,
--json, exit 1 on findings. A person reads the table, and a script can gate on the exit code. - Rejected: Table only, exit 0 always. No automation can tell whether the audit found a bad check.
- Rejected: JSON only, exit 1 on findings. A person must parse JSON to read the report.
- Chosen: Table by default,
- Who removes a bad required check from a ruleset?: A person removes each bad required check in the ruleset of the repository and records the result in a comment on the issue. The audit command changes no ruleset. [sources: docs/repos/onboard.md:97, SECURITY.md:114]
- Which GitHub client should the audit use?: Use the process's GitHub session with
gidgethubfor each API call. Do not run baregh. (best practice) [sources: docs/adr/0006-github-session-requests-go-through-gidgethub.md:11, AGENTS.md:13, openspec/specs/agent-instructions/spec.md:125]- Chosen: Existing GitHub session with
gidgethub. ADR 0006 sends each REST request through gidgethub and keeps pacing, retries, paging and error classes in one place. - Rejected: Shell out to
devops gh api. The audit reads each page of two listings and decodes them, which the session'spaginatealready does (docs/adr/0006-github-session-requests-go-through-gidgethub.md:11). - Rejected: New HTTP client. It duplicates an open, maintained library that the project uses.
- Chosen: Existing GitHub session with
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 26, 2026
Both work on repos onboard, but #6784 applies the onboard baseline while the candidate audits and removes bad required checks that onboard created.[-]chore(repos): audit existing rulesets for required checks from skipped jobs[/-][+]chore(repos): audit rulesets for required checks from skipped jobs[/+]devops-cli-service commentedon Nov 26, 2026
The job shortened the title of this item. The summary had 61 characters, and the limit is 60. The type and the scope stay.
chore(repos): audit existing rulesets for required checks from skipped jobsdevops-cli-service commentedon Nov 28, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
dan-petty commentedon Nov 30, 2026
The audit entries of
dan-petty/devcontainer-featuresare handled by dan-petty/devcontainer-features#38 (issue dan-petty/devcontainer-features#37) and by the ruleset step that follows its merge.mainof that repository requires the matrix job namestest,test-scenariosandpodman-host. Only a skipped run reports these names.Feature tests, which gives one result of the test jobs.detect-changes,test,test-scenariosandpodman-hostwithFeature testsin that ruleset.The entries stay until that step. This comment covers no other repository.