Repository navigation
feat: scripts/fleet_wave.py, the driver for the last fleet PR wave - #64
Merged
Merged
Conversation
Runs convert_repo.py across every public, non-archived crunchtools repo (or a --repos subset). A dry run by default: shallow clone at the default branch the API names, convert, verify (a second converter run is a no-op, the bootstrap is committed executable, nothing outside the converter's files changed), and record the plan in a TSV ledger. Preflight skips a repo whose SDLC_IMAGE the bootstrap would refuse or that has an open chore/python-sdlc PR. --apply pushes chore/sdlc-floating (one per repo, reused), opens or updates one PR with a fixed body, and queues a squash auto-merge via the REST and GraphQL APIs. The token comes from the environment variable --token-env names (GH_TOKEN), goes in a header, and is never printed or an argument. Sequential; a re-run skips what is done. tests/test_fleet_wave.py runs against a fake API and bare repos on disk standing in for GitHub, and is wired into the image's unit-test step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7Y1jg3ZJ6BsAEfhrPWFRh
| return wave | ||
|
|
||
|
|
||
| def run( |
There was a problem hiding this comment.
HIGH (Documentation): The public run interface has no docstring. This orchestration function accepts several inputs and returns a count mapping, but the required contents and meaning of that mapping are undocumented.
Suggestion: Document the parameters, the ledger and retry behavior, and the action-count mapping returned by the function.
Evidence:
def run(
wave: Wave, names: list[str], available: dict[str, str], ledger: Path, pause: float
) -> dict:
done = read_ledger(ledger)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7Y1jg3ZJ6BsAEfhrPWFRh
There was a problem hiding this comment.
Gatehouse found no issues.
Reviewed 1 commit since c57dc21 (incremental).
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.
Adds
scripts/fleet_wave.py, which runsconvert_repo.pyacross the org for the last fleet-wide PR wave.--repos FILEnames (for the pilots).convert_repo.py. Exit 2 is recorded as refused with the converter's own reason, and an empty diff as a no-op. Verify means--applyfollowed by a second run that must be a no-op, the bootstrap committed100755, and no changed file outside the converter's set.SDLC_IMAGEthe bootstrap would refuse (main,latest,X.Y.Zor@sha256:are allowed, and empty counts as unset), or that has an openchore/python-sdlcPR. That PR would edit therev:line this conversion deletes.--apply: commits the canonical message with a Co-Authored-By trailer, runs no hooks, and force-pusheschore/sdlc-floating. It then opens the PR with a fixed body covering what changed and how to roll back, or updates the PR already open on that branch, and enables squash auto-merge through GraphQL. It uses REST and GraphQL overhttp.client. The token comes from the env var--token-envnames (defaultGH_TOKEN) and goes only in a header: never in argv, never printed, and redacted from errors. git pushes with the credentials it already has.--sleep(default 3s) between repos. Exit codes: 0 means done, 1 means a repo failed or auto-merge wasn't enabled, 2 means the run couldn't start.Tests:
tests/test_fleet_wave.py(51 checks) runs against a fake API and bare repos on disk standing in for GitHub. It covers dry-run read-only behaviour, master branches, refusals, no-ops, earlier-wave PRs, a badSDLC_IMAGE, the open-vs-update path, auto-merge failure, ledger resume, the verify guards and token handling. It is wired into container.yml's unit-test step.Dry run, converter at main (c76e864), all 70 repos
There was no GH_TOKEN on the seat, so this run did not check
SDLC_IMAGE.--applyrequires a token and checks it.59 would-open · 7 refused · 4 skipped · 0 no-op · 0 failed
Refused (convert by hand, or move jobs out of
ci.yml):sdlc cistep is not the pinned form this script rewritesSkipped:
Full plan TSV
🤖 Generated with Claude Code
https://claude.ai/code/session_01R7Y1jg3ZJ6BsAEfhrPWFRh