Summary
Repos governed by organization-level rulesets (GitHub Team/Enterprise plans) fail immediately:
Error: fetching active controls: getting branch controls: checking status:
could not populate RequiredChecks:
GET https://api.github.com/repos/ORG/REPO/rulesets/NNNN?includes_parents=false: 404 Not Found
ListRulesForBranch correctly returns rules inherited from org rulesets, but the follow-up GetRuleset calls in pkg/ghcontrol/checklevel.go pass includes_parents=false, and the repo-level rulesets endpoint 404s for a ruleset whose source is the organization. One call site (line ~335, computeTagHygieneControl path) already passes true; the other three (lines ~155, ~183, ~210) pass false.
Repro
Apply any branch ruleset at the org level (~ALL repos), then run sourcetool status org/repo.
Fix
Align the three call sites to includes_parents=true — verified working against a live org-ruleset setup (org monumental-archive, all rules org-level):
- fullRuleset, _, err := ghc.Client().Repositories.GetRuleset(ctx, ghc.Owner(), ghc.Repo(), ruleset.GetID(), false)
+ fullRuleset, _, err := ghc.Client().Repositories.GetRuleset(ctx, ghc.Owner(), ghc.Repo(), ruleset.GetID(), true)
(same one-word change at the other two sites)
Happy to send this as a PR if useful.
Summary
Repos governed by organization-level rulesets (GitHub Team/Enterprise plans) fail immediately:
ListRulesForBranchcorrectly returns rules inherited from org rulesets, but the follow-upGetRulesetcalls inpkg/ghcontrol/checklevel.gopassincludes_parents=false, and the repo-level rulesets endpoint 404s for a ruleset whose source is the organization. One call site (line ~335,computeTagHygieneControlpath) already passestrue; the other three (lines ~155, ~183, ~210) passfalse.Repro
Apply any branch ruleset at the org level (
~ALLrepos), then runsourcetool status org/repo.Fix
Align the three call sites to
includes_parents=true— verified working against a live org-ruleset setup (orgmonumental-archive, all rules org-level):(same one-word change at the other two sites)
Happy to send this as a PR if useful.