Skip to content

feat(bootstrap-repo): recover lost fixes + cli flavor + registry#267

Merged
jdfalk merged 2 commits intomainfrom
feat/bootstrap-cli-flavor
Apr 25, 2026
Merged

feat(bootstrap-repo): recover lost fixes + cli flavor + registry#267
jdfalk merged 2 commits intomainfrom
feat/bootstrap-cli-flavor

Conversation

@jdfalk
Copy link
Copy Markdown
Owner

@jdfalk jdfalk commented Apr 25, 2026

Summary

Three bundled changes after PR #266 merged with only the first of three commits (the two fix commits got dropped — the script on main is currently broken in the same ways the dry-run originally caught).

1. Recover dropped fixes (cherry-picked from feat/bootstrap-repo-skill)

Restores commit ede0515 content that didn't make it through the squash:

  • New _sync_one_repo.py shim — calls RepoSetupSyncer.sync_repository(target) directly since ghcommon's CLI only exposes the auto-discover bulk method
  • Fix sync-github-labels.py invocation — uses positional (owner, repo) args + --labels-file flag, reads PAT_TOKEN/GITHUB_TOKEN (not GH_TOKEN)
  • Fix verify_bootstrap.sh false-positive when required_status_checks is null (no PR-triggering workflows)

Without these, bootstrap_repo.sh fails on every adoption attempt against a non-trivial repo.

2. New cli flavor

Surfaced by attempting to bootstrap magnet-handler — a Go binary distributed via goreleaser. Doesn't fit service (no Dockerfile, ships as native binary) or library (not imported). New cli flavor:

  • Seeds CHANGELOG.md only (same as library)
  • repository.type: cli in .github/repository-config.yml
  • Documented in references/flavors.md with cross-flavor distinctions

3. Adopted-repos registry

Writes ghcommon/.github/bootstrapped-repos.json on every successful bootstrap.

{
  "version": 1,
  "repos": [
    {"owner": "jdfalk", "name": "magnet-handler", "flavor": "cli",
     "mode": "adopt", "first_bootstrapped": "2026-04-25T...Z",
     "last_bootstrapped": "2026-04-25T...Z"}
  ]
}

Idempotent upserts via _update_registry.py — existing (owner, name) entries get last_bootstrapped refreshed; first_bootstrapped is preserved. Skill writes the file but doesn't commit it; manual commit from ghcommon enables future "bootstrap-all" sweeps + cross-machine sharing.

Answers the question "where else are we tracking adopted repos?" — the answer was previously "nowhere centralized."

Test plan

  • shellcheck passes
  • ruff passes
  • quick_validate.py reports skill is valid
  • _update_registry.py round-trip test (creates new file, idempotent updates work)
  • Run bootstrap_repo.sh --flavor cli --mode adopt --name magnet-handler after merge — first real-world adoption

jdfalk and others added 2 commits April 25, 2026 06:47
Live dry-run on jdfalk/bootstrap-test-DELETE-ME surfaced three
integration bugs:

1. ghcommon's sync-repo-setup.py CLI only exposes
   sync_all_repositories() (auto-discovers targets) — not the
   single-target sync_repository() method we need. Add a small Python
   shim (_sync_one_repo.py) that imports the existing class and calls
   the existing per-repo method, without modifying ghcommon's script.

2. ghcommon's sync-github-labels.py uses positional args (owner, repo),
   not flags, and reads PAT_TOKEN/GITHUB_TOKEN env vars (not GH_TOKEN).
   Fix bootstrap_repo.sh to match the actual signature.

3. verify_bootstrap.sh false-positive when required_status_checks is
   null (no PR-triggering workflows). Skip the .strict check in that
   case rather than treating null != "true" as drift.

After these fixes, end-to-end dry-run is fully idempotent: 4th run
produces zero file changes and verify_bootstrap.sh exits 0. Label sync
hits GitHub's secondary rate limit around ~190/242 labels but is
non-fatal and resumes on re-run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two related additions:

1. New 'cli' flavor for distributable binaries (goreleaser/brew/winget)
   that don't fit 'service' (no Dockerfile) or 'library' (not imported).
   Seeds CHANGELOG.md only; same content as library overlay but with
   repository.type: cli for downstream tooling.

2. Per-bootstrap registry at ghcommon/.github/bootstrapped-repos.json.
   Schema {version, repos: [{owner, name, flavor, mode,
   first_bootstrapped, last_bootstrapped}]}. Idempotent upserts via
   _update_registry.py. Skill writes the file but doesn't commit it;
   manual commit from ghcommon enables future "bootstrap-all" sweeps
   and sharing across machines.

Drops PLAN.md re-introduced by the cherry-picked recovery commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added size/L type:documentation Improvements or additions to documentation tech:python Python programming language tech:shell Shell scripting (bash, sh) labels Apr 25, 2026
@jdfalk jdfalk merged commit 458d4a7 into main Apr 25, 2026
35 of 41 checks passed
@jdfalk jdfalk deleted the feat/bootstrap-cli-flavor branch April 25, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L tech:python Python programming language tech:shell Shell scripting (bash, sh) type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant