Skip to content

chore: scaffold tools/foas library module#1308

Merged
yelizhenden-mdb merged 1 commit into
mainfrom
CLOUDP-413371
Jun 15, 2026
Merged

chore: scaffold tools/foas library module#1308
yelizhenden-mdb merged 1 commit into
mainfrom
CLOUDP-413371

Conversation

@yelizhenden-mdb

Copy link
Copy Markdown
Collaborator

What this introduces

This is Branch 1 of 4 in splitting tools/cli into a reusable library module (tools/foas) + a binary module (tools/cli). This branch is scaffolding only — it creates the empty-but-valid tools/foas module and wires up the workspace and CI. No packages are moved yet.

Files added

File Purpose
tools/foas/go.mod New module github.com/mongodb/openapi/tools/foas (Go 1.26, matching tools/cli)
tools/foas/doc.go Root package foas doc stub — see note below
tools/foas/Makefile build / unit-test / lint / fmt / deps / devtools (library variant — no binary build, e2e, or version injection)
tools/foas/.golangci.yml Linter config, copied from tools/cli
tools/go.work Workspace listing ./cli + ./foas so cli resolves foas locally during dev/CI
.github/workflows/code-health-foas-lib.yml New CI: build + unit-test (ubuntu/macos matrix) + lint, triggered on tools/foas/**

Note on the doc.go stub

The 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 root doc.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 (not foas-lib / foas-tools)

The module lives at github.com/mongodb/openapi/tools/foas. The tools/ parent already supplies the "tooling/library" grouping, and Go convention avoids hyphens in the final import-path element. The -lib/-cli suffixes 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

  • Branch 2 — pilot: move apiversion into tools/foas, delete pkg/apiversion, update callers, add require + replace to cli/go.mod
  • Branch 3 — move breakingchanges, changelog, openapi, pointer; delete pkg/ entirely
  • Branch 4 — CI & release wiring (rename code-health-foascli.yml, add release-foas-lib.yml)

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.
@yelizhenden-mdb yelizhenden-mdb changed the title chore(foas): scaffold tools/foas library module chore: scaffold tools/foas library module Jun 15, 2026
@yelizhenden-mdb yelizhenden-mdb marked this pull request as ready for review June 15, 2026 09:10
@yelizhenden-mdb yelizhenden-mdb requested a review from a team as a code owner June 15, 2026 09:10
@yelizhenden-mdb yelizhenden-mdb merged commit 29b9ab2 into main Jun 15, 2026
8 of 9 checks passed
@yelizhenden-mdb yelizhenden-mdb deleted the CLOUDP-413371 branch June 15, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants