Skip to content

Say that GitHub doesn't require code-owner approval for rule changes - #953

Closed
anth-volk wants to merge 4 commits into
mainfrom
code-owner-docs
Closed

anth-volk wants to merge 4 commits into
mainfrom
code-owner-docs

Conversation

@anth-volk

@anth-volk anth-volk commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #952

Same-Repository Draft PR Check

  • This PR is a draft.
  • This PR is from a branch in PolicyEngine/policyengine-sim-api, not a personal fork.

Summary

The docs implied GitHub won't merge a change to the rule files until a core developer approves it. The default branch's ruleset (main, id 3680274) doesn't require that. It requires:

  • a pull request with one approving review, from anyone with write access;
  • passing CI complete and PR description checks.

Its require_code_owner_review is false, so CODEOWNERS only makes GitHub request a review from @PolicyEngine/core-developers on pull requests that change those paths and aren't drafts. This PR corrects the docs and leaves the ruleset unchanged.

  • sim.process.rule-machinery-code-owned statement in rules/registry.toml. The first sentence, which says what the rule asks for, is unchanged. A second sentence says it's a team convention GitHub doesn't enforce, and gives what the ruleset needs. The rule stays doc-only.
  • scripts/rules/tests/test_code_owner_rule.py, new. It reads the registry and checks that the statement still asks for the same approval, that the rule stays doc-only, and that the statement says GitHub doesn't enforce it.
  • docs/generated/rules.md and the AGENTS.md rules block, regenerated with python -m scripts.rules render.
  • .github/CODEOWNERS comment. It said changes "need review from a core developer" and that files left out "are not blocked". It now says core-developer approval is a team convention, gives what the ruleset enforces, and says the listing only adds a review request. This is a prose-only edit: no check reads the comment.

Left unchanged:

Commits (red, then green)

  1. Test that the code-owner rule says GitHub doesn't enforce it. Red: of the 3 new tests, test_rule_says_github_does_not_require_code_owner_review fails. The rules guard passes.
  2. Say in the code-owner rule that GitHub doesn't enforce it. The 3 tests pass. Red for the generated files: the rules guard fails with "docs/generated/rules.md is stale" and "the rules block in AGENTS.md is stale".
  3. Regenerate the rules docs for the code-owner rule's statement. Green: the 3 tests and the rules guard pass.
  4. Say in the CODEOWNERS comment that GitHub doesn't require code owners. Prose only. The tests and the rules guard still pass.

Testing

Each commit was checked out on its own and run with the code-owner rule tests and python -m scripts.rules guard --base-ref origin/main, with the results above. At the head commit:

  • ruff 0.15.22 (the CI pin): ruff format --check projects/*/src libs/*/src and ruff check . pass, and the new test file is formatted.
  • python scripts/run_quality_guards.py: pass.
  • python -m scripts.rules guard --base-ref origin/main: pass.
  • python -m scripts.rules render: no diff.
  • python -m unittest discover -s scripts/rules/tests -t .: 249 tests pass.

🤖 Generated with Claude Code

anth-volk and others added 4 commits October 27, 2026 21:07
The main branch's ruleset needs one approving review from anyone with
write access and doesn't require code-owner review, but the statement
of sim.process.rule-machinery-code-owned doesn't say so. The new tests
read the repository's registry and check that the statement:

- still asks for a core developer's approval, word for word;
- belongs to a rule that stays doc-only;
- says that approval is a team convention GitHub doesn't enforce, and
  gives what the ruleset needs.

The last test fails: the statement doesn't say that yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The statement of sim.process.rule-machinery-code-owned keeps its first
sentence, which asks for a core developer's approval, and adds that
this is a team convention: the default branch's ruleset needs one
approving review from anyone with write access and doesn't require
code-owner review. The rule stays doc-only.

The code-owner rule tests now pass. The rules guard fails, because
docs/generated/rules.md and the AGENTS.md rules block still show the
old statement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ran python -m scripts.rules render, so docs/generated/rules.md and the
AGENTS.md rules block show the new statement and the rules guard
passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The comment said changes to the listed files need a core developer's
review, and that files left out "are not blocked". The main branch's
ruleset doesn't require code-owner review, so nothing is blocked:
listing a path only makes GitHub request a review from its owners on
pull requests that aren't drafts. The comment now describes the
approval as a team convention and says what the ruleset needs.

No check reads this comment.

Fixes #952

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs imply GitHub requires a core developer's approval for rule changes

1 participant