Skip to content

feat(agents): skip archived repos in drift tooling - #465

Merged
antoinetoussaint-byte merged 2 commits into
mainfrom
feat/skip-archived-repos-in-drift-tooling
Aug 23, 2026
Merged

feat(agents): skip archived repos in drift tooling#465
antoinetoussaint-byte merged 2 commits into
mainfrom
feat/skip-archived-repos-in-drift-tooling

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

Summary

Archived GitHub repos are frozen — they can never publish another tag or release, so their pins can't advance. Our fleet drift tooling had no archived awareness and would:

  • report archived repos as "N versions behind" in agent list / agent versions and codefly ci drift, and
  • file chore: issues against them via status release --create-issues — issues nobody can act on.

This came up because service-minio and service-s3 are now archived (see #452). This change makes the tooling ignore any archived repo automatically, now and for future archives — no hardcoded skip-list.

Changes

  • New pkg/gh — a single shared GitHub client + token-resolution path + Archived(ctx, owner, repo) helper. This is the shared client package Migrate agent-release publishing from gh CLI to go-github API #457/Migrate GitOps PR + chore-issue flows from gh CLI to go-github API #458 call for; seeded here so those migrations can build on it. Archivedfails safe: any lookup error (missing repo, rate limit, no auth) returns false, so we only ever skip on a confirmed archived flag and never silently hide a live repo.
  • cmd/agents/versions.gocollectInventory short-circuits archived repos: it reports only pinned + locally-cached versions and no remote sources, so drift computes 0 behind. Routed through a repoArchived seam matching the existing fetchReleases/fetchTags test seams.
  • cmd/status/release.go — gates chore-issue creation on the clone's origin remote being non-archived (org-agnostic; zero extra API calls on plain display, only on the --create-issues path). Prints ⏭ Skipping archived repo ….

Tests

  • TestArchivedRepoReportsNoDrift — archived repo ⇒ 0 behind, and asserts the remote source list is never even fetched.
  • TestParseGitHubRemote — https / ssh / .git / non-GitHub / garbage remotes.
  • Existing drift tests made hermetic (pin repoArchived off the network).

go build ./..., go vet, and the touched package tests are green.

Cost / tradeoff

One Repositories.Get per distinct agent on the drift path (deduped per run) and per would-be-issue on the status path. Offline / unauthenticated degrades to today's behavior.

Related

🤖 Generated with Claude Code

Archived repos are frozen — they can never publish another tag or release,
so their pins can't advance. The drift tooling had no archived awareness and
would still report them as "N versions behind" (agent list/versions,
codefly ci) and file chore issues against them (status release --create-issues)
that nobody can act on.
- Add pkg/gh: one shared GitHub client + token path + Archived() helper
(fails safe: any lookup error is treated as not-archived).
- cmd/agents/versions.go: collectInventory short-circuits archived repos to
0-behind, reporting only pinned + local-cache versions. Routed via a
repoArchived seam matching the existing fetch seams.
- cmd/status/release.go: gate chore-issue creation on the clone's origin
remote being non-archived (org-agnostic; zero extra API calls on display).
- Tests for the archived drift guard and GitHub remote URL parsing; existing
drift tests made hermetic.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antoinetoussaint-byteantoinetoussaint-byte added enhancement New feature or request go Pull requests that update go code lazybox:w:6eb7d4b0145d25d1d17f:a2d54a8cbf:6a8b7ee6 labels Aug 23, 2026
Reconcile with the go-github migration (#457/#458) that landed pkg/gh
first: drop the duplicated Token/Client from gh.go and keep only the
Archived helper on top of the shared gh.NewClient; reuse release.go's
agentRepository/parseGitHubRemote for the archived-issue gate.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte merged commit f0dc632 into mainAug 23, 2026
5 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or requestgoPull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@antoinetoussaint-byte