chore: scaffold tools/foas library module#1308
Merged
Merged
Conversation
Introduces the tools/foas library module that tools/cli (and external repos) will consume. Branch 1 of the cli/foas split: scaffolding only, no packages moved yet.
maks-m-mongo-leaf
approved these changes
Jun 15, 2026
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
This is Branch 1 of 4 in splitting
tools/cliinto a reusable library module (tools/foas) + a binary module (tools/cli). This branch is scaffolding only — it creates the empty-but-validtools/foasmodule and wires up the workspace and CI. No packages are moved yet.Files added
tools/foas/go.modgithub.com/mongodb/openapi/tools/foas(Go 1.26, matchingtools/cli)tools/foas/doc.gopackage foasdoc stub — see note belowtools/foas/Makefilebuild/unit-test/lint/fmt/deps/devtools(library variant — no binary build, e2e, or version injection)tools/foas/.golangci.ymltools/clitools/go.work./cli+./foassocliresolvesfoaslocally during dev/CI.github/workflows/code-health-foas-lib.ymltools/foas/**Note on the
doc.gostubThe design called for an "empty but valid module," but a truly empty module makes
go test ./...exit non-zero (no packages to test), which would fail CI. A minimal rootdoc.go(package clause + doc comment, no logic) keeps the test step green. It'll sit alongside the real packages once they land in later branches.Why
foas(notfoas-lib/foas-tools)The module lives at
github.com/mongodb/openapi/tools/foas. Thetools/parent already supplies the "tooling/library" grouping, and Go convention avoids hyphens in the final import-path element. The-lib/-clisuffixes are reserved for the workflow names, where they disambiguate two CI pipelines.Verification
tools/foas:go build ./...✅ ·go test ./...✅ ·go vet ./...✅ ·golangci-lint run→ 0 issues ✅tools/cli:go build ./...✅ under the workspace (unchanged)go work sync✅ · workflow YAML valid ✅Next branches
apiversionintotools/foas, deletepkg/apiversion, update callers, addrequire+replacetocli/go.modbreakingchanges,changelog,openapi,pointer; deletepkg/entirelycode-health-foascli.yml, addrelease-foas-lib.yml)