feat(cli): provider push — publish the generated tree as a branch and pull request - #104
Merged
Conversation
… pull request tfpfgen provider push -out DIR -repo URL shallow-clones the target repository, syncs the generated tree over it, and prunes exactly the files the target's previous manifest owned that are no longer produced -- the same ownership rule the drift check enforces, so the repository's own files are never touched. No difference exits 0 and pushes nothing. A real difference is committed with stated provenance (tool version, blueprint sources, change count) to the generator-owned tfpfgen/generate-<digest> branch -- the digest comes from the manifest, so identical content always names the same branch -- force-pushed, and answered with a pull request against the default branch; a branch whose pull request is already open is updated rather than duplicated. Non-GitHub remotes get the branch push and a note instead of a pull request. The token comes from TFPFGEN_GITHUB_TOKEN (or GITHUB_TOKEN, which Actions injects), never from a flag, and reaches git through GIT_CONFIG_* environment variables so it cannot appear in the process table -- the same doctrine as the probe credential. Tested end to end against local bare repositories (sync, prune, no-op, dry-run, branch content and commit provenance) and against a stub GitHub API for both the created and already-open pull-request paths. docs/cli.md documents the verb and the drift test now holds it there. Co-Authored-By: Claude Fable 5 <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.
Why
This commit was on
refactor/naming-standardbut landed after PR #101 was merged, so it never reachedmain. This PR restores it — a clean cherry-pick ofc3ebb25, re-tested againstmain.What
tfpfgen provider push -out DIR -repo URL [-branch NAME] [-base NAME] [-dry-run]publishes the generated provider tree to its own repository:.tfpfgen/manifest.json— push publishes generated output with stated provenance, not arbitrary treestfpfgen/generate-<digest>branch — same content always names the same branch — force-pushed, and answered with a pull request; an already-open PR is updated, not duplicated; non-GitHub remotes get the branch push and a noteTFPFGEN_GITHUB_TOKEN(orGITHUB_TOKEN), env-only, passed to git viaGIT_CONFIG_*environment so it never appears in the process table — the probe-credential doctrineVerification
docs/cli.mddocuments the verb; theTestUnit_CLI_DocsMatchTheBinarydrift test holds it there.main.🤖 Generated with Claude Code