Skip to content

feat: Centralize repo selection via core-repos allowlist #29

Description

@rubambiza

Summary

Introduce a single source of truth for which repos the programs act on, and wire the programs to it. Today repo selection is split across two mechanisms with no central config: the pr-review scripts hardcode a 4-repo array, while link-health and dep-bump scan whatever happens to be present under the local clone root. Neither excludes archived or non-core repos.

Excluding archived repos alone is insufficient (16 repos are active; only 8 are core), so an explicit allowlist is required.

Work

Allowlist + helpers

  • Add config/core-repos.txt: one rossoctl/<name> per line for the 8 curated core repos — rossoctl, automation, agent-skills, .github, cortex, examples, operator, workload-harness. Support # comments and blank lines.
  • Add helpers to scripts/program-lib.sh:
    • get_core_repos() — prints owner/name per line; resolves the config path from program-lib's own BASH_SOURCE, honors a $CORE_REPOS_FILE override for tests, and fails loud on a missing/empty file (never silently scans zero repos).
    • canonical_repo_for_dir() — maps a local clone-dir basename to its canonical rossoctl name (encapsulates the remap table kagentirossoctl, kagenti-extensionscortex, identity otherwise) in one place.
  • Re-point the "future seam" comment in pr-review-impact.sh to reference the allowlist as the current mechanism; note the org tier Custom Property remains the eventual replacement (not yet viable — property unstamped).

Rewire pr-review scripts

  • pr-review-impact.sh get_repos() → delegate to get_core_repos.
  • pr-review-scanner.sh REPOS=(...) → populate from get_core_repos; update the help example.

Wire local-clone scanners (allowlist ∩ clones)

  • In the link-health and dep-bump scanner/fixer loops, keep iterating clone dirs but skip any dir whose canonical_repo_for_dir is not in the allowlist (loaded once). Build API repo references as rossoctl/<canonical>, not <org>/<basename> — a naive basename would produce wrong names for the two remapped repos.
  • Update extract-broken-links.sh to take the canonical full repo name rather than hardcoding a kagenti/ prefix.

Acceptance

  • All programs derive their repo set from config/core-repos.txt; the 8 core repos are covered and archived / non-core repos are excluded.
  • A unit test exercises get_core_repos against a fixture via $CORE_REPOS_FILE, including the fail-loud-on-empty path.
  • Existing tests pass; fixtures updated where the repo-name prefix changed.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions