feat(phpup): consolidate 5 CLI binaries as phpup subcommands (PR 6/6)#71
Merged
Conversation
Sixth and final PR of the local-CI unification rollout (see
docs/superpowers/specs/2026-04-23-local-ci-unification-design.md).
Merges cmd/planner, cmd/lockfile-update, cmd/gc-bundles,
cmd/hermetic-audit, and cmd/compat-diff into phpup subcommands so the
repo ships a single binary.
New subcommands (byte-identical stdout/stderr + flag surface to the
retired binaries for the same inputs):
phpup plan — was cmd/planner
phpup lockfile-update — was cmd/lockfile-update
phpup gc-bundles — was cmd/gc-bundles
phpup hermetic-audit — was cmd/hermetic-audit
phpup compat-diff — was cmd/compat-diff
Each cmd/<name>/ has been moved under internal/<name>/ (package renamed
from main; func main → func Main(args []string)). Flags are parsed
through a dedicated FlagSet so they don't collide with phpup's
setup-flow flag.Parse. Exit conventions preserved where load-bearing:
- phpup hermetic-audit: 0 = clean, 1 = findings, 2 = error (via
hermeticaudit.ErrFindings returned from Main)
- phpup compat-diff: 0 = match, 1 = deviation(s), 2 = malformed input
(via compatdiff.ExitCode returned from Main)
Updated call sites:
- .github/workflows/ci.yml: `bin/phpup lockfile-update` replaces
`go run ./cmd/lockfile-update` in the publish job. Uses an env var
for github.repository_owner so the `run:` block is free of
untrusted-input interpolation.
- .github/workflows/release-please.yml: drops the
`dist/planner-linux-amd64` build; releases now ship only
phpup-linux-amd64 (planner is accessible as `phpup plan`).
- Makefile: drops the second `go build` of cmd/planner in `build` /
`build-linux-*` targets; `gc-bundles-dry-run` now calls
`$(PHPUP_BIN) gc-bundles` instead of `go run ./cmd/gc-bundles`.
- .golangci.yml: retargeted subprocess-call allowlist paths from
`cmd/lockfile-update/`, `cmd/gc-bundles/` to their new
`internal/lockfileupdate/`, `internal/gcbundles/` homes.
- compat-diff tests build phpup via `./cmd/phpup` and prepend
`compat-diff` to argv to keep the integration-style exit-code
checks intact.
Docs refreshed:
- CLAUDE.md Architecture section now describes phpup as the single
binary hosting runtime + maintainer subcommands.
- CONTRIBUTING.md Project Structure section updated; orphan-bundle
cleanup instruction now uses `phpup gc-bundles`.
- README.md compat-matrix section refers to `phpup compat-diff`.
- Stale comments in internal/planner/helpers.go and
internal/oci/client.go that pointed at the deleted cmd/ paths.
Verification: `make check` green. Each new subcommand exercises
`--help` (help output identical to the retired binaries aside from the
"Usage of phpup <name>:" prefix) and runs through its package test
suite (20+ tests across the five new internal packages).
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
Sixth and final PR of the local-CI unification rollout (design). Merges
cmd/planner,cmd/lockfile-update,cmd/gc-bundles,cmd/hermetic-audit, andcmd/compat-diffintophpupsubcommands so the repo ships a single Go binary.New subcommands (byte-identical stdout/stderr + flag surface to the retired binaries for the same inputs):
phpup plancmd/plannerinternal/planner(cli.goadded)phpup lockfile-updatecmd/lockfile-updateinternal/lockfileupdatephpup gc-bundlescmd/gc-bundlesinternal/gcbundlesphpup hermetic-auditcmd/hermetic-auditinternal/hermeticauditphpup compat-diffcmd/compat-diffinternal/compatdiffEach
cmd/<name>/directory was moved underinternal/<name>/(package renamed frommain→<name>;func main()→func Main(args []string) error). Flags are parsed through a dedicatedflag.FlagSetso they don't collide with phpup's setup-flowflag.Parse.Exit conventions preserved:
phpup hermetic-audit:0= clean,1= findings,2= error (viahermeticaudit.ErrFindingsreturned fromMain).phpup compat-diff:0= match,1= deviation(s),2= malformed input (viacompatdiff.ExitCodereturned fromMain).Updated call sites:
.github/workflows/ci.yml: publish job usesbin/phpup lockfile-updateinstead ofgo run ./cmd/lockfile-update.github.repository_owneris pulled in viaenv:to keeprun:free of untrusted-input interpolation..github/workflows/release-please.yml: dropsdist/planner-linux-amd64build; releases ship onlyphpup-linux-amd64(planner isphpup plan).Makefile: dropscmd/plannerfrombuild/build-linux-*;gc-bundles-dry-runuses$(PHPUP_BIN) gc-bundles..golangci.yml: subprocess-call allowlist paths retargeted fromcmd/lockfile-update//cmd/gc-bundles/→ their newinternal/…/homes.Docs refreshed:
CLAUDE.md,CONTRIBUTING.md,README.md, and stale comments ininternal/planner/helpers.go/internal/oci/client.go.Test plan
make checkgreen locally (25 Go packages pass; coverage held across all internal packages)phpup plan --help,phpup lockfile-update --help,phpup gc-bundles --help,phpup hermetic-audit --help,phpup compat-diff --helpall work and mirror the previous binaries' flagsci.ymlgreen on this PRmainrunsci.yml::publish, which now invokesbin/phpup lockfile-update— verify the lockfile-update commit lands onmain