Repository navigation
feat: compare who may bypass each repository-level ruleset - #110
Conversation
The effective rules of a branch do not show who may bypass them, and only organization rulesets were compared in full. A repository-level ruleset whose bypass went back to "always" was therefore invisible to the check. A profile can now list the bypass actors a repository-level ruleset may have (`ruleset_bypass`). Every actor of such a ruleset must be one of them, so an empty list allows none and a ruleset with fewer actors than allowed passes. A ruleset whose bypass list the login cannot see is a could-not-verify line. Atrinik's baseline records the owner's rule: bypass only through a pull request, and none on the archived repository's ruleset. The script is 563 lines, over the 550 at which its size test stopped it. The test now stops it at 575 and the texts say about 550 lines. Co-Authored-By: Claude <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
|
Self-review of What was reviewed A fresh-context reviewer reviewed the whole diff and all of It also ran these cases offline against the fixtures, and each behaved as intended: a clean organization; a failed ruleset listing (two could-not-verify lines, one for each check that could not run); an archived repository whose ruleset has an owner bypass; an override that replaces the list; a repository-level tag ruleset with an "always" bypass for an integration; a Findings: none. Noted, not changed: the fixture baseline has no State 38 offline tests pass. The script is 563 lines; the size test now stops it at 575, and README and AGENTS.md say about 550. The description states this as the owner's decision. |
Summary
The settings check now compares who may bypass each repository-level ruleset. Until now it could not see that: a branch's effective rules do not show bypass, and only organization rulesets were compared in full.
One thing to decide by merging or not: this takes the script to 563 lines, over the 550-line stop that its own size test enforced. The pull request raises that stop to 575 and changes "about 500 lines" to "about 550" in the texts. See "Intent brief" for why I did not make room another way.
Intent brief
ruleset_bypass, lists the bypass actors a repository-level ruleset may have. It is an allow-list: every actor of such a ruleset must match one entry. An empty list allows none. A ruleset with fewer actors than allowed passes, because it is stricter.{"actor_type": "OrganizationAdmin", "bypass_mode": "pull_request"}matches whateveractor_idGitHub reports.gh api -X GET; exit codes unchanged; standard library only; works withoutadmin:org.Implementation / behavior
check_settings.py:check_ruleset_bypass, called for a profile that has the key; the key's shape in--validate.baselines/atrinik.json:standardallows the organization owner through a pull request only;archivedallows none. Atrinik has one repository-level ruleset today, on the archivednawerhals, with no bypass.README.mdandAGENTS.md: the new comparison, the new key, and the size limit.tests/test_check_settings.py: one test with six cases (allowed, none, "always", an extra team, hidden list, unreadable ruleset); the size test's stop.Validation
python3 -m unittest discover -s tests: 38 tests pass, offline.python3 .github/scripts/check_repository.py: no problems.python3 check_settings.py --validate baselines/atrinik.json: valid.git diff --check: clean.Limitations / follow-up
ruleset_bypassreplaces the list.🤖 Generated with Claude Code