Documentation
¶
Overview ¶
Package plan turns a config model into a flat list of intended actions per (target, kind, name).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EffectiveIgnored ¶
EffectiveIgnored returns the cascaded ignored list at a single repo.
Useful for downstream code (diff) that needs an ignored set for marking extras. A name is effectively ignored when it ends up in an ActionIgnored intent under ForRepoCascade.
func EffectiveOrgIgnored ¶
EffectiveOrgIgnored returns the org-level ignored list (no cascade).
Useful for downstream code that needs an ignored set for marking extras at the org scope. Unlike repo-scope ignored, there is no cascade across scope classes; org.ignored applies only to the org-level GitHub object.
Types ¶
type Intent ¶
type Intent struct {
Repo string
Kind Kind
Name string
Action Action
Entry *config.Entry
// OverridesAllRepos is true when this intent's name was also present in
// all-repos.managed and the per-repo entry took precedence. Reserved for
// audit-side override reporting; runtime behavior is unaffected.
OverridesAllRepos bool
// ShieldsAllReposManaged is true when this is an ActionIgnored intent
// produced by per-repo.ignored shielding an all-repos.managed entry.
// Reserved for audit-side override reporting; runtime behavior is
// unaffected.
ShieldsAllReposManaged bool
// IsOrg distinguishes an org-level intent (different GitHub object class)
// from a repo-level intent. When true, Repo is empty and the entry is
// targeted at the named organization.
IsOrg bool
// Visibility is the org-level secret/variable visibility envelope and is
// only meaningful when IsOrg is true. One of "all", "private", "selected".
Visibility string
// SelectedRepos is the static list of repo names that may access the
// entry; only populated when IsOrg && Visibility == "selected".
SelectedRepos []string
}
Intent is one (target, kind, name) action with its source entry.
func ForOrg ¶
ForOrg returns intents for an org-level scope.
Org intents are a different GitHub object class than repo intents (org secrets/vars/dependabot live on the organization, not on a repo) and are therefore returned with IsOrg=true and Repo="". The cascade rules between per-repo / all-repos / org operate on repo-level objects only — org-scope intents do not collide with repo-scope intents.
Output order is stable: section order vars, secrets, dependabot; within each section, managed names sorted, then ignored names sorted.
func ForRepo ¶
ForRepo returns intents for every managed entry on the repo plus a skip-intent for every name in the ignored block.
Output order is stable: section order vars, secrets, dependabot; within each section, managed names sorted, then ignored names sorted.
func ForRepoCascade ¶
ForRepoCascade returns intents for one repo after applying the per-repo > all-repos precedence rules.
Rules (per kind, per name):
- In per-repo.managed → managed (per-repo entry). Marked OverridesAllRepos when the same name was also in all-repos.managed.
- In per-repo.ignored → ignored.
- In all-repos.managed (and not above) → managed (all-repos entry).
- In all-repos.ignored (and not above) → ignored.