Skip to content

chore: move breakingchanges, changelog, openapi, pointer to foas module#1310

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

chore: move breakingchanges, changelog, openapi, pointer to foas module#1310
yelizhenden-mdb merged 1 commit into
mainfrom
CLOUDP-413371-3

Conversation

@yelizhenden-mdb

@yelizhenden-mdb yelizhenden-mdb commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Step 3 of the tools/clitools/foas module split. Extracts the remaining reusable packages from tools/cli/internal/ into the standalone tools/foas library module.

Previous steps

Changes

  • Move breakingchanges, changelog (+ outputfilter), openapi (+ slice, sunset, filter, errors), and pointer from tools/cli/internal/ to tools/foas/.
  • Delete tools/cli/pkg/ entirely — the thin wrappers had no importers and are superseded by the public foas module.
  • Rewrite all importers (42 files) and go:generate mockgen directives from tools/cli/internal/{pkg}tools/foas/{pkg}.
  • Test fixtures: the moved packages dropped the internal/ path segment, so their relative test/data paths needed one fewer ../. Copied the minimal subset foas needs into foas/test/data/ (~1.6MB) rather than relocating the 225MB changelog corpus that cli's remaining tests still depend on.
  • go mod tidy on foas/go.mod to pull in the new dependencies (oasdiff, afero, mock, strcase, …).

Dependency direction stays one-way: cli → foas. foas references nothing in cli.

Verification

Build, unit-tests and e2e-tests of CLI passes

Next

Branch 4 — CI & release wiring (rename code-health-foascli.yml, add release-foas-lib.yml).

Extract the remaining reusable packages from tools/cli into the standalone
tools/foas library module (step 3 of the cli/foas split):

- Move breakingchanges, changelog, openapi, pointer (and their subpackages)
  from tools/cli/internal/ to tools/foas/
- Delete tools/cli/pkg/ entirely (thin wrappers superseded by foas)
- Rewrite all importers and go:generate directives to tools/foas/*
- Copy the minimal test fixtures the moved tests need into foas/test/data
- go mod tidy to pull in the foas dependencies

Dependency stays one-way (cli -> foas). Both modules build, vet, and pass
their unit suites.
Comment thread tools/foas/go.mod
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect

@andreaangiolillo andreaangiolillo Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[q] Have we tried releasing the foas module and importing it into the CLI? We want to make sure the CLI is always ready to release, in case we have to fix an OpenAPI issue. If we merge this PR without the foas module in the CLI, we'd be blocked from making an emergency release until the last PR of this migration is completed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not really. The CLI intentionally consumes the FOAS library via go.work / replace rather than a published tag, as they are co-developed in the same repo. Since the E2E tests are passing, I don't think there is any change to the CLI build output.

Additionally, there isn't a release workflow for the FOAS library yet, which will be handled as part of Step 4. After that, I plan to use the versioned library in the OpenAPI MCP implementation. Let me know if you have any suggestions or concerns regarding this approach

@yelizhenden-mdb yelizhenden-mdb Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we merge this PR without the foas module in the CLI, we'd be blocked from making an emergency release until the last PR of this migration is completed.

Now I see the edited comment. Do you suggest including a published and tagged foas library in the CLI instead of using Go workspaces?

@andreaangiolillo andreaangiolillo Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you suggest including a published and tagged foas library in the CLI instead of using Go workspaces?

Yes, but you raised a fair point: the e2e tests are passing, so I assume that, when we build the CLI binary via make build, the compiler fetches the foas module even if it isn't released (using go workspace). Feel free to ignore my comment. Thanks!

@andreaangiolillo andreaangiolillo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yelizhenden-mdb yelizhenden-mdb merged commit 7a09d07 into main Jun 16, 2026
15 checks passed
@yelizhenden-mdb yelizhenden-mdb deleted the CLOUDP-413371-3 branch June 16, 2026 14:47
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