feat(bootstrap-repo): recover lost fixes + cli flavor + registry#267
Merged
feat(bootstrap-repo): recover lost fixes + cli flavor + registry#267
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ede0515content that didn't make it through the squash:_sync_one_repo.pyshim — callsRepoSetupSyncer.sync_repository(target)directly since ghcommon's CLI only exposes the auto-discover bulk methodsync-github-labels.pyinvocation — uses positional(owner, repo)args +--labels-fileflag, readsPAT_TOKEN/GITHUB_TOKEN(notGH_TOKEN)verify_bootstrap.shfalse-positive whenrequired_status_checksis null (no PR-triggering workflows)Without these,
bootstrap_repo.shfails on every adoption attempt against a non-trivial repo.2. New
cliflavorSurfaced by attempting to bootstrap
magnet-handler— a Go binary distributed via goreleaser. Doesn't fitservice(no Dockerfile, ships as native binary) orlibrary(not imported). Newcliflavor:CHANGELOG.mdonly (same as library)repository.type: cliin.github/repository-config.ymlreferences/flavors.mdwith cross-flavor distinctions3. Adopted-repos registry
Writes
ghcommon/.github/bootstrapped-repos.jsonon 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 getlast_bootstrappedrefreshed;first_bootstrappedis 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
shellcheckpassesruffpassesquick_validate.pyreports skill is valid_update_registry.pyround-trip test (creates new file, idempotent updates work)bootstrap_repo.sh --flavor cli --mode adopt --name magnet-handlerafter merge — first real-world adoption