Repository navigation
Description
Problem
Row 10 of devops repos onboard writes the union of the live required checks, the baseline and the github/repository.yaml of the repository (#7446). No source can remove a live check. So when a pull request deletes or renames a job that the ruleset main requires, the check never reports again and each later pull request stays BLOCKED, until a person edits the ruleset by hand (devops gh refuses ruleset writes from an agent).
Evidence (2026-11-27)
- dan-petty/devtools: the ruleset requires
Semantic PR title, the old title check. Since chore: re-adopt the infra repository template at v0.25.3 devtools#115 the check isPR title / Semantic PR title. (fix(repos): onboard requires checks of a merged template pull request #7476 stops onboard from adding the old name again, but nothing removes it.) - dan-petty/infra: the ruleset requires
Repository templateandkube-linter config. feat: call the workflows of github-workflows infra#235 moves these jobs to dan-petty/github-workflows, so fix(github): project reconcile rate quota exhaustion and unbounded candidate mutations #235 cannot merge until a person removes the two checks.
Expected
The repository declares its required checks in git, and an agent run of onboard brings the ruleset to that declaration, removals included. For example: the required checks rule of github/repository.yaml is the whole list (a check that it does not name and that the baseline does not name leaves the ruleset), or row 10 drops a live check that reported on none of the heads of the last N merged pull requests. A pull request that deletes a required job then also changes github/repository.yaml, and the run after the merge applies it.
Done when
- A test: a live ruleset that requires a check that the declaration no longer names, and
--confirm: row 10 removes it and names it after; dropped. The test fails onmain. - The docs of row 10 say how a repository removes a required check.
Source
Source: dan-petty/infra#235
Proposed design
Problem statement
devops repos onboard writes the union of the live required checks, the baseline and github/repository.yaml, so no source removes a live check. A pull request that deletes or renames a required job leaves the ruleset main waiting on a check that never reports, and each later pull request stays BLOCKED until a person edits the ruleset. The owner rejected more custom code in the command and named the OpenTofu provider integrations/github instead. The provider cannot yet declare the code_quality rule of main (upstream integrations/terraform-provider-github#3664 is open), so the change waits for that fix and for the OpenTofu stacks that live in dan-petty/infra and dan-petty/homelab.
Acceptance criteria
Requirement: Onboard sends no ruleset write
devops repos onboard MUST NOT send a request that creates or updates a repository ruleset.
Scenario: A confirmed run against a live ruleset
- WHEN a test runs the settings rows of
devops repos onboardwith--confirmagainst a fake GitHub whose rulesetmainrequires a check that the declaration does not name - THEN the write routes
ruleset-createandruleset-updaterun for no repository, and row 10 names the OpenTofu configuration as the owner of the required checks
Requirement: Record moves the ruleset to OpenTofu
The change MUST record a new ADR that supersedes ADR 0035 and amends ADR 0026 decision 7, so the OpenTofu configuration owns the ruleset main.
Scenario: The decision records check
- WHEN a test runs
uv run devops ci test tests/invariants/test_adr_records.py - THEN the command exits 0, ADR 0035 holds
status: supersededwith asuperseded-bylink, and the new record names the OpenTofu ruleset
Requirement: Ruleset declared in OpenTofu
The OpenTofu configuration MUST declare the ruleset main and its required status checks with the github_repository_ruleset resource of provider integrations/github.
Scenario: Validate the root stack
- WHEN a person runs
tofu validateintf/github/dan-pettyof dan-petty/homelab - THEN the command prints
Success! The configuration is valid.and exits 0
Requirement: One list holds the required checks
The required status checks of the ruleset MUST come from one list variable, so a check that the list omits is not required.
Scenario: Plan a removal
- WHEN a person removes one check name from the list variable and runs
tofu planin the root stack - THEN the plan shows one update of
github_repository_ruleset.mainthat removes that check, and no other resource change
Requirement: Help states how to remove a check
The help text of devops repos onboard MUST state that the OpenTofu configuration owns the required checks and how a repository removes one.
Scenario: Read the help of the command
- WHEN a test runs
devops repos onboard --help - THEN the output states that the OpenTofu configuration declares the required checks and that a removal is a change of the list variable and an apply
Requirement: Row 10 docs state how to remove a check
The row 10 page MUST name the OpenTofu configuration as the owner of the required checks and the list variable as the place of a removal.
Scenario: Check the row 10 page
- WHEN a person runs
uv run devops ci --check --only docs - THEN the command exits 0, and
docs/repos/onboard.mdrow 10 names the list variable and the owner'stofu applyas the removal step
Requirement: Pending a person after the merge
The owner MUST apply the OpenTofu configuration after the merge, so the ruleset drops each check that the declaration no longer names.
Scenario: Plan and apply the removal
- WHEN the owner removes the stale check name from the list variable and runs
tofu planand thentofu applyin the root module - THEN the plan shows one update of
github_repository_ruleset.mainthat removes that check, the apply succeeds, and the ruleset requires only the declared checks
Existing Tool Considered
The open, maintained tool is the OpenTofu provider integrations/github (MIT, pinned 6.13.0 with OpenTofu 1.13.9): github_repository_ruleset declares the ruleset main and its required status checks, and github_repository_environment, github_issue_label and github_repository declare the other settings. It lacks the code_quality rule of a ruleset (integrations/terraform-provider-github#3664 is open), so it cannot yet declare the main ruleset that the baseline keeps, and it has no reader for github/repository.yaml, so the values move to HCL and the owner applies the plan (ADR 0026 decision 3). No alternatives check has run on this issue.
Key questions
- How does the declaration hold the required checks?: One list variable of check names feeds the required-status-checks rule of the
github_repository_rulesetresource ofmain. The resource sets the whole list, so a name that the list omits leaves the ruleset at the next apply. One resource for each check would need a resource deletion for a removal and would make the plan order unstable. (best practice) [sources: openspec/changes/archive/2026-11-27-7423-onboard-repo-required-checks/proposal.md:41]- Chosen: One list variable. A removal is one line of the variable and the plan shows it, because the resource sets the whole list from that value.
- Rejected: One resource for each check. A removal needs the deletion of a resource, and the order of the checks is not stable in the plan.
- Which tool declares the required checks of the ruleset, removals included?: The OpenTofu provider
integrations/githubwithgithub_repository_ruleset, once upstreamintegrations/terraform-provider-github#3664closes. The provider plans each change, removals included, and its state finds drift, but it cannot hold thecode_qualityrule ofmaintoday, so the change waits. (best practice) [sources: AGENTS.md:9, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:20, docs/adr/0035-the-onboard-command-owns-the-repository-settings.md:27, openspec/changes/archive/2026-11-27-7423-onboard-repo-required-checks/proposal.md:41]- Chosen: OpenTofu provider integrations/github. AGENTS.md rule 3 puts an open tool before custom code, and ADR 0026 makes GitHub settings OpenTofu code that the owner applies.
- Rejected: Row 10 drops a check that no head reports. The owner rejected more custom code in this command; that change was about 40k tokens and 2 hours (
openspec/changes/archive/2026-11-27-7423-onboard-repo-required-checks/proposal.md:41). - Rejected:
devops ghwrites the ruleset.devops ghrefuses ruleset writes from an agent (SECURITY.md:58), so a person would still edit the ruleset by hand.
- Can the provider declare the ruleset
maintoday?: No. The provider cannot hold thecode_qualityrule of themainruleset, and upstreamintegrations/terraform-provider-github#3664is open, so a resource that heldmainwould drop that rule. [sources: docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:20, docs/adr/0035-the-onboard-command-owns-the-repository-settings.md:14, openspec/changes/archive/2026-11-22-6782-adr-repository-settings/proposal.md:34] - Where does the OpenTofu configuration of the GitHub settings live?: The shared module lives in dan-petty/infra as
tf/modules/github-repository, and the root stacks live in dan-petty/homelab astf/github/dan-pettyandtf/github/retric-ai. This repository has notf/tree, so the declaration is not a file of this repository. [sources: docs/adr/0032-infrastructure-templates-live-in-four-homes.md:69, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:27, openspec/changes/archive/2026-11-22-6679-deploy-cloud-on-infra-modules/proposal.md:26] - How does the change record that the provider owns the ruleset?: A new ADR supersedes ADR 0035 and amends ADR 0026 decision 7. ADR 0035 decision 2 says no OpenTofu resource writes a setting that the command owns, and its decision 7 gives the
mainruleset to the command; a body that contradicts the code is superseded, and an agent never edits the body of an accepted record. (best practice) [sources: docs/adr/0035-the-onboard-command-owns-the-repository-settings.md:49, docs/adr/0035-the-onboard-command-owns-the-repository-settings.md:67, docs/adr/README.md:69, docs/adr/README.md:50]- Chosen: A new ADR supersedes ADR 0035. The record's body contradicts the new code, and the rules of
docs/adr/README.mdsay that the next change supersedes it. - Rejected: Amend ADR 0035 in place. An agent never edits the body of an accepted record, and the body contradicts the code.
- Rejected: Write no record. The code would contradict ADR 0035 decisions 2 and 7, and the alternatives check reads the records in force.
- Chosen: A new ADR supersedes ADR 0035. The record's body contradicts the new code, and the rules of
- Does
devops repos onboardkeep the write of the ruleset?: No. Row 10 stops each ruleset write and names the OpenTofu configuration as the owner of the required checks. The owner applies the ruleset change, and the new ADR records the move. (best practice) [sources: AGENTS.md:21, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:35, src/devops_cli/github/onboard/settings_rows.py:773]- Chosen: Remove the ruleset write from onboard. One source of truth. AGENTS.md gives repository settings to a person, who applies the OpenTofu change.
- Rejected: Keep the write and warn. Two writers of one ruleset. A later onboard run would add a removed check back.
- How does a repository remove a required check after this change?: The repository removes the check name from the list variable of the OpenTofu configuration, and the owner runs
tofu planand thentofu apply. The help of row 10 anddocs/repos/onboard.mdstate this. (best practice) [sources: AGENTS.md:21, docs/adr/0026-github-settings-are-opentofu-code-the-owner-applies.md:35]- Chosen: Change the OpenTofu variable and apply. The declaration is the whole list, so the plan shows the removal before the owner applies it.
- Rejected: Ask an agent to edit the ruleset.
devops ghrefuses ruleset writes from an agent (SECURITY.md:58), and AGENTS.md gives repository settings to a person.
- Does this change move the other settings rows of onboard to OpenTofu?: No. This change moves the ruleset only, because a stale required check blocks a merge. The environments, labels and repository rows follow in a later item of the same migration. (best practice) [sources: AGENTS.md:7, docs/adr/0035-the-onboard-command-owns-the-repository-settings.md:40]
- Chosen: Move the ruleset only. One pull request delivers the defect fix with its test and its docs, and the other rows block no merge today.
- Rejected: Move every settings row at once. The change would hold four migrations and their tests, and it would exceed one pull request.
Fit
Needs splitting into 3 items:
- devops-cli: stop row 10 writing the ruleset, add the test that no ruleset write happens, supersede ADR 0035, and update the help and row 10 docs.
- dan-petty/infra: add the ruleset
mainand its required-status-checks list to the shared moduletf/modules/github-repository. - dan-petty/homelab: declare the ruleset
mainintf/github/dan-pettyandtf/github/retric-aifrom the list variable, and plan the removal.
Suspected block
Upstream integrations/terraform-provider-github#3664: the provider cannot hold the code_quality rule of the ruleset main, so the ruleset stays with devops repos onboard until a provider release carries the rule.
Dependencies
None.
Activity
dan-petty commentedon Nov 28, 2026
PRs stay BLOCKED until a person edits the ruleset by hand, which blocks merges and adds manual work.Both target row 10 and github/repository.yaml required checks, but #7423 added the ability to read and add checks from the repo file, while this candidate asks for the ability to remove checks not in the declaration.dan-petty commentedon Nov 28, 2026
Closed as not planned: the owner rejects more custom code where an open tool solves the problem (2026-11-27). The removal gap exists because
devops repos onboardreimplements repository settings as code (rulesets, environments, labels, thegithub/repository.yamlschema). The OpenTofu providerintegrations/github(github_repository_ruleset,github_repository_environment,github_issue_label,github_repository) declares the same settings;tofu planshows each change, removals included, and the state finds drift. The replacement of the settings rows of onboard by that provider is the item to plan instead.devops-cli-service commentedon Nov 28, 2026
Next step: a person splits the item, or replies in a comment or edits the body to keep one item. See Fit in the section Proposed design of the body.
docs(spec): plan #7497 replace the onboard settings rows with OpenTofu (