Skip to content

Org-level rulesets 404: three GetRuleset call sites pass includes_parents=false #433

Description

@CarlAllenn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions