chore: move apiversion package into tools/foas#1309
Merged
Conversation
Branch 2 of the cli/foas split. Moves the apiversion package from tools/cli/internal/apiversion into the tools/foas library, updates all 20 cli callers to import from tools/foas/apiversion, deletes the dead tools/cli/pkg/apiversion wrapper, and adds the require + replace directives to tools/cli/go.mod.
cbc4e2d to
f010554
Compare
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.
What this introduces
Branch 2 of 4 in splitting
tools/cliinto a library (tools/foas) + binary (tools/cli). Builds on #1308 (now merged). This is the pilot move: it relocates one package —apiversion— to prove out the cross-module wiring before moving the rest.Changes
tools/cli/internal/apiversion/→tools/foas/apiversion/(4 files:version.go,stabilitylevel.go, + tests). Package name unchanged (package apiversion).…/tools/cli/internal/apiversionto…/tools/foas/apiversion.tools/cli/pkg/apiversion/— a thin re-export wrapper with zero importers (dead code; the whole point oftools/foasis to be the public surface).tools/cli/go.mod:go.workresolves foas locally during dev/CI; thereplacecoversGOWORK=off(GoReleaser).go mod tidysurfaced thatapiversion(and its tests) pull inkin-openapiandtestify, sotools/foasnow declares those directly — hence the newtools/foas/go.sumand regeneratedtools/go.work.sum.Verification
This PR only moves the
apiversionpackage (no logic change; package name and behavior unchanged; the expected-output specs committed in the repo are untouched). Thefoasclibinary is consumed by several release/generation workflows (release-cli,release-spec,release-changelog,generate-openapi,changelog-report,required-spec-validations,api-versions-reminder), so behavioral parity is verified end-to-end:CI (Linux) — all green on this PR:
e2e-tests(buildsfoascli, runs commands, compares output against the expected specs committed in the repo)Local (macOS) — second, independent signal:
apiversion-dependent e2e tests (split,changelog,versions) →ok …/test/e2e/cli 157.001s(exit 0)Because the e2e suite drives the real binary and compares its output against the expected specs committed in the repo (via an
oasdiffstructural comparison that must come back empty), passing e2e proves the CLI produces the same output as before — the consuming workflows are unaffected.Next branches
breakingchanges,changelog,openapi,pointer; deletetools/cli/pkg/entirelycode-health-foascli.yml→code-health-foas-cli.ymlwith atools/foas/**trigger; addrelease-foas-lib.yml)