Repository navigation
Description
Problem
When row 10 of devops repos onboard finds a difference in a ruleset, its change line is ruleset <name>: required checks <list>. The line names only the required checks, also when the required checks match and another key differs. The other rows give one line for each differing key (change_lines). So a person cannot see from --plan which part of the ruleset row 10 writes.
Evidence
On 2026-11-27, devops repos onboard dan-petty/homelab --plan --only 10 (origin/main) gave 10. Ruleset: pending and ruleset main: required checks K8s, Lint, PR title / Semantic PR title. The live ruleset main already requires these three checks. The difference is that the live ruleset has no code_scanning rule and no code_quality rule, which the baseline and the github/repository.yaml of homelab hold. The output does not name these rules.
Done when
- A pending or applied row 10 names each differing key of the ruleset, such as each rule type that it adds, and names the required checks only when they differ. A test fails on the base.
Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches found no tool that diffs a live GitHub ruleset against a baseline and names each differing rule key; gh ruleset view only prints one ruleset and PyGithub only models rules, so the fix belongs in the project's own change_lines.
Lacks:
- No baseline comparison of a live ruleset against a declared one
- No per-key diff naming added or missing rule types
- No integration with the onboard plan output format
Proposed design
Problem statement
Row 10 of devops repos onboard writes one change line for a ruleset and names only the required checks. The line names the checks also when the checks match and another key, such as a rule type, differs. A person cannot see from --plan which part of the ruleset row 10 writes. The other rows give one line for each differing key. The fix makes row 10 do the same. Change 7497 deletes this code when the OpenTofu migration lands, so the fix reuses the existing helper and stays small.
Acceptance criteria
Requirement: Each differing rule type named
Row 10 SHALL name each rule type that the ruleset difference adds or removes in the change line of the plan.
Scenario: The baseline adds code_scanning and code_quality
- WHEN the live
mainruleset has nocode_scanningrule and nocode_qualityrule and the baseline holds both - THEN the plan of row 10 holds a change line that names
code_scanningand a change line that namescode_quality
Requirement: Matching required checks unnamed
Row 10 SHALL name the required checks only when the required checks differ.
Scenario: The required checks match
- WHEN the live ruleset requires the same three checks as the baseline and only a rule type differs
- THEN no change line of row 10 holds the required check names and one change line names the differing rule type
Requirement: Differing required checks named
Row 10 SHALL name the required checks when the required checks differ.
Scenario: The baseline adds a required check
- WHEN the live ruleset requires
K8sandLintand the baseline requiresK8s,LintandPR title - THEN the change line of row 10 names
PR title
Requirement: Applied row names the same keys
Row 10 SHALL write the same per-key change lines in the applied output as in the plan.
Scenario: Apply writes the ruleset
- WHEN row 10 applies a ruleset whose rule types differ from the live ruleset
- THEN the applied output holds the same per-key change lines that the plan gave
Requirement: Test fails on the base
The new test of row 10 MUST fail on the base commit and pass on the change.
Scenario: Fail-to-pass proof
- WHEN
uv run devops ci fail-to-pass --base origin/mainruns the new test - THEN the command reports the new test as failed on the base and passed on the change
Existing Tool Considered
The alternatives check of 2026-11-27 in the issue body gives the verdict none and names no tool: gh ruleset view prints one ruleset and PyGithub only models rules, so neither compares a live ruleset with a baseline. The block in the issue body lists what the check covers and lacks. The change builds no new formatter: it reuses change_lines of src/devops_cli/github/onboard/model.py:206, which the other rows already use, and adds one test. The written cost is an estimated 4,000 tokens and 2 hours of elapsed time. A new ruleset diff engine would take days.
Key questions
- Which helper gives one line for each differing settings key?:
change_linesatsrc/devops_cli/github/onboard/model.py:206gives one line for each differing key of a settings diff.src/devops_cli/github/onboard/settings_rows.pycalls it for the other rows. Row 10 writes its own line, so that line names only the required checks. [sources: src/devops_cli/github/onboard/model.py:206, src/devops_cli/github/onboard/settings_rows.py] - How does row 10 name each differing ruleset key?: Row 10 passes the ruleset difference to
change_linesand prints its lines, as the other rows do. The required checks appear only when the required checks differ. (best practice) [sources: src/devops_cli/github/onboard/model.py:206, src/devops_cli/github/onboard/settings_rows.py, tests/github/onboard/test_onboard_ruleset_merge.py]- Chosen: Reuse
change_linesfor the ruleset difference. The helper already gives one line for each differing key, so the change adds no new formatter. - Rejected: Write a ruleset-specific diff formatter. It duplicates
change_linesand adds code to keep. - Rejected: Print the live ruleset and the baseline whole. The difference is lost in long output, so the row hides the key again.
- Chosen: Reuse
- What does the OpenTofu migration do to this code?: Task 3.3 of change 7497 deletes
change_lines,ruleset_merge.pyand themainpart of row 10 when the migration lands, as ADR 0041 decides. The fix adds no new engine, so the migration deletes it with that code. [sources: openspec/changes/7497-onboard-settings-opentofu/tasks.md:33, openspec/changes/7497-onboard-settings-opentofu/proposal.md:55, docs/adr/0041-opentofu-holds-the-repository-settings.md:14] - Does this item still deliver a fix before the migration lands?: Build the fix now with the existing helper. The migration is not delivered, and the misleading line costs a person time at each
--plantoday. Change 7497 then deletes the fix with the engine that it deletes. (best practice) [sources: docs/adr/0041-opentofu-holds-the-repository-settings.md:14, openspec/changes/7497-onboard-settings-opentofu/tasks.md:33]- Chosen: Build the small fix now. The output misleads a person today, and the fix is a few lines and one test.
- Rejected: Close the item as not planned. The migration is not delivered, so the misleading line stays for an unknown time.
- Where does the test of the new change lines go?: Extend
tests/github/onboard/test_onboard_ruleset_merge.py, which already builds a live ruleset with acode_scanningrule and a baseline ruleset. (best practice) [sources: tests/github/onboard/test_onboard_ruleset_merge.py:80, tests/support/github_repository.py:291, tests/support/github_repository.py:298]- Chosen: Extend
tests/github/onboard/test_onboard_ruleset_merge.py. The file already holds the live and baseline ruleset fakes that the test needs. - Rejected: Add a new test file. It duplicates the fakes of
tests/support/github_repository.py.
- Chosen: Extend
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 27, 2026
Both concern row 10 ruleset handling, but 7326 asks to stop lowering stricter settings while the candidate asks the plan output to name each differing key.devops-cli-service commentedon Nov 27, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (8)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Released in v0.241.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.241.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 00:41 UTC