feat(cli): fg contract publish — send an app's compiled contract to ForgeGraph #569
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gmackie/ForgeGraph!569
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/contract-cli"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Closes the Phase 2 loop. CI generates the contract from the app's Effect
HttpApi, this ships it, and the server records it and satisfies theapi_contractgate.Stacked on #568 → #567 → #564. Merge bottom-up.
Plan: https://7n04n7hhuesf.postplan.dev — Phase 2, task 2.4.
In CI it is one line
Everything defaults from the repo:
sdks/contract/contract.json, thencontract.json.forgegraph.yaml(honouringsub_app)--no-gatepublishes without attaching to a changeset, for a branch build that should record the contract without moving a gate.Failing locally beats failing at the server
The command checks the file exists and is JSON before sending. A missing or half-written generator output fails with a message naming the command to run, instead of coming back as a 400 from the API.
Verification
go test ./cmd/fg/commands/passes (full package),go vetclean,gofmtclean. New tests cover both path defaults (the generator's path wins over a stale root copy), the actionable error text, flag-over-config precedence,sub_appoutrankingapp, andshort()not padding or panicking on a short sha.It reuses the package's existing
chdirhelper rather than redeclaring it — the first draft did, and the package failed to build.Follow-up
Wiring this into create-gmacko-app's
sdk.ymlbelongs with that repo's PR #5; its CI is currently blocked on runner capacity, unrelated to this change.🤖 Generated with Claude Code
611ae1ad0a4f2fad00cd4f2fad00cd30acfb3d59