From f5d4686cdb57f40d67ef19a46a59d0b43b47ac02 Mon Sep 17 00:00:00 2001 From: Yeliz Henden Date: Wed, 27 May 2026 12:18:04 +0100 Subject: [PATCH 1/5] refactor: split into tools/foas (library) and tools/cli (binary) --- .github/workflows/code-health-foascli.yml | 30 +++- .github/workflows/release-cli.yml | 7 + .gitignore | 5 +- tools/README.md | 4 +- tools/cli/.goreleaser.yml | 2 +- tools/cli/Makefile | 13 +- tools/cli/README.md | 36 +---- tools/cli/RELEASING.md | 2 +- .../breakingchanges/breakingchanges.go | 2 +- .../breakingchanges/breakingchanges_test.go | 2 +- .../breakingchanges/exemptions/exemptions.go | 0 .../breakingchanges/exemptions/parse.go | 6 +- .../breakingchanges/exemptions/parse_test.go | 6 +- .../{internal/cli => }/changelog/changelog.go | 4 +- .../cli => }/changelog/changelog_test.go | 2 +- .../cli => }/changelog/convert/convert.go | 0 .../cli => }/changelog/convert/slack.go | 6 +- .../cli => }/changelog/convert/slack_test.go | 0 .../{internal/cli => }/changelog/create.go | 8 +- .../cli => }/changelog/create_test.go | 4 +- .../cli => }/changelog/metadata/create.go | 10 +- .../changelog/metadata/create_test.go | 4 +- .../cli => }/changelog/metadata/metadata.go | 0 .../changelog/metadata/metadata_test.go | 2 +- tools/cli/cmd/foascli.go | 2 +- tools/cli/{internal/cli => }/filter/filter.go | 10 +- .../{internal/cli => }/filter/filter_test.go | 10 +- tools/cli/{internal/cli => }/flag/flag.go | 0 tools/cli/go.mod | 12 +- tools/cli/go.sum | 5 - tools/cli/{internal/cli => }/merge/merge.go | 6 +- .../{internal/cli => }/merge/merge_test.go | 6 +- tools/cli/pkg/apiversion/apiversion.go | 23 --- tools/cli/pkg/openapi/openapi.go | 66 --------- tools/cli/precommit.sh | 2 +- .../cli => }/root/openapi/builder.go | 18 +-- tools/cli/scripts/update_docs.sh | 12 -- tools/cli/{internal/cli => }/slice/slice.go | 8 +- .../{internal/cli => }/slice/slice_test.go | 0 tools/cli/{internal/cli => }/split/split.go | 8 +- .../{internal/cli => }/split/split_test.go | 16 +- tools/cli/{internal/cli => }/sunset/diff.go | 8 +- .../{internal/cli => }/sunset/diff_test.go | 2 +- tools/cli/{internal/cli => }/sunset/list.go | 8 +- .../{internal/cli => }/sunset/list_test.go | 4 +- tools/cli/{internal/cli => }/sunset/sunset.go | 0 .../{internal/cli => }/sunset/sunset_test.go | 2 +- .../test/test.go => test/cmdvalidator.go} | 0 tools/cli/test/data/exemptions/exemptions.txt | 5 - tools/cli/test/e2e/cli/changelog_test.go | 2 +- tools/cli/test/e2e/cli/cli.go | 56 +++---- tools/cli/test/e2e/cli/parse_test.go | 4 +- tools/cli/test/e2e/cli/split_test.go | 10 +- tools/cli/test/e2e/cli/sunset_test.go | 12 +- tools/cli/{internal/cli => }/usage/usage.go | 0 .../{internal/cli => }/validator/command.go | 0 tools/cli/{internal => }/version/version.go | 0 .../{internal/cli => }/versions/versions.go | 8 +- .../cli => }/versions/versions_test.go | 16 +- tools/foas/.golangci.yml | 137 ++++++++++++++++++ tools/foas/Makefile | 72 +++++++++ tools/foas/README.md | 39 +++++ .../apiversion/stabilitylevel.go | 0 .../apiversion/stabilitylevel_test.go | 0 .../internal => foas}/apiversion/version.go | 0 .../apiversion/version_test.go | 0 .../breakingchanges/exemptions.go | 0 .../breakingchanges/exemptions_test.go | 2 +- .../internal => foas}/changelog/changelog.go | 4 +- .../changelog/changelog_test.go | 0 .../changelog/manual_entry.go | 2 +- .../changelog/manual_entry_test.go | 2 +- .../{cli/internal => foas}/changelog/merge.go | 2 +- .../internal => foas}/changelog/merge_test.go | 14 +- .../changelog/outputfilter/enum.go | 0 .../changelog/outputfilter/enum_test.go | 0 .../changelog/outputfilter/field.go | 0 .../changelog/outputfilter/field_test.go | 0 .../changelog/outputfilter/hide.go | 2 +- .../changelog/outputfilter/hide_test.go | 2 +- .../changelog/outputfilter/message.go | 0 .../changelog/outputfilter/message_test.go | 0 .../changelog/outputfilter/operationconfig.go | 0 .../outputfilter/operationconfig_test.go | 4 +- .../changelog/outputfilter/outputfilter.go | 0 .../changelog/outputfilter/squash.go | 0 .../changelog/outputfilter/squash_test.go | 0 .../internal => foas}/changelog/sunset.go | 2 +- .../changelog/sunset_test.go | 2 +- tools/foas/go.mod | 43 ++++++ tools/foas/go.sum | 88 +++++++++++ .../openapi/errors/merge_conflict_error.go | 0 tools/{cli/internal => foas}/openapi/file.go | 0 .../internal => foas}/openapi/file_test.go | 0 .../openapi/filter/README.md | 14 +- .../internal => foas}/openapi/filter/bump.go | 0 .../openapi/filter/bump_test.go | 2 +- .../openapi/filter/code_sample.go | 2 +- .../openapi/filter/code_sample_test.go | 2 +- .../openapi/filter/extension.go | 0 .../openapi/filter/extension_test.go | 2 +- .../openapi/filter/filter.go | 4 +- .../openapi/filter/filter_test.go | 2 +- .../openapi/filter/hidden_envs.go | 2 +- .../openapi/filter/hidden_envs_test.go | 4 +- .../internal => foas}/openapi/filter/info.go | 2 +- .../openapi/filter/info_test.go | 2 +- .../openapi/filter/mock_filter.go | 4 +- .../openapi/filter/operations.go | 0 .../openapi/filter/operations_test.go | 0 .../openapi/filter/parameters.go | 0 .../openapi/filter/parameters_test.go | 2 +- .../openapi/filter/response.go | 0 .../openapi/filter/response_test.go | 2 +- .../openapi/filter/schemas.go | 0 .../openapi/filter/schemas_test.go | 0 .../openapi/filter/sunset.go | 0 .../openapi/filter/sunset_test.go | 0 .../internal => foas}/openapi/filter/tags.go | 0 .../openapi/filter/tags_test.go | 0 .../template/go_sdk_code_sample.go.tmpl | 0 .../openapi/filter/versioning.go | 2 +- .../openapi/filter/versioning_extension.go | 2 +- .../filter/versioning_extension_test.go | 2 +- .../openapi/filter/versioning_test.go | 2 +- .../openapi/mock_oasdiff_result.go | 4 +- .../internal => foas}/openapi/mock_openapi.go | 4 +- .../{cli/internal => foas}/openapi/oasdiff.go | 2 +- .../openapi/oasdiff_result.go | 2 +- .../openapi/oasdiff_result_test.go | 0 .../internal => foas}/openapi/oasdiff_test.go | 4 +- .../{cli/internal => foas}/openapi/openapi.go | 2 +- .../internal => foas}/openapi/openapi3.go | 0 .../openapi/openapi3_test.go | 0 .../internal => foas}/openapi/openapi_test.go | 0 tools/{cli/internal => foas}/openapi/paths.go | 0 .../internal => foas}/openapi/paths_test.go | 0 .../internal => foas}/openapi/slice/slice.go | 2 +- .../openapi/slice/slice_test.go | 0 .../openapi/sunset/sunset.go | 0 .../openapi/sunset/sunset_test.go | 0 .../internal => foas}/openapi/versions.go | 4 +- .../openapi/versions_test.go | 0 .../{cli/internal => foas}/pointer/pointer.go | 0 tools/{cli => foas}/scripts/doc_filters.sh | 2 +- tools/foas/scripts/update_docs.sh | 12 ++ .../test/data/apiregistry_spec.json | 0 tools/{cli => foas}/test/data/authn_spec.json | 0 tools/{cli => foas}/test/data/base_spec.json | 0 ...se_spec_with_mismatching_sunset_dates.json | 0 ..._multiple_private_and_public_previews.json | 0 .../data/base_spec_with_private_preview.json | 0 .../data/base_spec_with_public_preview.json | 0 .../test/data/changelog/changelog.json | 0 .../changelog/manual_generated_test_spec.json | 0 .../base/changelog.json | 0 .../base/metadata.json | 0 .../base/openapi-2023-01-01.json | 0 .../base/openapi-2023-02-01.json | 0 .../base/openapi-2023-10-01.json | 0 .../base/openapi-2023-11-15.json | 0 .../base/openapi-2024-05-30.json | 0 .../new-api-preview-version/exemptions.yaml | 0 .../output/2023-01-01_2023-02-01.json | 0 .../output/2023-01-01_2023-10-01.json | 0 .../output/2023-01-01_2023-11-15.json | 0 .../output/2023-01-01_2024-05-30.json | 0 .../output/2023-01-01_2024-08-05.json | 0 .../output/2023-02-01_2023-10-01.json | 0 .../output/2023-02-01_2023-11-15.json | 0 .../output/2023-02-01_2024-05-30.json | 0 .../output/2023-02-01_2024-08-05.json | 0 .../output/2023-10-01_2023-11-15.json | 0 .../output/2023-10-01_2024-05-30.json | 0 .../output/2023-10-01_2024-08-05.json | 0 .../output/2023-11-15_2024-05-30.json | 0 .../output/2023-11-15_2024-08-05.json | 0 .../output/2024-05-30_2024-08-05.json | 0 .../output/changelog-all.json | 0 .../output/changelog.json | 0 .../revision/exemptions.yaml | 0 .../revision/metadata.json | 0 .../revision/openapi-2023-01-01.json | 0 .../revision/openapi-2023-02-01.json | 0 .../revision/openapi-2023-10-01.json | 0 .../revision/openapi-2023-11-15.json | 0 .../revision/openapi-2024-05-30.json | 0 .../revision/openapi-2024-08-05.json | 0 .../revision/openapi-preview.json | 0 .../new-api-version/base/changelog.json | 0 .../new-api-version/base/metadata.json | 0 .../base/openapi-2023-01-01.json | 0 .../base/openapi-2023-02-01.json | 0 .../base/openapi-2023-10-01.json | 0 .../base/openapi-2023-11-15.json | 0 .../base/openapi-2024-05-30.json | 0 .../changelog/new-api-version/exemptions.yaml | 0 .../output/2023-01-01_2023-02-01.json | 0 .../output/2023-01-01_2023-10-01.json | 0 .../output/2023-01-01_2023-11-15.json | 0 .../output/2023-01-01_2024-05-30.json | 0 .../output/2023-01-01_2024-08-05.json | 0 .../output/2023-02-01_2023-10-01.json | 0 .../output/2023-02-01_2023-11-15.json | 0 .../output/2023-02-01_2024-05-30.json | 0 .../output/2023-02-01_2024-08-05.json | 0 .../output/2023-10-01_2023-11-15.json | 0 .../output/2023-10-01_2024-05-30.json | 0 .../output/2023-10-01_2024-08-05.json | 0 .../output/2023-11-15_2024-05-30.json | 0 .../output/2023-11-15_2024-08-05.json | 0 .../output/2024-05-30_2024-08-05.json | 0 .../new-api-version/output/changelog-all.json | 0 .../new-api-version/output/changelog.json | 0 .../new-api-version/revision/exemptions.yaml | 0 .../new-api-version/revision/metadata.json | 0 .../revision/openapi-2023-01-01.json | 0 .../revision/openapi-2023-02-01.json | 0 .../revision/openapi-2023-10-01.json | 0 .../revision/openapi-2023-11-15.json | 0 .../revision/openapi-2024-05-30.json | 0 .../revision/openapi-2024-08-05.json | 0 .../base/changelog-all.json | 0 .../new-upcoming-version/base/changelog.json | 0 .../new-upcoming-version/base/metadata.json | 0 .../base/openapi-2023-01-01.json | 0 .../base/openapi-2023-02-01.json | 0 .../base/openapi-2023-10-01.json | 0 .../base/openapi-2023-11-15.json | 0 .../base/openapi-2024-05-30.json | 0 .../base/openapi-2024-08-05.json | 0 .../base/openapi-2024-10-23.json | 0 .../base/openapi-2024-11-13.json | 0 .../base/openapi-2025-01-01.json | 0 .../base/openapi-2025-02-19.json | 0 .../base/openapi-2025-03-12.json | 0 .../base/openapi-2025-04-23.json | 0 .../base/openapi-2025-09-22.upcoming.json | 0 .../base/openapi-2043-01-01.json | 0 .../base/openapi-preview.json | 0 .../new-upcoming-version/exemptions.yaml | 0 .../output/2023-01-01_2023-02-01.json | 0 .../output/2023-01-01_2023-10-01.json | 0 .../output/2023-01-01_2023-11-15.json | 0 .../output/2023-01-01_2024-05-30.json | 0 .../output/2023-01-01_2024-08-05.json | 0 .../output/2023-01-01_2024-10-23.json | 0 .../output/2023-01-01_2024-11-13.json | 0 .../output/2023-01-01_2025-02-19.json | 0 .../output/2023-01-01_2025-03-12.json | 0 .../2023-01-01_2025-09-22.upcoming.json | 0 .../output/2023-02-01_2023-10-01.json | 0 .../output/2023-02-01_2023-11-15.json | 0 .../output/2023-02-01_2024-05-30.json | 0 .../output/2023-02-01_2024-08-05.json | 0 .../output/2023-02-01_2024-10-23.json | 0 .../output/2023-02-01_2024-11-13.json | 0 .../output/2023-02-01_2025-02-19.json | 0 .../output/2023-02-01_2025-03-12.json | 0 .../2023-02-01_2025-09-22.upcoming.json | 0 .../output/2023-10-01_2023-11-15.json | 0 .../output/2023-10-01_2024-05-30.json | 0 .../output/2023-10-01_2024-08-05.json | 0 .../output/2023-10-01_2024-10-23.json | 0 .../output/2023-10-01_2024-11-13.json | 0 .../output/2023-10-01_2025-02-19.json | 0 .../output/2023-10-01_2025-03-12.json | 0 .../2023-10-01_2025-09-22.upcoming.json | 0 .../output/2023-11-15_2024-05-30.json | 0 .../output/2023-11-15_2024-08-05.json | 0 .../output/2023-11-15_2024-10-23.json | 0 .../output/2023-11-15_2024-11-13.json | 0 .../output/2023-11-15_2025-02-19.json | 0 .../output/2023-11-15_2025-03-12.json | 0 .../2023-11-15_2025-09-22.upcoming.json | 0 .../output/2024-05-30_2024-08-05.json | 0 .../output/2024-05-30_2024-10-23.json | 0 .../output/2024-05-30_2024-11-13.json | 0 .../output/2024-05-30_2025-02-19.json | 0 .../output/2024-05-30_2025-03-12.json | 0 .../2024-05-30_2025-09-22.upcoming.json | 0 .../output/2024-08-05_2024-10-23.json | 0 .../output/2024-08-05_2024-11-13.json | 0 .../output/2024-08-05_2025-02-19.json | 0 .../output/2024-08-05_2025-03-12.json | 0 .../2024-08-05_2025-09-22.upcoming.json | 0 .../output/2024-10-23_2024-11-13.json | 0 .../output/2024-10-23_2025-02-19.json | 0 .../output/2024-10-23_2025-03-12.json | 0 .../2024-10-23_2025-09-22.upcoming.json | 0 .../output/2024-11-13_2025-02-19.json | 0 .../output/2024-11-13_2025-03-12.json | 0 .../2024-11-13_2025-09-22.upcoming.json | 0 .../output/2025-02-19_2025-03-12.json | 0 .../2025-02-19_2025-09-22.upcoming.json | 0 .../2025-03-12_2025-09-22.upcoming.json | 0 .../output/changelog-all.json | 0 .../output/changelog.json | 0 .../revision/exemptions.yaml | 0 .../revision/metadata.json | 0 .../revision/openapi-2023-01-01.json | 0 .../revision/openapi-2023-02-01.json | 0 .../revision/openapi-2023-10-01.json | 0 .../revision/openapi-2023-11-15.json | 0 .../revision/openapi-2024-05-30.json | 0 .../revision/openapi-2024-08-05.json | 0 .../revision/openapi-2024-10-23.json | 0 .../revision/openapi-2024-11-13.json | 0 .../revision/openapi-2025-01-01.json | 0 .../revision/openapi-2025-02-19.json | 0 .../revision/openapi-2025-03-12.json | 0 .../revision/openapi-2025-04-23.json | 0 .../revision/openapi-2025-09-22.upcoming.json | 0 .../revision/openapi-2043-01-01.json | 0 .../revision/openapi-preview.json | 0 .../rename-api-version/base/changelog.json | 0 .../rename-api-version/base/metadata.json | 0 .../base/openapi-2023-01-01.json | 0 .../base/openapi-2023-02-01.json | 0 .../base/openapi-2023-10-01.json | 0 .../base/openapi-2023-11-15.json | 0 .../base/openapi-2024-05-30.json | 0 .../base/openapi-2043-01-01.json | 0 .../rename-api-version/exemptions.yaml | 0 .../output/2023-01-01_2023-02-01.json | 0 .../output/2023-01-01_2023-10-01.json | 0 .../output/2023-01-01_2023-11-15.json | 0 .../output/2023-01-01_2024-05-30.json | 0 .../output/2023-01-01_2024-08-05.json | 0 .../output/2023-02-01_2023-10-01.json | 0 .../output/2023-02-01_2023-11-15.json | 0 .../output/2023-02-01_2024-05-30.json | 0 .../output/2023-02-01_2024-08-05.json | 0 .../output/2023-10-01_2023-11-15.json | 0 .../output/2023-10-01_2024-05-30.json | 0 .../output/2023-10-01_2024-08-05.json | 0 .../output/2023-11-15_2024-05-30.json | 0 .../output/2023-11-15_2024-08-05.json | 0 .../output/2024-05-30_2024-08-05.json | 0 .../output/changelog-all.json | 0 .../rename-api-version/output/changelog.json | 0 .../revision/exemptions.yaml | 0 .../rename-api-version/revision/metadata.json | 0 .../revision/openapi-2023-01-01.json | 0 .../revision/openapi-2023-02-01.json | 0 .../revision/openapi-2023-10-01.json | 0 .../revision/openapi-2023-11-15.json | 0 .../revision/openapi-2024-05-30.json | 0 .../revision/openapi-2024-08-05.json | 0 .../same-api-version/base/changelog.json | 0 .../same-api-version/base/metadata.json | 0 .../base/openapi-2023-01-01.json | 0 .../base/openapi-2023-02-01.json | 0 .../base/openapi-2023-10-01.json | 0 .../base/openapi-2023-11-15.json | 0 .../base/openapi-2024-05-30.json | 0 .../base/openapi-2024-08-05.json | 0 .../same-api-version/exemptions.yaml | 0 .../output/2023-01-01_2023-02-01.json | 0 .../output/2023-01-01_2023-10-01.json | 0 .../output/2023-01-01_2023-11-15.json | 0 .../output/2023-01-01_2024-05-30.json | 0 .../output/2023-01-01_2024-08-05.json | 0 .../output/2023-02-01_2023-10-01.json | 0 .../output/2023-02-01_2023-11-15.json | 0 .../output/2023-02-01_2024-05-30.json | 0 .../output/2023-02-01_2024-08-05.json | 0 .../output/2023-10-01_2023-11-15.json | 0 .../output/2023-10-01_2024-05-30.json | 0 .../output/2023-10-01_2024-08-05.json | 0 .../output/2023-11-15_2024-05-30.json | 0 .../output/2023-11-15_2024-08-05.json | 0 .../output/2024-05-30_2024-08-05.json | 0 .../output/changelog-all.json | 0 .../same-api-version/output/changelog.json | 0 .../same-api-version/revision/metadata.json | 0 .../revision/openapi-2023-01-01.json | 0 .../revision/openapi-2023-02-01.json | 0 .../revision/openapi-2023-10-01.json | 0 .../revision/openapi-2023-11-15.json | 0 .../revision/openapi-2024-05-30.json | 0 .../revision/openapi-2024-08-05.json | 0 .../duplicated_path_apiregistry_spec.json | 0 .../test/data/duplicated_tag_authn_spec.json | 0 .../data/exemptions/invalid_exemptions.yaml | 0 .../exemptions/test_exemptions_expired.yaml | 0 .../exemptions/test_exemptions_schema.yaml | 0 .../test_exemptions_v2_duplication.yaml | 0 .../data/exemptions/valid_exemptions.yaml | 0 ..._identical_component_apiregistry_spec.json | 0 .../test/data/openapi-foas-dev.json | 0 .../test/data/openapi-foas-dev.yaml | 0 .../test/data/openapi_with_upcoming.json | 0 .../test/data/split/dev/README.md | 0 .../data/split/dev/openapi-api-registry.json | 0 .../test/data/split/dev/openapi-mms.json | 0 .../data/split/dev/openapi-v2-2023-01-01.json | 0 .../data/split/dev/openapi-v2-2023-01-01.yaml | 0 .../data/split/dev/openapi-v2-2023-02-01.json | 0 .../data/split/dev/openapi-v2-2023-02-01.yaml | 0 .../data/split/dev/openapi-v2-2023-10-01.json | 0 .../data/split/dev/openapi-v2-2023-10-01.yaml | 0 .../data/split/dev/openapi-v2-2023-11-15.json | 0 .../data/split/dev/openapi-v2-2023-11-15.yaml | 0 .../data/split/dev/openapi-v2-2024-05-30.json | 0 .../data/split/dev/openapi-v2-2024-05-30.yaml | 0 .../data/split/dev/openapi-v2-2024-08-05.json | 0 .../data/split/dev/openapi-v2-2024-08-05.yaml | 0 .../data/split/dev/openapi-v2-2025-01-01.json | 0 .../data/split/dev/openapi-v2-2025-01-01.yaml | 0 .../test/data/split/dev/openapi-v2.json | 0 .../test/data/split/dev/openapi-v2.yaml | 0 .../test/data/split/download_specs.sh | 0 .../test/data/split/prod/README.md | 0 .../data/split/prod/openapi-api-registry.json | 0 .../test/data/split/prod/openapi-mms.json | 0 .../split/prod/openapi-v2-2023-01-01.json | 0 .../split/prod/openapi-v2-2023-01-01.yaml | 0 .../split/prod/openapi-v2-2023-02-01.json | 0 .../split/prod/openapi-v2-2023-02-01.yaml | 0 .../split/prod/openapi-v2-2023-10-01.json | 0 .../split/prod/openapi-v2-2023-10-01.yaml | 0 .../split/prod/openapi-v2-2023-11-15.json | 0 .../split/prod/openapi-v2-2023-11-15.yaml | 0 .../split/prod/openapi-v2-2024-05-30.json | 0 .../split/prod/openapi-v2-2024-05-30.yaml | 0 .../split/prod/openapi-v2-2024-08-05.json | 0 .../split/prod/openapi-v2-2024-08-05.yaml | 0 .../test/data/split/prod/openapi-v2.json | 0 .../test/data/split/prod/openapi-v2.yaml | 0 430 files changed, 640 insertions(+), 365 deletions(-) rename tools/cli/{internal/cli => }/breakingchanges/breakingchanges.go (91%) rename tools/cli/{internal/cli => }/breakingchanges/breakingchanges_test.go (93%) rename tools/cli/{internal/cli => }/breakingchanges/exemptions/exemptions.go (100%) rename tools/cli/{internal/cli => }/breakingchanges/exemptions/parse.go (92%) rename tools/cli/{internal/cli => }/breakingchanges/exemptions/parse_test.go (84%) rename tools/cli/{internal/cli => }/changelog/changelog.go (86%) rename tools/cli/{internal/cli => }/changelog/changelog_test.go (93%) rename tools/cli/{internal/cli => }/changelog/convert/convert.go (100%) rename tools/cli/{internal/cli => }/changelog/convert/slack.go (97%) rename tools/cli/{internal/cli => }/changelog/convert/slack_test.go (100%) rename tools/cli/{internal/cli => }/changelog/create.go (95%) rename tools/cli/{internal/cli => }/changelog/create_test.go (87%) rename tools/cli/{internal/cli => }/changelog/metadata/create.go (91%) rename tools/cli/{internal/cli => }/changelog/metadata/create_test.go (93%) rename tools/cli/{internal/cli => }/changelog/metadata/metadata.go (100%) rename tools/cli/{internal/cli => }/changelog/metadata/metadata_test.go (93%) rename tools/cli/{internal/cli => }/filter/filter.go (93%) rename tools/cli/{internal/cli => }/filter/filter_test.go (95%) rename tools/cli/{internal/cli => }/flag/flag.go (100%) rename tools/cli/{internal/cli => }/merge/merge.go (94%) rename tools/cli/{internal/cli => }/merge/merge_test.go (95%) delete mode 100644 tools/cli/pkg/apiversion/apiversion.go delete mode 100644 tools/cli/pkg/openapi/openapi.go rename tools/cli/{internal/cli => }/root/openapi/builder.go (76%) delete mode 100755 tools/cli/scripts/update_docs.sh rename tools/cli/{internal/cli => }/slice/slice.go (94%) rename tools/cli/{internal/cli => }/slice/slice_test.go (100%) rename tools/cli/{internal/cli => }/split/split.go (93%) rename tools/cli/{internal/cli => }/split/split_test.go (91%) rename tools/cli/{internal/cli => }/sunset/diff.go (96%) rename tools/cli/{internal/cli => }/sunset/diff_test.go (99%) rename tools/cli/{internal/cli => }/sunset/list.go (94%) rename tools/cli/{internal/cli => }/sunset/list_test.go (98%) rename tools/cli/{internal/cli => }/sunset/sunset.go (100%) rename tools/cli/{internal/cli => }/sunset/sunset_test.go (93%) rename tools/cli/{internal/test/test.go => test/cmdvalidator.go} (100%) delete mode 100644 tools/cli/test/data/exemptions/exemptions.txt rename tools/cli/{internal/cli => }/usage/usage.go (100%) rename tools/cli/{internal/cli => }/validator/command.go (100%) rename tools/cli/{internal => }/version/version.go (100%) rename tools/cli/{internal/cli => }/versions/versions.go (95%) rename tools/cli/{internal/cli => }/versions/versions_test.go (91%) create mode 100644 tools/foas/.golangci.yml create mode 100644 tools/foas/Makefile create mode 100644 tools/foas/README.md rename tools/{cli/internal => foas}/apiversion/stabilitylevel.go (100%) rename tools/{cli/internal => foas}/apiversion/stabilitylevel_test.go (100%) rename tools/{cli/internal => foas}/apiversion/version.go (100%) rename tools/{cli/internal => foas}/apiversion/version_test.go (100%) rename tools/{cli/internal => foas}/breakingchanges/exemptions.go (100%) rename tools/{cli/internal => foas}/breakingchanges/exemptions_test.go (99%) rename tools/{cli/internal => foas}/changelog/changelog.go (99%) rename tools/{cli/internal => foas}/changelog/changelog_test.go (100%) rename tools/{cli/internal => foas}/changelog/manual_entry.go (97%) rename tools/{cli/internal => foas}/changelog/manual_entry_test.go (97%) rename tools/{cli/internal => foas}/changelog/merge.go (99%) rename tools/{cli/internal => foas}/changelog/merge_test.go (98%) rename tools/{cli/internal => foas}/changelog/outputfilter/enum.go (100%) rename tools/{cli/internal => foas}/changelog/outputfilter/enum_test.go (100%) rename tools/{cli/internal => foas}/changelog/outputfilter/field.go (100%) rename tools/{cli/internal => foas}/changelog/outputfilter/field_test.go (100%) rename tools/{cli/internal => foas}/changelog/outputfilter/hide.go (98%) rename tools/{cli/internal => foas}/changelog/outputfilter/hide_test.go (98%) rename tools/{cli/internal => foas}/changelog/outputfilter/message.go (100%) rename tools/{cli/internal => foas}/changelog/outputfilter/message_test.go (100%) rename tools/{cli/internal => foas}/changelog/outputfilter/operationconfig.go (100%) rename tools/{cli/internal => foas}/changelog/outputfilter/operationconfig_test.go (98%) rename tools/{cli/internal => foas}/changelog/outputfilter/outputfilter.go (100%) rename tools/{cli/internal => foas}/changelog/outputfilter/squash.go (100%) rename tools/{cli/internal => foas}/changelog/outputfilter/squash_test.go (100%) rename tools/{cli/internal => foas}/changelog/sunset.go (98%) rename tools/{cli/internal => foas}/changelog/sunset_test.go (98%) create mode 100644 tools/foas/go.mod create mode 100644 tools/foas/go.sum rename tools/{cli/internal => foas}/openapi/errors/merge_conflict_error.go (100%) rename tools/{cli/internal => foas}/openapi/file.go (100%) rename tools/{cli/internal => foas}/openapi/file_test.go (100%) rename tools/{cli/internal => foas}/openapi/filter/README.md (69%) rename tools/{cli/internal => foas}/openapi/filter/bump.go (100%) rename tools/{cli/internal => foas}/openapi/filter/bump_test.go (98%) rename tools/{cli/internal => foas}/openapi/filter/code_sample.go (99%) rename tools/{cli/internal => foas}/openapi/filter/code_sample_test.go (99%) rename tools/{cli/internal => foas}/openapi/filter/extension.go (100%) rename tools/{cli/internal => foas}/openapi/filter/extension_test.go (99%) rename tools/{cli/internal => foas}/openapi/filter/filter.go (98%) rename tools/{cli/internal => foas}/openapi/filter/filter_test.go (98%) rename tools/{cli/internal => foas}/openapi/filter/hidden_envs.go (99%) rename tools/{cli/internal => foas}/openapi/filter/hidden_envs_test.go (99%) rename tools/{cli/internal => foas}/openapi/filter/info.go (96%) rename tools/{cli/internal => foas}/openapi/filter/info_test.go (97%) rename tools/{cli/internal => foas}/openapi/filter/mock_filter.go (88%) rename tools/{cli/internal => foas}/openapi/filter/operations.go (100%) rename tools/{cli/internal => foas}/openapi/filter/operations_test.go (100%) rename tools/{cli/internal => foas}/openapi/filter/parameters.go (100%) rename tools/{cli/internal => foas}/openapi/filter/parameters_test.go (99%) rename tools/{cli/internal => foas}/openapi/filter/response.go (100%) rename tools/{cli/internal => foas}/openapi/filter/response_test.go (99%) rename tools/{cli/internal => foas}/openapi/filter/schemas.go (100%) rename tools/{cli/internal => foas}/openapi/filter/schemas_test.go (100%) rename tools/{cli/internal => foas}/openapi/filter/sunset.go (100%) rename tools/{cli/internal => foas}/openapi/filter/sunset_test.go (100%) rename tools/{cli/internal => foas}/openapi/filter/tags.go (100%) rename tools/{cli/internal => foas}/openapi/filter/tags_test.go (100%) rename tools/{cli/internal => foas}/openapi/filter/template/go_sdk_code_sample.go.tmpl (100%) rename tools/{cli/internal => foas}/openapi/filter/versioning.go (99%) rename tools/{cli/internal => foas}/openapi/filter/versioning_extension.go (98%) rename tools/{cli/internal => foas}/openapi/filter/versioning_extension_test.go (98%) rename tools/{cli/internal => foas}/openapi/filter/versioning_test.go (99%) rename tools/{cli/internal => foas}/openapi/mock_oasdiff_result.go (93%) rename tools/{cli/internal => foas}/openapi/mock_openapi.go (94%) rename tools/{cli/internal => foas}/openapi/oasdiff.go (99%) rename tools/{cli/internal => foas}/openapi/oasdiff_result.go (97%) rename tools/{cli/internal => foas}/openapi/oasdiff_result_test.go (100%) rename tools/{cli/internal => foas}/openapi/oasdiff_test.go (99%) rename tools/{cli/internal => foas}/openapi/openapi.go (98%) rename tools/{cli/internal => foas}/openapi/openapi3.go (100%) rename tools/{cli/internal => foas}/openapi/openapi3_test.go (100%) rename tools/{cli/internal => foas}/openapi/openapi_test.go (100%) rename tools/{cli/internal => foas}/openapi/paths.go (100%) rename tools/{cli/internal => foas}/openapi/paths_test.go (100%) rename tools/{cli/internal => foas}/openapi/slice/slice.go (97%) rename tools/{cli/internal => foas}/openapi/slice/slice_test.go (100%) rename tools/{cli/internal => foas}/openapi/sunset/sunset.go (100%) rename tools/{cli/internal => foas}/openapi/sunset/sunset_test.go (100%) rename tools/{cli/internal => foas}/openapi/versions.go (96%) rename tools/{cli/internal => foas}/openapi/versions_test.go (100%) rename tools/{cli/internal => foas}/pointer/pointer.go (100%) rename tools/{cli => foas}/scripts/doc_filters.sh (85%) create mode 100755 tools/foas/scripts/update_docs.sh rename tools/{cli => foas}/test/data/apiregistry_spec.json (100%) rename tools/{cli => foas}/test/data/authn_spec.json (100%) rename tools/{cli => foas}/test/data/base_spec.json (100%) rename tools/{cli => foas}/test/data/base_spec_with_mismatching_sunset_dates.json (100%) rename tools/{cli => foas}/test/data/base_spec_with_multiple_private_and_public_previews.json (100%) rename tools/{cli => foas}/test/data/base_spec_with_private_preview.json (100%) rename tools/{cli => foas}/test/data/base_spec_with_public_preview.json (100%) rename tools/{cli => foas}/test/data/changelog/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/manual_generated_test_spec.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/base/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/base/metadata.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/base/openapi-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/base/openapi-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/base/openapi-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/base/openapi-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/base/openapi-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/exemptions.yaml (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-10-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/2024-05-30_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/changelog-all.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/output/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/revision/exemptions.yaml (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/revision/metadata.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/revision/openapi-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/revision/openapi-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/revision/openapi-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/revision/openapi-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/revision/openapi-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/revision/openapi-2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-preview-version/revision/openapi-preview.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/base/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/base/metadata.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/base/openapi-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/base/openapi-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/base/openapi-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/base/openapi-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/base/openapi-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/exemptions.yaml (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-01-01_2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-01-01_2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-01-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-01-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-01-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-02-01_2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-02-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-02-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-02-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-10-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-10-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-10-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-11-15_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2023-11-15_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/2024-05-30_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/changelog-all.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/output/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/revision/exemptions.yaml (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/revision/metadata.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/revision/openapi-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/revision/openapi-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/revision/openapi-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/revision/openapi-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/revision/openapi-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-api-version/revision/openapi-2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/changelog-all.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/metadata.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2024-10-23.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2024-11-13.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2025-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2025-02-19.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2025-04-23.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-2043-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/base/openapi-preview.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/exemptions.yaml (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-10-23.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-11-13.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-02-19.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-10-23.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-11-13.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-02-19.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-10-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-10-23.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-11-13.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-02-19.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-10-23.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-11-13.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-02-19.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-10-23.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-11-13.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-02-19.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-10-23.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-11-13.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-02-19.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-10-23_2024-11-13.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-02-19.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-02-19.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/2025-03-12_2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/changelog-all.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/output/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/exemptions.yaml (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/metadata.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2024-10-23.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2024-11-13.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2025-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2025-02-19.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2025-03-12.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2025-04-23.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2025-09-22.upcoming.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-2043-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/new-upcoming-version/revision/openapi-preview.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/base/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/base/metadata.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/base/openapi-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/base/openapi-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/base/openapi-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/base/openapi-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/base/openapi-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/base/openapi-2043-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/exemptions.yaml (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-01-01_2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-01-01_2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-01-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-01-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-01-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-02-01_2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-02-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-02-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-02-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-10-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-10-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-10-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-11-15_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2023-11-15_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/2024-05-30_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/changelog-all.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/output/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/revision/exemptions.yaml (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/revision/metadata.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/revision/openapi-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/revision/openapi-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/revision/openapi-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/revision/openapi-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/revision/openapi-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/rename-api-version/revision/openapi-2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/base/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/base/metadata.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/base/openapi-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/base/openapi-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/base/openapi-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/base/openapi-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/base/openapi-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/base/openapi-2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/exemptions.yaml (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-01-01_2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-01-01_2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-01-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-01-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-01-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-02-01_2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-02-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-02-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-02-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-10-01_2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-10-01_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-10-01_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-11-15_2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2023-11-15_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/2024-05-30_2024-08-05.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/changelog-all.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/output/changelog.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/revision/metadata.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/revision/openapi-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/revision/openapi-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/revision/openapi-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/revision/openapi-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/revision/openapi-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/changelog/same-api-version/revision/openapi-2024-08-05.json (100%) rename tools/{cli => foas}/test/data/duplicated_path_apiregistry_spec.json (100%) rename tools/{cli => foas}/test/data/duplicated_tag_authn_spec.json (100%) rename tools/{cli => foas}/test/data/exemptions/invalid_exemptions.yaml (100%) rename tools/{cli => foas}/test/data/exemptions/test_exemptions_expired.yaml (100%) rename tools/{cli => foas}/test/data/exemptions/test_exemptions_schema.yaml (100%) rename tools/{cli => foas}/test/data/exemptions/test_exemptions_v2_duplication.yaml (100%) rename tools/{cli => foas}/test/data/exemptions/valid_exemptions.yaml (100%) rename tools/{cli => foas}/test/data/not_identical_component_apiregistry_spec.json (100%) rename tools/{cli => foas}/test/data/openapi-foas-dev.json (100%) rename tools/{cli => foas}/test/data/openapi-foas-dev.yaml (100%) rename tools/{cli => foas}/test/data/openapi_with_upcoming.json (100%) rename tools/{cli => foas}/test/data/split/dev/README.md (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-api-registry.json (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-mms.json (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2023-01-01.yaml (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2023-02-01.yaml (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2023-10-01.yaml (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2023-11-15.yaml (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2024-05-30.yaml (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2024-08-05.json (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2024-08-05.yaml (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2025-01-01.json (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2-2025-01-01.yaml (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2.json (100%) rename tools/{cli => foas}/test/data/split/dev/openapi-v2.yaml (100%) rename tools/{cli => foas}/test/data/split/download_specs.sh (100%) rename tools/{cli => foas}/test/data/split/prod/README.md (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-api-registry.json (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-mms.json (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2023-01-01.json (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2023-01-01.yaml (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2023-02-01.json (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2023-02-01.yaml (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2023-10-01.json (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2023-10-01.yaml (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2023-11-15.json (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2023-11-15.yaml (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2024-05-30.json (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2024-05-30.yaml (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2024-08-05.json (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2-2024-08-05.yaml (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2.json (100%) rename tools/{cli => foas}/test/data/split/prod/openapi-v2.yaml (100%) diff --git a/.github/workflows/code-health-foascli.yml b/.github/workflows/code-health-foascli.yml index 82ef41c77b..83eb5fd88e 100644 --- a/.github/workflows/code-health-foascli.yml +++ b/.github/workflows/code-health-foascli.yml @@ -3,13 +3,15 @@ on: push: branches: - main - paths: + paths: + - 'tools/foas/**' - 'tools/cli/**' - '.github/workflows/code-health-foascli.yml' pull_request: branches: - main paths: + - 'tools/foas/**' - 'tools/cli/**' - '.github/workflows/code-health-foascli.yml' workflow_dispatch: {} @@ -21,15 +23,19 @@ permissions: jobs: build: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + module: [foas, cli] steps: - name: Checkout CLI uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Install Go uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c with: - go-version-file: 'tools/cli/go.mod' - - name: Build CLI - working-directory: tools/cli + go-version-file: 'tools/${{ matrix.module }}/go.mod' + - name: Build + working-directory: tools/${{ matrix.module }} run: make build unit-tests: needs: build @@ -41,6 +47,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] + module: [foas, cli] runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -48,12 +55,16 @@ jobs: - name: Install Go uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c with: - go-version-file: 'tools/cli/go.mod' + go-version-file: 'tools/${{ matrix.module }}/go.mod' - name: Run unit tests - working-directory: tools/cli + working-directory: tools/${{ matrix.module }} run: make unit-test lint: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + module: [foas, cli] steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd @@ -64,13 +75,16 @@ jobs: - name: Install Go uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c with: - go-version-file: 'tools/cli/go.mod' + go-version-file: 'tools/${{ matrix.module }}/go.mod' cache: false # see https://github.com/golangci/golangci-lint-action/issues/807 - name: golangci-lint uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee with: version: v2.10.1 - working-directory: tools/cli + working-directory: tools/${{ matrix.module }} + actionlint: + runs-on: ubuntu-latest + steps: - name: Checkout GitHub actions uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with: diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index e67b0cdeb8..4a528d19e1 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -37,6 +37,13 @@ jobs: commit_sha: ${{ steps.get-sha.outputs.sha }} gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} gpg_passphrase: ${{ secrets.PASSPHRASE }} + - name: Create Go submodule tag for tools/foas + uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 + with: + tag: tools/foas/${{ inputs.version_number }} + commit_sha: ${{ steps.get-sha.outputs.sha }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.PASSPHRASE }} - name: Create Go submodule tag for tools/cli uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 with: diff --git a/.gitignore b/.gitignore index f765072ace..61fe8f23c5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,8 +6,9 @@ *.dylib /tools/*/bin/* /tools/*/tmp/* -/tools/cli/test/e2e/cli/output/** -!/tools/cli/test/e2e/cli/output/.gitkeep +/tools/cli/test/e2e/cli/output/** +!/tools/cli/test/e2e/cli/output/.gitkeep +/tools/foas/test/data/exemptions/exemptions.txt /tools/*/dist/* /tools/*/output/* # We don't want to commit env variables diff --git a/tools/README.md b/tools/README.md index 1f5e6971f8..4749928d40 100644 --- a/tools/README.md +++ b/tools/README.md @@ -10,6 +10,6 @@ Includes resources and scripts to generate [MongoDB Atlas Postman Collections](h MongoDB [Spectral](https://github.com/stoplightio/spectral) OpenAPI specification validation rules for IPA-compliance. -## CLI +## FOAS -OpenAPI CLI. Internal MongoDB CLI used for OpenAPI transformations. +The OpenAPI tooling library (`tools/foas`) and its CLI binary (`tools/cli`). diff --git a/tools/cli/.goreleaser.yml b/tools/cli/.goreleaser.yml index b317c44ff3..03cb6cd5b9 100644 --- a/tools/cli/.goreleaser.yml +++ b/tools/cli/.goreleaser.yml @@ -13,7 +13,7 @@ builds: binary: bin/foascli main: ./cmd/foascli.go ldflags: - - -s -w -X github.com/mongodb/openapi/tools/cli/internal/version.Version={{.Version}} -X github.com/mongodb/openapi/tools/cli/internal/version.GitCommit={{.FullCommit}} + - -s -w -X github.com/mongodb/openapi/tools/cli/version.Version={{.Version}} -X github.com/mongodb/openapi/tools/cli/version.GitCommit={{.FullCommit}} id: linux goos: [linux] goarch: [amd64,arm64] diff --git a/tools/cli/Makefile b/tools/cli/Makefile index 2b6f6f9dd3..e8f1bc1b14 100644 --- a/tools/cli/Makefile +++ b/tools/cli/Makefile @@ -13,8 +13,8 @@ E2E_TIMEOUT?=60m E2E_PARALLEL?=1 E2E_EXTRA_ARGS?= -LINKER_GH_SHA_FLAG=-s -w -X github.com/mongodb/openapi/tools/cli/internal/version.GitCommit=${GIT_SHA} -LINKER_FLAGS=${LINKER_GH_SHA_FLAG} -X github.com/mongodb/openapi/tools/cli/internal/version.Version=${VERSION} +LINKER_GH_SHA_FLAG=-s -w -X github.com/mongodb/openapi/tools/cli/version.GitCommit=${GIT_SHA} +LINKER_FLAGS=${LINKER_GH_SHA_FLAG} -X github.com/mongodb/openapi/tools/cli/version.Version=${VERSION} DEBUG_FLAGS=all=-N -l TEST_CMD?=go test @@ -74,20 +74,15 @@ e2e-test: build ## Run E2E tests rm -rf test/e2e/cli/output $(TEST_CMD) -v -p 1 -parallel $(E2E_PARALLEL) -timeout $(E2E_TIMEOUT) ./test/e2e... $(E2E_EXTRA_ARGS) -.PHONY: gen-docs -gen-docs: ## Generate docs - @echo "==> Updating docs" - ./scripts/update_docs.sh - .PHONY: unit-test unit-test: ## Run unit-tests @echo "==> Running unit tests..." - $(TEST_CMD) -race -cover ./internal... + $(TEST_CMD) -race -cover ./... .PHONY: gen-mocks gen-mocks: ## Generate mocks @echo "==> Generating mocks" - go generate ./internal... + go generate ./... .PHONY: pre-commit pre-commit: fmt lint unit-test ## Run pre-commit checks diff --git a/tools/cli/README.md b/tools/cli/README.md index e8925feed3..3363a3c03c 100644 --- a/tools/cli/README.md +++ b/tools/cli/README.md @@ -1,39 +1,17 @@ -# FOASCLI -FOASCLI is a Go-based CLI tool that provides commands for generating the Federated OpenAPI specification and the API changelog. +# FOAS CLI -### Build From Source +Binary entrypoint for the FOAS OpenAPI tooling. Depends on the [`tools/foas`](../foas) library module. -#### Fetch Source +See [RELEASING.md](./RELEASING.md) for release instructions. -```bash -git clone https://github.com/mongodb/openapi.git -cd openapi/tools/cli -``` - -#### Build -To build `foascli`, run: +## Build ```bash -make build +make build # produces ./bin/foascli ``` -The resulting `foascli` binary is placed in `./bin`. +## Test -## Usage -To get a list of available commands, run `foascli help`. - -## Setup Environment -To set up the development environment, run: ```bash -make setup +make test ``` - -### Run tests -To run unit and e2e tests, run: -```bash -make lint && unit-test && e2e-test -``` - -## Contributing - -See our [CONTRIBUTING.md](../../CONTRIBUTING.md) guide. diff --git a/tools/cli/RELEASING.md b/tools/cli/RELEASING.md index a7d659dd94..66841820dc 100644 --- a/tools/cli/RELEASING.md +++ b/tools/cli/RELEASING.md @@ -10,7 +10,7 @@ - Using [GitHub CLI](https://cli.github.com/), run the command ```bash -cd tools/cli +cd tools/foas # Make sure to update version_number with the release version gh workflow run release-cli.yml -f version_number=vX.Y.Z -f skip_tests=false -f use_existing_tag=false ``` diff --git a/tools/cli/internal/cli/breakingchanges/breakingchanges.go b/tools/cli/breakingchanges/breakingchanges.go similarity index 91% rename from tools/cli/internal/cli/breakingchanges/breakingchanges.go rename to tools/cli/breakingchanges/breakingchanges.go index d111c4a0ba..11a2e0bad6 100644 --- a/tools/cli/internal/cli/breakingchanges/breakingchanges.go +++ b/tools/cli/breakingchanges/breakingchanges.go @@ -15,7 +15,7 @@ package breakingchanges import ( - "github.com/mongodb/openapi/tools/cli/internal/cli/breakingchanges/exemptions" + "github.com/mongodb/openapi/tools/cli/breakingchanges/exemptions" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/breakingchanges/breakingchanges_test.go b/tools/cli/breakingchanges/breakingchanges_test.go similarity index 93% rename from tools/cli/internal/cli/breakingchanges/breakingchanges_test.go rename to tools/cli/breakingchanges/breakingchanges_test.go index ba77c7f61f..575d04e11f 100644 --- a/tools/cli/internal/cli/breakingchanges/breakingchanges_test.go +++ b/tools/cli/breakingchanges/breakingchanges_test.go @@ -17,7 +17,7 @@ package breakingchanges import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/test" ) func TestBuilder(t *testing.T) { diff --git a/tools/cli/internal/cli/breakingchanges/exemptions/exemptions.go b/tools/cli/breakingchanges/exemptions/exemptions.go similarity index 100% rename from tools/cli/internal/cli/breakingchanges/exemptions/exemptions.go rename to tools/cli/breakingchanges/exemptions/exemptions.go diff --git a/tools/cli/internal/cli/breakingchanges/exemptions/parse.go b/tools/cli/breakingchanges/exemptions/parse.go similarity index 92% rename from tools/cli/internal/cli/breakingchanges/exemptions/parse.go rename to tools/cli/breakingchanges/exemptions/parse.go index 19b7d98ec7..2cb94fa8a9 100644 --- a/tools/cli/internal/cli/breakingchanges/exemptions/parse.go +++ b/tools/cli/breakingchanges/exemptions/parse.go @@ -17,9 +17,9 @@ package exemptions import ( "errors" - "github.com/mongodb/openapi/tools/cli/internal/breakingchanges" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" + "github.com/mongodb/openapi/tools/foas/breakingchanges" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/breakingchanges/exemptions/parse_test.go b/tools/cli/breakingchanges/exemptions/parse_test.go similarity index 84% rename from tools/cli/internal/cli/breakingchanges/exemptions/parse_test.go rename to tools/cli/breakingchanges/exemptions/parse_test.go index f307df5411..f841cc9960 100644 --- a/tools/cli/internal/cli/breakingchanges/exemptions/parse_test.go +++ b/tools/cli/breakingchanges/exemptions/parse_test.go @@ -10,8 +10,8 @@ import ( func TestSuccessfulParse_Run(t *testing.T) { fs := afero.NewOsFs() opts := &Opts{ - exemptionsPaths: "../../../../test/data/exemptions/valid_exemptions.yaml", - outputPath: "../../../../test/data/exemptions/exemptions.txt", + exemptionsPaths: "../../../foas/test/data/exemptions/valid_exemptions.yaml", + outputPath: "../../../foas/test/data/exemptions/exemptions.txt", fs: fs, } @@ -36,7 +36,7 @@ func TestOpts_PreRunE(t *testing.T) { }, { wantErr: require.NoError, - exemptionsPath: "../../../../test/data/exemptions/valid_exemptions.yaml", + exemptionsPath: "../../../foas/test/data/exemptions/valid_exemptions.yaml", name: "Successful", }, { diff --git a/tools/cli/internal/cli/changelog/changelog.go b/tools/cli/changelog/changelog.go similarity index 86% rename from tools/cli/internal/cli/changelog/changelog.go rename to tools/cli/changelog/changelog.go index 02aca87809..c9c4c20c73 100644 --- a/tools/cli/internal/cli/changelog/changelog.go +++ b/tools/cli/changelog/changelog.go @@ -15,8 +15,8 @@ package changelog import ( - "github.com/mongodb/openapi/tools/cli/internal/cli/changelog/convert" - "github.com/mongodb/openapi/tools/cli/internal/cli/changelog/metadata" + "github.com/mongodb/openapi/tools/cli/changelog/convert" + "github.com/mongodb/openapi/tools/cli/changelog/metadata" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/changelog/changelog_test.go b/tools/cli/changelog/changelog_test.go similarity index 93% rename from tools/cli/internal/cli/changelog/changelog_test.go rename to tools/cli/changelog/changelog_test.go index ef23dec0cd..f44d148b19 100644 --- a/tools/cli/internal/cli/changelog/changelog_test.go +++ b/tools/cli/changelog/changelog_test.go @@ -17,7 +17,7 @@ package changelog import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/test" ) func TestBuilder(t *testing.T) { diff --git a/tools/cli/internal/cli/changelog/convert/convert.go b/tools/cli/changelog/convert/convert.go similarity index 100% rename from tools/cli/internal/cli/changelog/convert/convert.go rename to tools/cli/changelog/convert/convert.go diff --git a/tools/cli/internal/cli/changelog/convert/slack.go b/tools/cli/changelog/convert/slack.go similarity index 97% rename from tools/cli/internal/cli/changelog/convert/slack.go rename to tools/cli/changelog/convert/slack.go index 5e40255b3b..a76775c4e5 100644 --- a/tools/cli/internal/cli/changelog/convert/slack.go +++ b/tools/cli/changelog/convert/slack.go @@ -20,9 +20,9 @@ import ( "sort" "strconv" - "github.com/mongodb/openapi/tools/cli/internal/changelog" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" + "github.com/mongodb/openapi/tools/foas/changelog" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/changelog/convert/slack_test.go b/tools/cli/changelog/convert/slack_test.go similarity index 100% rename from tools/cli/internal/cli/changelog/convert/slack_test.go rename to tools/cli/changelog/convert/slack_test.go diff --git a/tools/cli/internal/cli/changelog/create.go b/tools/cli/changelog/create.go similarity index 95% rename from tools/cli/internal/cli/changelog/create.go rename to tools/cli/changelog/create.go index 495cfffbff..911f5c9b82 100644 --- a/tools/cli/internal/cli/changelog/create.go +++ b/tools/cli/changelog/create.go @@ -19,10 +19,10 @@ import ( "log" "time" - "github.com/mongodb/openapi/tools/cli/internal/changelog" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/changelog" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/changelog/create_test.go b/tools/cli/changelog/create_test.go similarity index 87% rename from tools/cli/internal/cli/changelog/create_test.go rename to tools/cli/changelog/create_test.go index c22640a32a..839eab24c6 100644 --- a/tools/cli/internal/cli/changelog/create_test.go +++ b/tools/cli/changelog/create_test.go @@ -17,8 +17,8 @@ package changelog import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/test" ) func TestCreateBuilder(t *testing.T) { diff --git a/tools/cli/internal/cli/changelog/metadata/create.go b/tools/cli/changelog/metadata/create.go similarity index 91% rename from tools/cli/internal/cli/changelog/metadata/create.go rename to tools/cli/changelog/metadata/create.go index 7d9d292899..398fd5bbfe 100644 --- a/tools/cli/internal/cli/changelog/metadata/create.go +++ b/tools/cli/changelog/metadata/create.go @@ -19,11 +19,11 @@ import ( "fmt" "time" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/changelog" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/changelog" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/changelog/metadata/create_test.go b/tools/cli/changelog/metadata/create_test.go similarity index 93% rename from tools/cli/internal/cli/changelog/metadata/create_test.go rename to tools/cli/changelog/metadata/create_test.go index 5d7338361f..726db5bcbb 100644 --- a/tools/cli/internal/cli/changelog/metadata/create_test.go +++ b/tools/cli/changelog/metadata/create_test.go @@ -17,8 +17,8 @@ package metadata import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/test" "github.com/spf13/afero" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/cli/changelog/metadata/metadata.go b/tools/cli/changelog/metadata/metadata.go similarity index 100% rename from tools/cli/internal/cli/changelog/metadata/metadata.go rename to tools/cli/changelog/metadata/metadata.go diff --git a/tools/cli/internal/cli/changelog/metadata/metadata_test.go b/tools/cli/changelog/metadata/metadata_test.go similarity index 93% rename from tools/cli/internal/cli/changelog/metadata/metadata_test.go rename to tools/cli/changelog/metadata/metadata_test.go index f034759eb3..fa237ce4be 100644 --- a/tools/cli/internal/cli/changelog/metadata/metadata_test.go +++ b/tools/cli/changelog/metadata/metadata_test.go @@ -17,7 +17,7 @@ package metadata import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/test" ) func TestBuilder(t *testing.T) { diff --git a/tools/cli/cmd/foascli.go b/tools/cli/cmd/foascli.go index f1ef39c0d7..c5c65b193e 100644 --- a/tools/cli/cmd/foascli.go +++ b/tools/cli/cmd/foascli.go @@ -18,7 +18,7 @@ import ( "context" "os" - "github.com/mongodb/openapi/tools/cli/internal/cli/root/openapi" + "github.com/mongodb/openapi/tools/cli/root/openapi" ) // Execute adds all child commands to the root command and sets flags appropriately. diff --git a/tools/cli/internal/cli/filter/filter.go b/tools/cli/filter/filter.go similarity index 93% rename from tools/cli/internal/cli/filter/filter.go rename to tools/cli/filter/filter.go index 1993a486f3..12a32a5a64 100644 --- a/tools/cli/internal/cli/filter/filter.go +++ b/tools/cli/filter/filter.go @@ -19,11 +19,11 @@ import ( "log" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" - "github.com/mongodb/openapi/tools/cli/internal/openapi/filter" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" + "github.com/mongodb/openapi/tools/foas/openapi/filter" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/filter/filter_test.go b/tools/cli/filter/filter_test.go similarity index 95% rename from tools/cli/internal/cli/filter/filter_test.go rename to tools/cli/filter/filter_test.go index 0f4235f374..46ff21ccd9 100644 --- a/tools/cli/internal/cli/filter/filter_test.go +++ b/tools/cli/filter/filter_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/oasdiff/oasdiff/load" "github.com/spf13/afero" "github.com/stretchr/testify/require" @@ -30,7 +30,7 @@ func TestSuccessfulFilter_Run(t *testing.T) { t.Parallel() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "filtered-oas.yaml", fs: fs, env: "dev", @@ -57,7 +57,7 @@ func TestSuccessfulFilterWithVersion_Run(t *testing.T) { t.Parallel() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "filtered-oas.yaml", fs: fs, env: "dev", @@ -81,7 +81,7 @@ func TestSuccessfulFilterWithMultipleVersions_Run(t *testing.T) { t.Parallel() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "filtered-oas.yaml", fs: fs, env: "dev", @@ -155,7 +155,7 @@ func TestOpts_PreRunE(t *testing.T) { }, { wantErr: require.NoError, - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", name: "Successful", }, } diff --git a/tools/cli/internal/cli/flag/flag.go b/tools/cli/flag/flag.go similarity index 100% rename from tools/cli/internal/cli/flag/flag.go rename to tools/cli/flag/flag.go diff --git a/tools/cli/go.mod b/tools/cli/go.mod index 3663b459f5..de3f026d39 100644 --- a/tools/cli/go.mod +++ b/tools/cli/go.mod @@ -2,17 +2,14 @@ module github.com/mongodb/openapi/tools/cli go 1.26 -toolchain go1.26.0 - require ( github.com/getkin/kin-openapi v0.139.0 - github.com/iancoleman/strcase v0.3.0 + github.com/mongodb/openapi/tools/foas v0.0.0 github.com/oasdiff/oasdiff v1.16.0 github.com/spf13/afero v1.15.0 github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 go.uber.org/mock v0.6.0 - golang.org/x/text v0.37.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -22,9 +19,10 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/go-openapi/jsonpointer v0.22.5 // indirect github.com/go-openapi/swag/jsonname v0.25.5 // indirect + github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/mailru/easyjson v0.9.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/oasdiff/yaml v0.1.0 // indirect @@ -42,5 +40,7 @@ require ( github.com/yargevad/filepathx v1.0.0 // indirect github.com/yuin/goldmark v1.8.2 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + golang.org/x/text v0.37.0 // indirect ) + +replace github.com/mongodb/openapi/tools/foas => ../foas diff --git a/tools/cli/go.sum b/tools/cli/go.sum index f6453cfcc6..5842f3dfb6 100644 --- a/tools/cli/go.sum +++ b/tools/cli/go.sum @@ -26,11 +26,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M= @@ -45,10 +42,8 @@ github.com/oasdiff/yaml3 v0.0.13 h1:06svmvOHOVBqF81+sY2EUScvUI/iS/vl2VIeUUxZQwg= github.com/oasdiff/yaml3 v0.0.13/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= diff --git a/tools/cli/internal/cli/merge/merge.go b/tools/cli/merge/merge.go similarity index 94% rename from tools/cli/internal/cli/merge/merge.go rename to tools/cli/merge/merge.go index af57072216..d2d17a19f3 100644 --- a/tools/cli/internal/cli/merge/merge.go +++ b/tools/cli/merge/merge.go @@ -18,9 +18,9 @@ import ( "encoding/json" "fmt" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/merge/merge_test.go b/tools/cli/merge/merge_test.go similarity index 95% rename from tools/cli/internal/cli/merge/merge_test.go rename to tools/cli/merge/merge_test.go index d94f63e11c..0bdcc13e35 100644 --- a/tools/cli/internal/cli/merge/merge_test.go +++ b/tools/cli/merge/merge_test.go @@ -19,8 +19,8 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" @@ -121,7 +121,7 @@ func TestOpts_PreRunE(t *testing.T) { }, { wantErr: require.NoError, - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", name: "Successful", externalPaths: []string{"test"}, }, diff --git a/tools/cli/pkg/apiversion/apiversion.go b/tools/cli/pkg/apiversion/apiversion.go deleted file mode 100644 index 9478a22a64..0000000000 --- a/tools/cli/pkg/apiversion/apiversion.go +++ /dev/null @@ -1,23 +0,0 @@ -// Package apiversion exposes API version parsing utilities for use outside the cli module. -package apiversion - -import ( - "github.com/mongodb/openapi/tools/cli/internal/apiversion" -) - -// Parse extracts the API version string from a versioned media type -// (e.g. "application/vnd.atlas.2024-01-01+json" → "2024-01-01"). -// Returns an error if the media type does not match the expected pattern. -func Parse(contentType string) (string, error) { - return apiversion.Parse(contentType) -} - -// IsPreviewStabilityLevel reports whether the given version string represents a preview release. -func IsPreviewStabilityLevel(version string) bool { - return apiversion.IsPreviewStabilityLevel(version) -} - -// IsUpcomingStabilityLevel reports whether the given version string represents an upcoming release. -func IsUpcomingStabilityLevel(version string) bool { - return apiversion.IsUpcomingStabilityLevel(version) -} diff --git a/tools/cli/pkg/openapi/openapi.go b/tools/cli/pkg/openapi/openapi.go deleted file mode 100644 index 4cc971fc85..0000000000 --- a/tools/cli/pkg/openapi/openapi.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2026 MongoDB Inc -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package openapi provides public interfaces for loading and saving OpenAPI specifications. -// This package wraps the internal openapi package to provide a stable public API. -package openapi - -import ( - "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi" - "github.com/mongodb/openapi/tools/cli/internal/openapi/slice" - "github.com/oasdiff/oasdiff/load" - "github.com/spf13/afero" -) - -// ExtractVersions returns all API version strings present in the spec, -// including stable date versions (e.g. "2024-01-01"), preview names -// (e.g. "preview", "public-preview"), and upcoming versions -// (e.g. "2024-01-01.upcoming") when no stable counterpart exists. -// The returned slice is sorted. -func ExtractVersions(spec *openapi3.T) ([]string, error) { - return openapi.ExtractVersionsWithEnv(spec, "") -} - -// SliceCriteria defines the selection criteria for slicing an OpenAPI spec. -// Operations matching ANY of the specified criteria will be included (OR logic). -type SliceCriteria = slice.Criteria - -// Slice filters an OpenAPI spec to keep only operations matching the criteria. -func Slice(spec *openapi3.T, criteria *SliceCriteria) error { - return slice.Slice(spec, criteria) -} - -// Loader provides methods for loading OpenAPI specifications from files. -type Loader struct { - impl *openapi.OpenAPI3 -} - -// NewLoader creates a new OpenAPI loader. -func NewLoader() *Loader { - return &Loader{ - impl: openapi.NewOpenAPI3(), - } -} - -// LoadFromPath loads an OpenAPI spec from the given file path. -func (l *Loader) LoadFromPath(path string) (*load.SpecInfo, error) { - return l.impl.CreateOpenAPISpecFromPath(path) -} - -// SaveToFile saves an OpenAPI spec to a file in the specified format. -// Format can be "json", "yaml", or "all". -func SaveToFile(path, format string, spec *openapi3.T, fs afero.Fs) error { - return openapi.Save(path, spec, format, fs) -} diff --git a/tools/cli/precommit.sh b/tools/cli/precommit.sh index 5404f9a5bc..39d290c813 100755 --- a/tools/cli/precommit.sh +++ b/tools/cli/precommit.sh @@ -4,7 +4,7 @@ set -e # Get the root directory of the project ROOT_DIR=$(git rev-parse --show-toplevel) -pushd "$ROOT_DIR/tools/cli" +pushd "$ROOT_DIR/tools/foas" make pre-commit popd diff --git a/tools/cli/internal/cli/root/openapi/builder.go b/tools/cli/root/openapi/builder.go similarity index 76% rename from tools/cli/internal/cli/root/openapi/builder.go rename to tools/cli/root/openapi/builder.go index 6a1ed04cd6..df14e9a2f4 100644 --- a/tools/cli/internal/cli/root/openapi/builder.go +++ b/tools/cli/root/openapi/builder.go @@ -18,15 +18,15 @@ import ( "fmt" "runtime" - "github.com/mongodb/openapi/tools/cli/internal/cli/breakingchanges" - "github.com/mongodb/openapi/tools/cli/internal/cli/changelog" - "github.com/mongodb/openapi/tools/cli/internal/cli/filter" - "github.com/mongodb/openapi/tools/cli/internal/cli/merge" - "github.com/mongodb/openapi/tools/cli/internal/cli/slice" - "github.com/mongodb/openapi/tools/cli/internal/cli/split" - "github.com/mongodb/openapi/tools/cli/internal/cli/sunset" - "github.com/mongodb/openapi/tools/cli/internal/cli/versions" - "github.com/mongodb/openapi/tools/cli/internal/version" + "github.com/mongodb/openapi/tools/cli/breakingchanges" + "github.com/mongodb/openapi/tools/cli/changelog" + "github.com/mongodb/openapi/tools/cli/filter" + "github.com/mongodb/openapi/tools/cli/merge" + "github.com/mongodb/openapi/tools/cli/slice" + "github.com/mongodb/openapi/tools/cli/split" + "github.com/mongodb/openapi/tools/cli/sunset" + "github.com/mongodb/openapi/tools/cli/versions" + "github.com/mongodb/openapi/tools/cli/version" "github.com/spf13/cobra" ) diff --git a/tools/cli/scripts/update_docs.sh b/tools/cli/scripts/update_docs.sh deleted file mode 100755 index 432f296a93..0000000000 --- a/tools/cli/scripts/update_docs.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -# Update the filters documentation -./scripts/doc_filters.sh > internal/openapi/filter/README.md - -go fmt ./... - -if [ -n "$(git status --porcelain internal/openapi/filter/README.md)" ]; then - git add "internal/openapi/filter/README.md" -fi \ No newline at end of file diff --git a/tools/cli/internal/cli/slice/slice.go b/tools/cli/slice/slice.go similarity index 94% rename from tools/cli/internal/cli/slice/slice.go rename to tools/cli/slice/slice.go index 2ec3b48190..dd202ae640 100644 --- a/tools/cli/internal/cli/slice/slice.go +++ b/tools/cli/slice/slice.go @@ -19,10 +19,10 @@ import ( "fmt" "log" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" - "github.com/mongodb/openapi/tools/cli/internal/openapi/slice" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" + "github.com/mongodb/openapi/tools/foas/openapi/slice" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/slice/slice_test.go b/tools/cli/slice/slice_test.go similarity index 100% rename from tools/cli/internal/cli/slice/slice_test.go rename to tools/cli/slice/slice_test.go diff --git a/tools/cli/internal/cli/split/split.go b/tools/cli/split/split.go similarity index 93% rename from tools/cli/internal/cli/split/split.go rename to tools/cli/split/split.go index f7b30dab79..ce2ab2f0ed 100644 --- a/tools/cli/internal/cli/split/split.go +++ b/tools/cli/split/split.go @@ -20,10 +20,10 @@ import ( "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/cli/filter" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/cli/filter" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/internal/cli/split/split_test.go b/tools/cli/split/split_test.go similarity index 91% rename from tools/cli/internal/cli/split/split_test.go rename to tools/cli/split/split_test.go index 983b71e095..06221638fd 100644 --- a/tools/cli/internal/cli/split/split_test.go +++ b/tools/cli/split/split_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/oasdiff/oasdiff/load" "github.com/spf13/afero" "github.com/stretchr/testify/require" @@ -29,7 +29,7 @@ func TestSuccessfulSplit_Run(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "foas.yaml", fs: fs, env: "dev", @@ -42,7 +42,7 @@ func TestSplitPublicPreviewRun(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_public_preview.json", + basePath: "../../foas/test/data/base_spec_with_public_preview.json", outputPath: "foas.yaml", fs: fs, env: "dev", @@ -63,7 +63,7 @@ func TestSplitPrivatePreviewRun(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_private_preview.json", + basePath: "../../foas/test/data/base_spec_with_private_preview.json", outputPath: "foas.yaml", fs: fs, env: "dev", @@ -84,7 +84,7 @@ func TestSplitUpcomingRun(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/openapi_with_upcoming.json", + basePath: "../../foas/test/data/openapi_with_upcoming.json", outputPath: "foas.yaml", fs: fs, env: "dev", @@ -105,7 +105,7 @@ func TestSplitMultiplePreviewsRun(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_multiple_private_and_public_previews.json", + basePath: "../../foas/test/data/base_spec_with_multiple_private_and_public_previews.json", outputPath: "foas.yaml", env: "dev", fs: fs, @@ -143,7 +143,7 @@ func TestInjectSha_Run(t *testing.T) { t.Parallel() fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "foas.yaml", fs: fs, gitSha: "123456", @@ -171,7 +171,7 @@ func TestOpts_PreRunE(t *testing.T) { }, { wantErr: require.NoError, - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", name: "Successful", }, } diff --git a/tools/cli/internal/cli/sunset/diff.go b/tools/cli/sunset/diff.go similarity index 96% rename from tools/cli/internal/cli/sunset/diff.go rename to tools/cli/sunset/diff.go index f9eb49f73a..8204fb8e96 100644 --- a/tools/cli/internal/cli/sunset/diff.go +++ b/tools/cli/sunset/diff.go @@ -21,10 +21,10 @@ import ( "strings" "time" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" - "github.com/mongodb/openapi/tools/cli/internal/openapi/sunset" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" + "github.com/mongodb/openapi/tools/foas/openapi/sunset" "github.com/spf13/afero" "github.com/spf13/cobra" "gopkg.in/yaml.v3" diff --git a/tools/cli/internal/cli/sunset/diff_test.go b/tools/cli/sunset/diff_test.go similarity index 99% rename from tools/cli/internal/cli/sunset/diff_test.go rename to tools/cli/sunset/diff_test.go index 95b968683a..7add60410e 100644 --- a/tools/cli/internal/cli/sunset/diff_test.go +++ b/tools/cli/sunset/diff_test.go @@ -18,7 +18,7 @@ import ( "testing" "time" - "github.com/mongodb/openapi/tools/cli/internal/openapi/sunset" + "github.com/mongodb/openapi/tools/foas/openapi/sunset" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/cli/sunset/list.go b/tools/cli/sunset/list.go similarity index 94% rename from tools/cli/internal/cli/sunset/list.go rename to tools/cli/sunset/list.go index fb59fb186d..5813c80e09 100644 --- a/tools/cli/internal/cli/sunset/list.go +++ b/tools/cli/sunset/list.go @@ -21,10 +21,10 @@ import ( "strings" "time" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" - "github.com/mongodb/openapi/tools/cli/internal/openapi/sunset" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" + "github.com/mongodb/openapi/tools/foas/openapi/sunset" "github.com/spf13/afero" "github.com/spf13/cobra" "gopkg.in/yaml.v3" diff --git a/tools/cli/internal/cli/sunset/list_test.go b/tools/cli/sunset/list_test.go similarity index 98% rename from tools/cli/internal/cli/sunset/list_test.go rename to tools/cli/sunset/list_test.go index 42fe58188f..e864af7259 100644 --- a/tools/cli/internal/cli/sunset/list_test.go +++ b/tools/cli/sunset/list_test.go @@ -19,7 +19,7 @@ import ( "reflect" "testing" - "github.com/mongodb/openapi/tools/cli/internal/openapi/sunset" + "github.com/mongodb/openapi/tools/foas/openapi/sunset" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -28,7 +28,7 @@ import ( func TestList_Run(t *testing.T) { fs := afero.NewMemMapFs() opts := &ListOpts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "foas.json", fs: fs, format: "json", diff --git a/tools/cli/internal/cli/sunset/sunset.go b/tools/cli/sunset/sunset.go similarity index 100% rename from tools/cli/internal/cli/sunset/sunset.go rename to tools/cli/sunset/sunset.go diff --git a/tools/cli/internal/cli/sunset/sunset_test.go b/tools/cli/sunset/sunset_test.go similarity index 93% rename from tools/cli/internal/cli/sunset/sunset_test.go rename to tools/cli/sunset/sunset_test.go index ad830c5adb..91c5bba4c6 100644 --- a/tools/cli/internal/cli/sunset/sunset_test.go +++ b/tools/cli/sunset/sunset_test.go @@ -17,7 +17,7 @@ package sunset import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/test" + "github.com/mongodb/openapi/tools/cli/test" ) func TestBuilder(t *testing.T) { diff --git a/tools/cli/internal/test/test.go b/tools/cli/test/cmdvalidator.go similarity index 100% rename from tools/cli/internal/test/test.go rename to tools/cli/test/cmdvalidator.go diff --git a/tools/cli/test/data/exemptions/exemptions.txt b/tools/cli/test/data/exemptions/exemptions.txt deleted file mode 100644 index 16da4cd26b..0000000000 --- a/tools/cli/test/data/exemptions/exemptions.txt +++ /dev/null @@ -1,5 +0,0 @@ -in components removed the schema 'GroupName' [api-schema-removed] -GET /api/atlas/v2/groups/{groupId}/clusters/provider/regions removed the 'GSP' enum value from the 'results/items/provider' response property for the response status '200' [response-property-enum-value-removed]. -GET /api/atlas/v1.0/groups/{groupId}/clusters/provider/regions removed the 'GSP' enum value from the 'results/items/provider' response property for the response status '200' [response-property-enum-value-removed]. -GET /api/atlas/v1.5/groups/{groupId}/clusters/provider/regions removed the 'GSP' enum value from the 'results/items/provider' response property for the response status '200' [response-property-enum-value-removed]. -GET /api/atlas/v1.0/groups/{groupId}/clusters/provider/regions removed the 'GSP' enum value from the 'results/items/provider' response property for the response status '200' [response-property-enum-value-removed]. diff --git a/tools/cli/test/e2e/cli/changelog_test.go b/tools/cli/test/e2e/cli/changelog_test.go index 4cfcfe7e18..921216b91e 100644 --- a/tools/cli/test/e2e/cli/changelog_test.go +++ b/tools/cli/test/e2e/cli/changelog_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/mongodb/openapi/tools/cli/internal/changelog" + "github.com/mongodb/openapi/tools/foas/changelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/test/e2e/cli/cli.go b/tools/cli/test/e2e/cli/cli.go index 139af98bf3..4f0b3b386a 100644 --- a/tools/cli/test/e2e/cli/cli.go +++ b/tools/cli/test/e2e/cli/cli.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -27,187 +27,187 @@ func NewBin(t *testing.T) string { func NewBaseSpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/base_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/base_spec.json") require.NoError(t, err) return cliPath } func NewChangelogBasePathNewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-version/base") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-version/base") require.NoError(t, err) return cliPath } func NewChangelogRevisionPathNewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-version/revision") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-version/revision") require.NoError(t, err) return cliPath } func NewChangelogExepmtionFilePathNewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-version/exemptions.yaml") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-version/exemptions.yaml") require.NoError(t, err) return cliPath } func NewChangelogOutputPathNewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-version/output") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-version/output") require.NoError(t, err) return cliPath } func NewChangelogBasePathSameAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/same-api-version/base") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/same-api-version/base") require.NoError(t, err) return cliPath } func NewChangelogRevisionPathSameAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/same-api-version/revision") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/same-api-version/revision") require.NoError(t, err) return cliPath } func NewChangelogExemptionFilePathSameAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/same-api-version/exemptions.yaml") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/same-api-version/exemptions.yaml") require.NoError(t, err) return cliPath } func NewChangelogOutputPathSameAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/same-api-version/output") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/same-api-version/output") require.NoError(t, err) return cliPath } func newChangelogOutputPathNewPreviewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-preview-version/output") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-preview-version/output") require.NoError(t, err) return cliPath } func newChangelogOutputPathUpcomingAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-upcoming-version/output") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-upcoming-version/output") require.NoError(t, err) return cliPath } func newChangelogBasePathNewPreviewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-preview-version/base") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-preview-version/base") require.NoError(t, err) return cliPath } func newChangelogBasePathUpcomingAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-upcoming-version/base") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-upcoming-version/base") require.NoError(t, err) return cliPath } func newChangelogRevisionPathNewPreviewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-preview-version/revision") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-preview-version/revision") require.NoError(t, err) return cliPath } func newChangelogRevisionPathUpcomingAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-upcoming-version/revision") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-upcoming-version/revision") require.NoError(t, err) return cliPath } func newChangelogExemptionFilePathNewPreviewAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-api-preview-version/exemptions.yaml") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-api-preview-version/exemptions.yaml") require.NoError(t, err) return cliPath } func newChangelogExemptionFilePathUpcomingAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/new-upcoming-version/exemptions.yaml") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/new-upcoming-version/exemptions.yaml") require.NoError(t, err) return cliPath } func newChangelogBasePathRenamedAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/rename-api-version/base") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/rename-api-version/base") require.NoError(t, err) return cliPath } func newChangelogRevisionPathRenamedAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/rename-api-version/revision") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/rename-api-version/revision") require.NoError(t, err) return cliPath } func newChangelogExemptionFilePathRenamedAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/rename-api-version/exemptions.yaml") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/rename-api-version/exemptions.yaml") require.NoError(t, err) return cliPath } func newChangelogOutputPathRenamedAPIVersion(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/changelog/rename-api-version/output") + cliPath, err := filepath.Abs("../../../../foas/test/data/changelog/rename-api-version/output") require.NoError(t, err) return cliPath } func NewAPIRegistrySpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/apiregistry_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/apiregistry_spec.json") require.NoError(t, err) return cliPath } func NewAuthNSpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/authn_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/authn_spec.json") require.NoError(t, err) return cliPath } func NewDuplicatedPathAPIRegistrySpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/duplicated_path_apiregistry_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/duplicated_path_apiregistry_spec.json") require.NoError(t, err) return cliPath } func NewNotIdenticalComponentPIRegistrySpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/not_identical_component_apiregistry_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/not_identical_component_apiregistry_spec.json") require.NoError(t, err) return cliPath } func NewDuplicatedTagAuthNSpecPath(t *testing.T) string { t.Helper() - cliPath, err := filepath.Abs("../../data/duplicated_tag_authn_spec.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/duplicated_tag_authn_spec.json") require.NoError(t, err) return cliPath } func NewValidAtlasSpecPath(t *testing.T, version, folder string) string { t.Helper() - cliPath, err := filepath.Abs("../../data/split/" + folder + "/openapi-v2-" + version + ".json") + cliPath, err := filepath.Abs("../../../../foas/test/data/split/" + folder + "/openapi-v2-" + version + ".json") require.NoError(t, err) return cliPath } diff --git a/tools/cli/test/e2e/cli/parse_test.go b/tools/cli/test/e2e/cli/parse_test.go index 6be574fbf6..8a606be600 100644 --- a/tools/cli/test/e2e/cli/parse_test.go +++ b/tools/cli/test/e2e/cli/parse_test.go @@ -35,9 +35,9 @@ func TestParseCommand(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - exemptionsFilePath, err := filepath.Abs("../../data/exemptions/" + tc.exemptionsFile) + exemptionsFilePath, err := filepath.Abs("../../../../foas/test/data/exemptions/" + tc.exemptionsFile) require.NoError(t, err) - outputFilePath, err := filepath.Abs("../../data/exemptions/" + tc.expectedOutput) + outputFilePath, err := filepath.Abs("../../../../foas/test/data/exemptions/" + tc.expectedOutput) require.NoError(t, err) cmd := exec.CommandContext(context.Background(), cliPath, diff --git a/tools/cli/test/e2e/cli/split_test.go b/tools/cli/test/e2e/cli/split_test.go index f1d0648462..cc21b8023b 100755 --- a/tools/cli/test/e2e/cli/split_test.go +++ b/tools/cli/test/e2e/cli/split_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/oasdiff/oasdiff/diff" "github.com/stretchr/testify/require" ) @@ -158,7 +158,7 @@ func TestSplitVersionsForOASWithExternalReferences(t *testing.T) { t.Parallel() folder := "dev" cliPath := NewBin(t) - base, err := filepath.Abs("../../data/split/" + folder + "/openapi-api-registry.json") + base, err := filepath.Abs("../../../../foas/test/data/split/" + folder + "/openapi-api-registry.json") require.NoError(t, err) copyMMSFileToOutput(t, folder) @@ -201,7 +201,7 @@ func copyMMSFileToOutput(t *testing.T, folder string) { t.Helper() // copy mms file to output folder because the split command will not copy it and it // is needed for external references - srcPath := "../../data/split/" + folder + "/openapi-mms.json" + srcPath := "../../../../foas/test/data/split/" + folder + "/openapi-mms.json" destPath := getOutputFolder(t, folder) + "/openapi-mms.json" cpCmd := exec.CommandContext(context.Background(), "cp", @@ -238,12 +238,12 @@ func getVersions(t *testing.T, cliPath, base, folder string) []string { func getInputPath(t *testing.T, specType, format, folder string) string { t.Helper() if specType == "not-filtered" { - cliPath, err := filepath.Abs("../../data/split/" + folder + "/openapi-mms.json") + cliPath, err := filepath.Abs("../../../../foas/test/data/split/" + folder + "/openapi-mms.json") require.NoError(t, err) return cliPath } - cliPath, err := filepath.Abs("../../data/split/" + folder + "/openapi-v2." + format) + cliPath, err := filepath.Abs("../../../../foas/test/data/split/" + folder + "/openapi-v2." + format) require.NoError(t, err) return cliPath } diff --git a/tools/cli/test/e2e/cli/sunset_test.go b/tools/cli/test/e2e/cli/sunset_test.go index 5d5cce6b53..f267e29878 100644 --- a/tools/cli/test/e2e/cli/sunset_test.go +++ b/tools/cli/test/e2e/cli/sunset_test.go @@ -9,13 +9,13 @@ import ( "path" "testing" - "github.com/mongodb/openapi/tools/cli/internal/cli/sunset" + "github.com/mongodb/openapi/tools/cli/sunset" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestSunsetDiff_NoChanges(t *testing.T) { - baseSpecPath := "../../data/base_spec.json" + baseSpecPath := "../../../../foas/test/data/base_spec.json" outputPath := path.Join(getOutputFolder(t, "sunset"), "diff.json") cliPath := NewBin(t) @@ -45,8 +45,8 @@ func TestSunsetDiff_NoChanges(t *testing.T) { } func TestSunsetDiff_WithChanges(t *testing.T) { - baseSpecPath := "../../data/base_spec.json" - specPath := "../../data/base_spec_with_mismatching_sunset_dates.json" + baseSpecPath := "../../../../foas/test/data/base_spec.json" + specPath := "../../../../foas/test/data/base_spec_with_mismatching_sunset_dates.json" outputPath := path.Join(getOutputFolder(t, "sunset"), "diff.json") cliPath := NewBin(t) @@ -107,8 +107,8 @@ func TestSunsetDiff_WithChanges(t *testing.T) { } func TestSunsetDiff_WithFilteredChanges(t *testing.T) { - baseSpecPath := "../../data/base_spec.json" - specPath := "../../data/base_spec_with_mismatching_sunset_dates.json" + baseSpecPath := "../../../../foas/test/data/base_spec.json" + specPath := "../../../../foas/test/data/base_spec_with_mismatching_sunset_dates.json" outputPath := path.Join(getOutputFolder(t, "sunset"), "diff.json") cliPath := NewBin(t) diff --git a/tools/cli/internal/cli/usage/usage.go b/tools/cli/usage/usage.go similarity index 100% rename from tools/cli/internal/cli/usage/usage.go rename to tools/cli/usage/usage.go diff --git a/tools/cli/internal/cli/validator/command.go b/tools/cli/validator/command.go similarity index 100% rename from tools/cli/internal/cli/validator/command.go rename to tools/cli/validator/command.go diff --git a/tools/cli/internal/version/version.go b/tools/cli/version/version.go similarity index 100% rename from tools/cli/internal/version/version.go rename to tools/cli/version/version.go diff --git a/tools/cli/internal/cli/versions/versions.go b/tools/cli/versions/versions.go similarity index 95% rename from tools/cli/internal/cli/versions/versions.go rename to tools/cli/versions/versions.go index 720e9bad4d..48cdb9880c 100644 --- a/tools/cli/internal/cli/versions/versions.go +++ b/tools/cli/versions/versions.go @@ -20,10 +20,10 @@ import ( "fmt" "strings" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/cli/flag" - "github.com/mongodb/openapi/tools/cli/internal/cli/usage" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/cli/flag" + "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" "gopkg.in/yaml.v3" diff --git a/tools/cli/internal/cli/versions/versions_test.go b/tools/cli/versions/versions_test.go similarity index 91% rename from tools/cli/internal/cli/versions/versions_test.go rename to tools/cli/versions/versions_test.go index 1c06d57945..49636454db 100644 --- a/tools/cli/internal/cli/versions/versions_test.go +++ b/tools/cli/versions/versions_test.go @@ -25,7 +25,7 @@ import ( func TestVersions_Run(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "foas.json", fs: fs, } @@ -41,7 +41,7 @@ func TestVersions_Run(t *testing.T) { func TestVersion_RunWithEnv(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec.json", + basePath: "../../foas/test/data/base_spec.json", outputPath: "foas.json", fs: fs, env: "staging", @@ -59,7 +59,7 @@ func TestVersion_RunWithEnv(t *testing.T) { func TestVersion_RunWithPreview(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_private_preview.json", + basePath: "../../foas/test/data/base_spec_with_private_preview.json", outputPath: "foas.json", fs: fs, env: "staging", @@ -78,7 +78,7 @@ func TestVersion_RunWithPreview(t *testing.T) { func TestVersion_RunWithUpcoming(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/openapi_with_upcoming.json", + basePath: "../../foas/test/data/openapi_with_upcoming.json", outputPath: "foas.json", fs: fs, env: "dev", @@ -94,7 +94,7 @@ func TestVersion_RunWithUpcoming(t *testing.T) { assert.Contains(t, string(b), "2025-09-22.upcoming") opts = &Opts{ - basePath: "../../../test/data/openapi_with_upcoming.json", + basePath: "../../foas/test/data/openapi_with_upcoming.json", outputPath: "foas.json", fs: fs, env: "prod", @@ -113,7 +113,7 @@ func TestVersion_RunWithUpcoming(t *testing.T) { func TestVersion_RunStabilityLevelPreviewAndPrivatePreview(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_private_preview.json", + basePath: "../../foas/test/data/base_spec_with_private_preview.json", outputPath: "foas.json", fs: fs, env: "staging", @@ -133,7 +133,7 @@ func TestVersion_RunStabilityLevelPreviewAndPrivatePreview(t *testing.T) { func TestVersion_PreviewAndPublicPreview(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_public_preview.json", + basePath: "../../foas/test/data/base_spec_with_public_preview.json", outputPath: "foas.json", fs: fs, env: "staging", @@ -153,7 +153,7 @@ func TestVersion_PreviewAndPublicPreview(t *testing.T) { func TestVersion_RunStabilityLevelStable(t *testing.T) { fs := afero.NewMemMapFs() opts := &Opts{ - basePath: "../../../test/data/base_spec_with_private_preview.json", + basePath: "../../foas/test/data/base_spec_with_private_preview.json", outputPath: "foas.json", fs: fs, env: "staging", diff --git a/tools/foas/.golangci.yml b/tools/foas/.golangci.yml new file mode 100644 index 0000000000..55ae17c59b --- /dev/null +++ b/tools/foas/.golangci.yml @@ -0,0 +1,137 @@ +version: "2" +run: + modules-download-mode: readonly + tests: true +linters: + default: none + enable: + - copyloopvar + - dogsled + - errcheck + - errorlint + - exhaustive + - funlen + - gocritic + - godot + - goprintffuncname + - gosec + - govet + - ineffassign + - lll + - makezero + - misspell + - nakedret + - noctx + - nolintlint + - perfsprint + - prealloc + - predeclared + - revive + - rowserrcheck + - staticcheck + - testifylint + - thelper + - unconvert + - unused + - whitespace + # don't enable: + # - deadcode + # - varcheck + # - structcheck + # - depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false] + # - gocyclo # we already have funlen lint + # - dupl # we have a lot of duplicate test cases + # - gochecknoinits # we need the init function for the provider + # - gochecknoglobals # we need some global variables + # - unparam # Forces to create global variables when one variable is repeated in different functions + # - goerr113 # It does not allow you to return an error, you need to save the error in a variable to do it + # - goconst + # - gocognit + settings: + funlen: + lines: 360 + statements: 120 + gocritic: + enabled-tags: + - diagnostic + - experimental + - opinionated + - performance + - style + govet: + enable: + - shadow + lll: + line-length: 150 + misspell: + locale: US + nestif: + min-complexity: 7 + revive: + severity: warning + rules: + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: defer + - name: dot-imports + - name: error-return + - name: error-strings + - name: error-naming + - name: early-return + - name: errorf + - name: exported + - name: import-shadowing + - name: indent-error-flow + - name: if-return + - name: increment-decrement + - name: var-naming + - name: var-declaration + - name: package-comments + - name: range + - name: receiver-naming + - name: time-naming + - name: unexported-return + - name: indent-error-flow + - name: errorf + - name: empty-block + - name: superfluous-else + - name: struct-tag + - name: unused-parameter + - name: unreachable-code + - name: redefines-builtin-id + - name: unused-receiver + - name: constant-logical-expr + - name: confusing-naming + - name: unnecessary-stmt + - name: use-any + - name: imports-blocklist + arguments: + - github.com/pkg/errors + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gci + - gofmt + - goimports + settings: + gci: + sections: + - standard + - default + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/tools/foas/Makefile b/tools/foas/Makefile new file mode 100644 index 0000000000..9c8abe3cd6 --- /dev/null +++ b/tools/foas/Makefile @@ -0,0 +1,72 @@ +# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html + +GOLANGCI_VERSION=v2.10.1 +TEST_CMD?=go test +COVERAGE=coverage.out + +export TERM := linux-m +export GO111MODULE := on + +.PHONY: deps +deps: ## Download go module dependencies + @echo "==> Installing go.mod dependencies..." + go mod download + go mod tidy + +.PHONY: devtools +devtools: ## Install dev tools + @echo "==> Installing dev tools..." + go install go.uber.org/mock/mockgen@latest + go install github.com/oasdiff/oasdiff@v1.11.4 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) + +.PHONY: setup +setup: deps devtools ## Set up dev env + +.PHONY: fmt +fmt: ### Format all go files with goimports and gofmt + find . -name "*.go" -exec gofmt -w "{}" \; + find . -name "*.go" -exec goimports -l -w "{}" \; + +.PHONY: build +build: ## Build the library packages + @echo "==> Building foas library" + go build ./... + +.PHONY: lint +lint: ## Run linter + golangci-lint run + +.PHONY: fix-lint +fix-lint: ## Fix linting errors + golangci-lint run --fix + +.PHONY: list +list: ## List all make targets + @${MAKE} -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | sort + +.PHONY: gen-docs +gen-docs: ## Generate docs + @echo "==> Updating docs" + ./scripts/update_docs.sh + +.PHONY: unit-test +unit-test: ## Run unit-tests + @echo "==> Running unit tests..." + $(TEST_CMD) -race -cover ./... + +.PHONY: test +test: unit-test ## Alias for unit-test + +.PHONY: gen-mocks +gen-mocks: ## Generate mocks + @echo "==> Generating mocks" + go generate ./... + +.PHONY: pre-commit +pre-commit: fmt lint unit-test ## Run pre-commit checks + +.PHONY: help +.DEFAULT_GOAL := help +help: + @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/tools/foas/README.md b/tools/foas/README.md new file mode 100644 index 0000000000..8aceef97c5 --- /dev/null +++ b/tools/foas/README.md @@ -0,0 +1,39 @@ +# FOASCLI +FOASCLI is a Go-based CLI tool that provides commands for generating the Federated OpenAPI specification and the API changelog. + +### Build From Source + +#### Fetch Source + +```bash +git clone https://github.com/mongodb/openapi.git +cd openapi/tools/foas +``` + +#### Build +To build `foascli`, run: + +```bash +make build +``` + +The resulting `foascli` binary is placed in `./bin`. + +## Usage +To get a list of available commands, run `foascli help`. + +## Setup Environment +To set up the development environment, run: +```bash +make setup +``` + +### Run tests +To run unit and e2e tests, run: +```bash +make lint && unit-test && e2e-test +``` + +## Contributing + +See our [CONTRIBUTING.md](../../CONTRIBUTING.md) guide. diff --git a/tools/cli/internal/apiversion/stabilitylevel.go b/tools/foas/apiversion/stabilitylevel.go similarity index 100% rename from tools/cli/internal/apiversion/stabilitylevel.go rename to tools/foas/apiversion/stabilitylevel.go diff --git a/tools/cli/internal/apiversion/stabilitylevel_test.go b/tools/foas/apiversion/stabilitylevel_test.go similarity index 100% rename from tools/cli/internal/apiversion/stabilitylevel_test.go rename to tools/foas/apiversion/stabilitylevel_test.go diff --git a/tools/cli/internal/apiversion/version.go b/tools/foas/apiversion/version.go similarity index 100% rename from tools/cli/internal/apiversion/version.go rename to tools/foas/apiversion/version.go diff --git a/tools/cli/internal/apiversion/version_test.go b/tools/foas/apiversion/version_test.go similarity index 100% rename from tools/cli/internal/apiversion/version_test.go rename to tools/foas/apiversion/version_test.go diff --git a/tools/cli/internal/breakingchanges/exemptions.go b/tools/foas/breakingchanges/exemptions.go similarity index 100% rename from tools/cli/internal/breakingchanges/exemptions.go rename to tools/foas/breakingchanges/exemptions.go diff --git a/tools/cli/internal/breakingchanges/exemptions_test.go b/tools/foas/breakingchanges/exemptions_test.go similarity index 99% rename from tools/cli/internal/breakingchanges/exemptions_test.go rename to tools/foas/breakingchanges/exemptions_test.go index ce6ccbd279..e45c786670 100644 --- a/tools/cli/internal/breakingchanges/exemptions_test.go +++ b/tools/foas/breakingchanges/exemptions_test.go @@ -24,7 +24,7 @@ import ( ) func TestGenerateExemptionsFileWithFs(t *testing.T) { - exemptionsFolder, err := filepath.Abs("../../test/data/exemptions") + exemptionsFolder, err := filepath.Abs("../test/data/exemptions") require.NoError(t, err) fs := afero.NewOsFs() diff --git a/tools/cli/internal/changelog/changelog.go b/tools/foas/changelog/changelog.go similarity index 99% rename from tools/cli/internal/changelog/changelog.go rename to tools/foas/changelog/changelog.go index 11aa883667..fac0ebb6fe 100644 --- a/tools/cli/internal/changelog/changelog.go +++ b/tools/foas/changelog/changelog.go @@ -22,8 +22,8 @@ import ( "strings" "time" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/oasdiff/oasdiff/checker" "github.com/oasdiff/oasdiff/diff" "github.com/oasdiff/oasdiff/load" diff --git a/tools/cli/internal/changelog/changelog_test.go b/tools/foas/changelog/changelog_test.go similarity index 100% rename from tools/cli/internal/changelog/changelog_test.go rename to tools/foas/changelog/changelog_test.go diff --git a/tools/cli/internal/changelog/manual_entry.go b/tools/foas/changelog/manual_entry.go similarity index 97% rename from tools/cli/internal/changelog/manual_entry.go rename to tools/foas/changelog/manual_entry.go index 301509bc79..7a27355e4f 100644 --- a/tools/cli/internal/changelog/manual_entry.go +++ b/tools/foas/changelog/manual_entry.go @@ -19,7 +19,7 @@ import ( "log" "strings" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/oasdiff/oasdiff/checker" ) diff --git a/tools/cli/internal/changelog/manual_entry_test.go b/tools/foas/changelog/manual_entry_test.go similarity index 97% rename from tools/cli/internal/changelog/manual_entry_test.go rename to tools/foas/changelog/manual_entry_test.go index 76bd5db2f5..4c5d654d3f 100644 --- a/tools/cli/internal/changelog/manual_entry_test.go +++ b/tools/foas/changelog/manual_entry_test.go @@ -17,7 +17,7 @@ package changelog import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/changelog/merge.go b/tools/foas/changelog/merge.go similarity index 99% rename from tools/cli/internal/changelog/merge.go rename to tools/foas/changelog/merge.go index bf87ab072f..5513f57d04 100644 --- a/tools/cli/internal/changelog/merge.go +++ b/tools/foas/changelog/merge.go @@ -20,7 +20,7 @@ import ( "log" "sort" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/oasdiff/oasdiff/checker" ) diff --git a/tools/cli/internal/changelog/merge_test.go b/tools/foas/changelog/merge_test.go similarity index 98% rename from tools/cli/internal/changelog/merge_test.go rename to tools/foas/changelog/merge_test.go index c8e09c7524..9aefc75cd4 100644 --- a/tools/cli/internal/changelog/merge_test.go +++ b/tools/foas/changelog/merge_test.go @@ -17,13 +17,13 @@ package changelog import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestMergeChangelogOneChange(t *testing.T) { - baseChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + baseChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) lastChangelogRunDate := baseChangelog[0].Date @@ -98,7 +98,7 @@ func TestMergeChangelogOneChange(t *testing.T) { func TestMergeChangelogTwoVersionsNoDeprecations(t *testing.T) { // arrange - baseChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + baseChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) lastChangelogRunDate := baseChangelog[0].Date @@ -214,7 +214,7 @@ func TestMergeChangelogTwoVersionsNoDeprecations(t *testing.T) { } func TestMergeChangelogAddTwoEndpoints(t *testing.T) { - originalChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + originalChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) lastChangelogRunDate := originalChangelog[0].Date @@ -467,7 +467,7 @@ func TestSortChangelog(t *testing.T) { func TestMergeChangelogTwoVersionsWithDeprecations(t *testing.T) { // arrange - baseChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + baseChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) lastChangelogRunDate := baseChangelog[0].Date @@ -595,7 +595,7 @@ func TestMergeChangelogTwoVersionsWithDeprecations(t *testing.T) { } func TestMergeChangelogWithDeprecations(t *testing.T) { - baseChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + baseChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) firstVersion := "2023-02-01" @@ -717,7 +717,7 @@ func TestMergeChangelogWithDeprecations(t *testing.T) { } func TestMergeChangelogCompare(t *testing.T) { - baseChangelog, err := NewEntriesFromPath("../../test/data/changelog/changelog.json") + baseChangelog, err := NewEntriesFromPath("../test/data/changelog/changelog.json") require.NoError(t, err) firstVersion := "2023-01-01" diff --git a/tools/cli/internal/changelog/outputfilter/enum.go b/tools/foas/changelog/outputfilter/enum.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/enum.go rename to tools/foas/changelog/outputfilter/enum.go diff --git a/tools/cli/internal/changelog/outputfilter/enum_test.go b/tools/foas/changelog/outputfilter/enum_test.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/enum_test.go rename to tools/foas/changelog/outputfilter/enum_test.go diff --git a/tools/cli/internal/changelog/outputfilter/field.go b/tools/foas/changelog/outputfilter/field.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/field.go rename to tools/foas/changelog/outputfilter/field.go diff --git a/tools/cli/internal/changelog/outputfilter/field_test.go b/tools/foas/changelog/outputfilter/field_test.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/field_test.go rename to tools/foas/changelog/outputfilter/field_test.go diff --git a/tools/cli/internal/changelog/outputfilter/hide.go b/tools/foas/changelog/outputfilter/hide.go similarity index 98% rename from tools/cli/internal/changelog/outputfilter/hide.go rename to tools/foas/changelog/outputfilter/hide.go index e85f689667..5b23883540 100644 --- a/tools/cli/internal/changelog/outputfilter/hide.go +++ b/tools/foas/changelog/outputfilter/hide.go @@ -5,7 +5,7 @@ import ( "slices" "strings" - "github.com/mongodb/openapi/tools/cli/internal/breakingchanges" + "github.com/mongodb/openapi/tools/foas/breakingchanges" "github.com/spf13/afero" ) diff --git a/tools/cli/internal/changelog/outputfilter/hide_test.go b/tools/foas/changelog/outputfilter/hide_test.go similarity index 98% rename from tools/cli/internal/changelog/outputfilter/hide_test.go rename to tools/foas/changelog/outputfilter/hide_test.go index a7968be203..8112dd9a8c 100644 --- a/tools/cli/internal/changelog/outputfilter/hide_test.go +++ b/tools/foas/changelog/outputfilter/hide_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/mongodb/openapi/tools/cli/internal/breakingchanges" + "github.com/mongodb/openapi/tools/foas/breakingchanges" "github.com/spf13/afero" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/tools/cli/internal/changelog/outputfilter/message.go b/tools/foas/changelog/outputfilter/message.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/message.go rename to tools/foas/changelog/outputfilter/message.go diff --git a/tools/cli/internal/changelog/outputfilter/message_test.go b/tools/foas/changelog/outputfilter/message_test.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/message_test.go rename to tools/foas/changelog/outputfilter/message_test.go diff --git a/tools/cli/internal/changelog/outputfilter/operationconfig.go b/tools/foas/changelog/outputfilter/operationconfig.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/operationconfig.go rename to tools/foas/changelog/outputfilter/operationconfig.go diff --git a/tools/cli/internal/changelog/outputfilter/operationconfig_test.go b/tools/foas/changelog/outputfilter/operationconfig_test.go similarity index 98% rename from tools/cli/internal/changelog/outputfilter/operationconfig_test.go rename to tools/foas/changelog/outputfilter/operationconfig_test.go index dc725ec466..5bc4fd3b51 100644 --- a/tools/cli/internal/changelog/outputfilter/operationconfig_test.go +++ b/tools/foas/changelog/outputfilter/operationconfig_test.go @@ -5,14 +5,14 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi" + "github.com/mongodb/openapi/tools/foas/openapi" "github.com/oasdiff/oasdiff/load" "github.com/stretchr/testify/require" ) func TestOpenApiSpecMethods(t *testing.T) { loader := openapi.NewOpenAPI3().WithExcludedPrivatePaths() - spec, err := loader.CreateOpenAPISpecFromPath("../../../test/data/changelog/manual_generated_test_spec.json") + spec, err := loader.CreateOpenAPISpecFromPath("../../test/data/changelog/manual_generated_test_spec.json") require.NoError(t, err) expectedConfig := map[string]*OperationConfig{ diff --git a/tools/cli/internal/changelog/outputfilter/outputfilter.go b/tools/foas/changelog/outputfilter/outputfilter.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/outputfilter.go rename to tools/foas/changelog/outputfilter/outputfilter.go diff --git a/tools/cli/internal/changelog/outputfilter/squash.go b/tools/foas/changelog/outputfilter/squash.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/squash.go rename to tools/foas/changelog/outputfilter/squash.go diff --git a/tools/cli/internal/changelog/outputfilter/squash_test.go b/tools/foas/changelog/outputfilter/squash_test.go similarity index 100% rename from tools/cli/internal/changelog/outputfilter/squash_test.go rename to tools/foas/changelog/outputfilter/squash_test.go diff --git a/tools/cli/internal/changelog/sunset.go b/tools/foas/changelog/sunset.go similarity index 98% rename from tools/cli/internal/changelog/sunset.go rename to tools/foas/changelog/sunset.go index e2f2cefdc9..6b4eccf3e7 100644 --- a/tools/cli/internal/changelog/sunset.go +++ b/tools/foas/changelog/sunset.go @@ -20,7 +20,7 @@ import ( "strings" "time" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/oasdiff/oasdiff/checker" ) diff --git a/tools/cli/internal/changelog/sunset_test.go b/tools/foas/changelog/sunset_test.go similarity index 98% rename from tools/cli/internal/changelog/sunset_test.go rename to tools/foas/changelog/sunset_test.go index 1d455ad37a..4ec661245c 100644 --- a/tools/cli/internal/changelog/sunset_test.go +++ b/tools/foas/changelog/sunset_test.go @@ -17,7 +17,7 @@ package changelog import ( "testing" - "github.com/mongodb/openapi/tools/cli/internal/changelog/outputfilter" + "github.com/mongodb/openapi/tools/foas/changelog/outputfilter" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/foas/go.mod b/tools/foas/go.mod new file mode 100644 index 0000000000..cb391e641a --- /dev/null +++ b/tools/foas/go.mod @@ -0,0 +1,43 @@ +module github.com/mongodb/openapi/tools/foas + +go 1.26 + +toolchain go1.26.0 + +require ( + github.com/getkin/kin-openapi v0.139.0 + github.com/iancoleman/strcase v0.3.0 + github.com/oasdiff/oasdiff v1.16.0 + github.com/spf13/afero v1.15.0 + github.com/stretchr/testify v1.11.1 + go.uber.org/mock v0.6.0 + golang.org/x/text v0.37.0 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + cloud.google.com/go v0.123.0 // indirect + github.com/TwiN/go-color v1.4.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/go-openapi/jsonpointer v0.22.5 // indirect + github.com/go-openapi/swag/jsonname v0.25.5 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/mailru/easyjson v0.9.2 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/oasdiff/yaml v0.1.0 // indirect + github.com/oasdiff/yaml3 v0.0.13 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect + github.com/tidwall/gjson v1.18.0 // indirect + github.com/tidwall/match v1.2.0 // indirect + github.com/tidwall/pretty v1.2.1 // indirect + github.com/tidwall/sjson v1.2.5 // indirect + github.com/wI2L/jsondiff v0.7.1 // indirect + github.com/woodsbury/decimal128 v1.4.0 // indirect + github.com/yargevad/filepathx v1.0.0 // indirect + github.com/yuin/goldmark v1.8.2 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect +) diff --git a/tools/foas/go.sum b/tools/foas/go.sum new file mode 100644 index 0000000000..40138ab629 --- /dev/null +++ b/tools/foas/go.sum @@ -0,0 +1,88 @@ +cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= +cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= +github.com/TwiN/go-color v1.4.1 h1:mqG0P/KBgHKVqmtL5ye7K0/Gr4l6hTksPgTgMk3mUzc= +github.com/TwiN/go-color v1.4.1/go.mod h1:WcPf/jtiW95WBIsEeY1Lc/b8aaWoiqQpu5cf8WFxu+s= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= +github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/getkin/kin-openapi v0.139.0 h1:pBFXcZJFwz9J1X64jzxlOoNgFm+TF7kNrs9+HJVN6Ic= +github.com/getkin/kin-openapi v0.139.0/go.mod h1:NGxPfE4PwS/TRXEbyx2RrxDFPZvxcWw31Tw8XXjPZLs= +github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA= +github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0= +github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo= +github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU= +github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM= +github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M= +github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/oasdiff/oasdiff v1.16.0 h1:dcV0Y4oO84CrAKddUzdkjWDm/jHw0hXaohurxdgABRs= +github.com/oasdiff/oasdiff v1.16.0/go.mod h1:v/DNQeB3qIYBf33xxi1dReXImDUMaCk4QNX93jpwSzg= +github.com/oasdiff/yaml v0.1.0 h1:0bqZjfKc/8S9urj4JuwepX41WX9EoA6ifhU3SV06cXg= +github.com/oasdiff/yaml v0.1.0/go.mod h1:kOlRmMdL2X3vucLCEQO5u61SU22RysnfXvcttrZA1O0= +github.com/oasdiff/yaml3 v0.0.13 h1:06svmvOHOVBqF81+sY2EUScvUI/iS/vl2VIeUUxZQwg= +github.com/oasdiff/yaml3 v0.0.13/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= +github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= +github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= +github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/match v1.2.0 h1:0pt8FlkOwjN2fPt4bIl4BoNxb98gGHN2ObFEDkrfZnM= +github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/wI2L/jsondiff v0.7.1 h1:Fg9+yj+1/x3UtPBJhR91TKEzRkrEEWcAcLbg9dzEaNM= +github.com/wI2L/jsondiff v0.7.1/go.mod h1:yAt2W7U6Jd4HK0RA8DGSGk0zDtfEtOUUJVnH/xICpjo= +github.com/woodsbury/decimal128 v1.4.0 h1:xJATj7lLu4f2oObouMt2tgGiElE5gO6mSWUjQsBgUlc= +github.com/woodsbury/decimal128 v1.4.0/go.mod h1:BP46FUrVjVhdTbKT+XuQh2xfQaGki9LMIRJSFuh6THU= +github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5FYc= +github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA= +github.com/yuin/goldmark v1.8.2 h1:kEGpgqJXdgbkhcOgBxkC0X0PmoPG1ZyoZ117rDVp4zE= +github.com/yuin/goldmark v1.8.2/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= +go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/cli/internal/openapi/errors/merge_conflict_error.go b/tools/foas/openapi/errors/merge_conflict_error.go similarity index 100% rename from tools/cli/internal/openapi/errors/merge_conflict_error.go rename to tools/foas/openapi/errors/merge_conflict_error.go diff --git a/tools/cli/internal/openapi/file.go b/tools/foas/openapi/file.go similarity index 100% rename from tools/cli/internal/openapi/file.go rename to tools/foas/openapi/file.go diff --git a/tools/cli/internal/openapi/file_test.go b/tools/foas/openapi/file_test.go similarity index 100% rename from tools/cli/internal/openapi/file_test.go rename to tools/foas/openapi/file_test.go diff --git a/tools/cli/internal/openapi/filter/README.md b/tools/foas/openapi/filter/README.md similarity index 69% rename from tools/cli/internal/openapi/filter/README.md rename to tools/foas/openapi/filter/README.md index 4192c10526..755e3305f9 100644 --- a/tools/cli/internal/openapi/filter/README.md +++ b/tools/foas/openapi/filter/README.md @@ -8,10 +8,10 @@ The Atlas Admin API OpenAPI specifications are used not only to document REST en - Filtering per version, so that only the endpoints that are available in that version are shown. ## What filters are available? ### List of filters -[ExtensionFilter: is a filter that removes the x-xgen-IPA-exception extension from the OpenAPI spec (unless keepIPAExceptions is set in metadata).](../internal/openapi/filter/extension.go?plain=1#L21) -[HiddenEnvsFilter: is a filter that removes paths, operations,](../internal/openapi/filter/hidden_envs.go?plain=1#L28) -[InfoVersioningFilter: Filter that modifies the Info object in the OpenAPI spec with the target version.](../internal/openapi/filter/info.go?plain=1#L23) -[OperationsFilter: is a filter that removes the x-xgen-owner-team extension from operations.](../internal/openapi/filter/operations.go?plain=1#L20) -[TagsFilter: removes tags that are not used in the operations.](../internal/openapi/filter/tags.go?plain=1#L23) -[VersioningExtensionFilter: is a filter that updates the x-sunset and x-xgen-version extensions to a date string](../internal/openapi/filter/versioning_extension.go?plain=1#L25) -[VersioningFilter: is a filter that modifies the OpenAPI spec by removing operations and responses](../internal/openapi/filter/versioning.go?plain=1#L25) +[ExtensionFilter: is a filter that removes the x-xgen-IPA-exception extension from the OpenAPI spec (unless keepIPAExceptions is set in metadata).](./extension.go?plain=1#L21) +[HiddenEnvsFilter: is a filter that removes paths, operations,](./hidden_envs.go?plain=1#L28) +[InfoVersioningFilter: Filter that modifies the Info object in the OpenAPI spec with the target version.](./info.go?plain=1#L23) +[OperationsFilter: is a filter that removes the x-xgen-owner-team extension from operations.](./operations.go?plain=1#L20) +[TagsFilter: removes tags that are not used in the operations.](./tags.go?plain=1#L23) +[VersioningExtensionFilter: is a filter that updates the x-sunset and x-xgen-version extensions to a date string](./versioning_extension.go?plain=1#L25) +[VersioningFilter: is a filter that modifies the OpenAPI spec by removing operations and responses](./versioning.go?plain=1#L25) diff --git a/tools/cli/internal/openapi/filter/bump.go b/tools/foas/openapi/filter/bump.go similarity index 100% rename from tools/cli/internal/openapi/filter/bump.go rename to tools/foas/openapi/filter/bump.go diff --git a/tools/cli/internal/openapi/filter/bump_test.go b/tools/foas/openapi/filter/bump_test.go similarity index 98% rename from tools/cli/internal/openapi/filter/bump_test.go rename to tools/foas/openapi/filter/bump_test.go index 3b14f40048..7879dedd45 100644 --- a/tools/cli/internal/openapi/filter/bump_test.go +++ b/tools/foas/openapi/filter/bump_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/code_sample.go b/tools/foas/openapi/filter/code_sample.go similarity index 99% rename from tools/cli/internal/openapi/filter/code_sample.go rename to tools/foas/openapi/filter/code_sample.go index f88d99fdbc..cac09a80b6 100644 --- a/tools/cli/internal/openapi/filter/code_sample.go +++ b/tools/foas/openapi/filter/code_sample.go @@ -25,7 +25,7 @@ import ( "github.com/getkin/kin-openapi/openapi3" "github.com/iancoleman/strcase" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "golang.org/x/text/cases" "golang.org/x/text/language" ) diff --git a/tools/cli/internal/openapi/filter/code_sample_test.go b/tools/foas/openapi/filter/code_sample_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/code_sample_test.go rename to tools/foas/openapi/filter/code_sample_test.go index 40865eaf94..d0c09ebe53 100644 --- a/tools/cli/internal/openapi/filter/code_sample_test.go +++ b/tools/foas/openapi/filter/code_sample_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/extension.go b/tools/foas/openapi/filter/extension.go similarity index 100% rename from tools/cli/internal/openapi/filter/extension.go rename to tools/foas/openapi/filter/extension.go diff --git a/tools/cli/internal/openapi/filter/extension_test.go b/tools/foas/openapi/filter/extension_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/extension_test.go rename to tools/foas/openapi/filter/extension_test.go index c39aff6b8b..56d69c2242 100644 --- a/tools/cli/internal/openapi/filter/extension_test.go +++ b/tools/foas/openapi/filter/extension_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/filter.go b/tools/foas/openapi/filter/filter.go similarity index 98% rename from tools/cli/internal/openapi/filter/filter.go rename to tools/foas/openapi/filter/filter.go index de5e0daa40..74f4d37376 100644 --- a/tools/cli/internal/openapi/filter/filter.go +++ b/tools/foas/openapi/filter/filter.go @@ -22,10 +22,10 @@ import ( reflect "reflect" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" ) -//go:generate mockgen -destination=../filter/mock_filter.go -package=filter github.com/mongodb/openapi/tools/cli/internal/openapi/filter Filter +//go:generate mockgen -destination=../filter/mock_filter.go -package=filter github.com/mongodb/openapi/tools/foas/openapi/filter Filter type Filter interface { Apply() error ValidateMetadata() error diff --git a/tools/cli/internal/openapi/filter/filter_test.go b/tools/foas/openapi/filter/filter_test.go similarity index 98% rename from tools/cli/internal/openapi/filter/filter_test.go rename to tools/foas/openapi/filter/filter_test.go index 7cc14eadf5..0c6b31a18a 100644 --- a/tools/cli/internal/openapi/filter/filter_test.go +++ b/tools/foas/openapi/filter/filter_test.go @@ -17,7 +17,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/hidden_envs.go b/tools/foas/openapi/filter/hidden_envs.go similarity index 99% rename from tools/cli/internal/openapi/filter/hidden_envs.go rename to tools/foas/openapi/filter/hidden_envs.go index cc704e6259..c551f9454a 100644 --- a/tools/cli/internal/openapi/filter/hidden_envs.go +++ b/tools/foas/openapi/filter/hidden_envs.go @@ -19,7 +19,7 @@ import ( "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" ) const ( diff --git a/tools/cli/internal/openapi/filter/hidden_envs_test.go b/tools/foas/openapi/filter/hidden_envs_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/hidden_envs_test.go rename to tools/foas/openapi/filter/hidden_envs_test.go index 3be3caa0b7..253bab1333 100644 --- a/tools/cli/internal/openapi/filter/hidden_envs_test.go +++ b/tools/foas/openapi/filter/hidden_envs_test.go @@ -19,8 +19,8 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/pointer" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/pointer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/info.go b/tools/foas/openapi/filter/info.go similarity index 96% rename from tools/cli/internal/openapi/filter/info.go rename to tools/foas/openapi/filter/info.go index 2def0cdba1..62db68166a 100644 --- a/tools/cli/internal/openapi/filter/info.go +++ b/tools/foas/openapi/filter/info.go @@ -18,7 +18,7 @@ import ( "fmt" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" ) // InfoVersioningFilter modifies the Info object in the OpenAPI spec with the target version. diff --git a/tools/cli/internal/openapi/filter/info_test.go b/tools/foas/openapi/filter/info_test.go similarity index 97% rename from tools/cli/internal/openapi/filter/info_test.go rename to tools/foas/openapi/filter/info_test.go index 5b8f099cbb..26f76879c3 100644 --- a/tools/cli/internal/openapi/filter/info_test.go +++ b/tools/foas/openapi/filter/info_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/mock_filter.go b/tools/foas/openapi/filter/mock_filter.go similarity index 88% rename from tools/cli/internal/openapi/filter/mock_filter.go rename to tools/foas/openapi/filter/mock_filter.go index 30d17193b6..71df6d27fb 100644 --- a/tools/cli/internal/openapi/filter/mock_filter.go +++ b/tools/foas/openapi/filter/mock_filter.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/mongodb/openapi/tools/cli/internal/openapi/filter (interfaces: Filter) +// Source: github.com/mongodb/openapi/tools/foas/openapi/filter (interfaces: Filter) // // Generated by this command: // -// mockgen -destination=../filter/mock_filter.go -package=filter github.com/mongodb/openapi/tools/cli/internal/openapi/filter Filter +// mockgen -destination=../filter/mock_filter.go -package=filter github.com/mongodb/openapi/tools/foas/openapi/filter Filter // // Package filter is a generated GoMock package. diff --git a/tools/cli/internal/openapi/filter/operations.go b/tools/foas/openapi/filter/operations.go similarity index 100% rename from tools/cli/internal/openapi/filter/operations.go rename to tools/foas/openapi/filter/operations.go diff --git a/tools/cli/internal/openapi/filter/operations_test.go b/tools/foas/openapi/filter/operations_test.go similarity index 100% rename from tools/cli/internal/openapi/filter/operations_test.go rename to tools/foas/openapi/filter/operations_test.go diff --git a/tools/cli/internal/openapi/filter/parameters.go b/tools/foas/openapi/filter/parameters.go similarity index 100% rename from tools/cli/internal/openapi/filter/parameters.go rename to tools/foas/openapi/filter/parameters.go diff --git a/tools/cli/internal/openapi/filter/parameters_test.go b/tools/foas/openapi/filter/parameters_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/parameters_test.go rename to tools/foas/openapi/filter/parameters_test.go index 4aa99a37b2..fb0ff4a5cb 100644 --- a/tools/cli/internal/openapi/filter/parameters_test.go +++ b/tools/foas/openapi/filter/parameters_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/pointer" + "github.com/mongodb/openapi/tools/foas/pointer" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/response.go b/tools/foas/openapi/filter/response.go similarity index 100% rename from tools/cli/internal/openapi/filter/response.go rename to tools/foas/openapi/filter/response.go diff --git a/tools/cli/internal/openapi/filter/response_test.go b/tools/foas/openapi/filter/response_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/response_test.go rename to tools/foas/openapi/filter/response_test.go index 5efcd5d6db..f6faaf719f 100644 --- a/tools/cli/internal/openapi/filter/response_test.go +++ b/tools/foas/openapi/filter/response_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/pointer" + "github.com/mongodb/openapi/tools/foas/pointer" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/schemas.go b/tools/foas/openapi/filter/schemas.go similarity index 100% rename from tools/cli/internal/openapi/filter/schemas.go rename to tools/foas/openapi/filter/schemas.go diff --git a/tools/cli/internal/openapi/filter/schemas_test.go b/tools/foas/openapi/filter/schemas_test.go similarity index 100% rename from tools/cli/internal/openapi/filter/schemas_test.go rename to tools/foas/openapi/filter/schemas_test.go diff --git a/tools/cli/internal/openapi/filter/sunset.go b/tools/foas/openapi/filter/sunset.go similarity index 100% rename from tools/cli/internal/openapi/filter/sunset.go rename to tools/foas/openapi/filter/sunset.go diff --git a/tools/cli/internal/openapi/filter/sunset_test.go b/tools/foas/openapi/filter/sunset_test.go similarity index 100% rename from tools/cli/internal/openapi/filter/sunset_test.go rename to tools/foas/openapi/filter/sunset_test.go diff --git a/tools/cli/internal/openapi/filter/tags.go b/tools/foas/openapi/filter/tags.go similarity index 100% rename from tools/cli/internal/openapi/filter/tags.go rename to tools/foas/openapi/filter/tags.go diff --git a/tools/cli/internal/openapi/filter/tags_test.go b/tools/foas/openapi/filter/tags_test.go similarity index 100% rename from tools/cli/internal/openapi/filter/tags_test.go rename to tools/foas/openapi/filter/tags_test.go diff --git a/tools/cli/internal/openapi/filter/template/go_sdk_code_sample.go.tmpl b/tools/foas/openapi/filter/template/go_sdk_code_sample.go.tmpl similarity index 100% rename from tools/cli/internal/openapi/filter/template/go_sdk_code_sample.go.tmpl rename to tools/foas/openapi/filter/template/go_sdk_code_sample.go.tmpl diff --git a/tools/cli/internal/openapi/filter/versioning.go b/tools/foas/openapi/filter/versioning.go similarity index 99% rename from tools/cli/internal/openapi/filter/versioning.go rename to tools/foas/openapi/filter/versioning.go index b78b4d9a6e..5179dd3378 100644 --- a/tools/cli/internal/openapi/filter/versioning.go +++ b/tools/foas/openapi/filter/versioning.go @@ -19,7 +19,7 @@ import ( "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" ) // VersioningFilter is a filter that modifies the OpenAPI spec by removing paths, operations and responses diff --git a/tools/cli/internal/openapi/filter/versioning_extension.go b/tools/foas/openapi/filter/versioning_extension.go similarity index 98% rename from tools/cli/internal/openapi/filter/versioning_extension.go rename to tools/foas/openapi/filter/versioning_extension.go index 71f01a9eab..5590df2ac4 100644 --- a/tools/cli/internal/openapi/filter/versioning_extension.go +++ b/tools/foas/openapi/filter/versioning_extension.go @@ -19,7 +19,7 @@ import ( "time" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" ) // VersioningExtensionFilter is a filter that updates the x-sunset and x-xgen-version extensions to a date string diff --git a/tools/cli/internal/openapi/filter/versioning_extension_test.go b/tools/foas/openapi/filter/versioning_extension_test.go similarity index 98% rename from tools/cli/internal/openapi/filter/versioning_extension_test.go rename to tools/foas/openapi/filter/versioning_extension_test.go index bbd1d2ce2a..5de8eead0f 100644 --- a/tools/cli/internal/openapi/filter/versioning_extension_test.go +++ b/tools/foas/openapi/filter/versioning_extension_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/filter/versioning_test.go b/tools/foas/openapi/filter/versioning_test.go similarity index 99% rename from tools/cli/internal/openapi/filter/versioning_test.go rename to tools/foas/openapi/filter/versioning_test.go index 8a0fc6e14f..90c91773be 100644 --- a/tools/cli/internal/openapi/filter/versioning_test.go +++ b/tools/foas/openapi/filter/versioning_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/tools/cli/internal/openapi/mock_oasdiff_result.go b/tools/foas/openapi/mock_oasdiff_result.go similarity index 93% rename from tools/cli/internal/openapi/mock_oasdiff_result.go rename to tools/foas/openapi/mock_oasdiff_result.go index 825b8f1d1b..b971ce3170 100644 --- a/tools/cli/internal/openapi/mock_oasdiff_result.go +++ b/tools/foas/openapi/mock_oasdiff_result.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/mongodb/openapi/tools/cli/internal/openapi (interfaces: DiffGetter) +// Source: github.com/mongodb/openapi/tools/foas/openapi (interfaces: DiffGetter) // // Generated by this command: // -// mockgen -destination=../openapi/mock_oasdiff_result.go -package=openapi github.com/mongodb/openapi/tools/cli/internal/openapi DiffGetter +// mockgen -destination=../openapi/mock_oasdiff_result.go -package=openapi github.com/mongodb/openapi/tools/foas/openapi DiffGetter // // Package openapi is a generated GoMock package. diff --git a/tools/cli/internal/openapi/mock_openapi.go b/tools/foas/openapi/mock_openapi.go similarity index 94% rename from tools/cli/internal/openapi/mock_openapi.go rename to tools/foas/openapi/mock_openapi.go index f41622cd46..70dddcb737 100644 --- a/tools/cli/internal/openapi/mock_openapi.go +++ b/tools/foas/openapi/mock_openapi.go @@ -1,9 +1,9 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/mongodb/openapi/tools/cli/internal/openapi (interfaces: Parser,Merger) +// Source: github.com/mongodb/openapi/tools/foas/openapi (interfaces: Parser,Merger) // // Generated by this command: // -// mockgen -destination=../openapi/mock_openapi.go -package=openapi github.com/mongodb/openapi/tools/cli/internal/openapi Parser,Merger +// mockgen -destination=../openapi/mock_openapi.go -package=openapi github.com/mongodb/openapi/tools/foas/openapi Parser,Merger // // Package openapi is a generated GoMock package. diff --git a/tools/cli/internal/openapi/oasdiff.go b/tools/foas/openapi/oasdiff.go similarity index 99% rename from tools/cli/internal/openapi/oasdiff.go rename to tools/foas/openapi/oasdiff.go index 2c6f8b4475..9f607639ff 100644 --- a/tools/cli/internal/openapi/oasdiff.go +++ b/tools/foas/openapi/oasdiff.go @@ -20,7 +20,7 @@ import ( "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi/errors" + "github.com/mongodb/openapi/tools/foas/openapi/errors" "github.com/oasdiff/oasdiff/diff" "github.com/oasdiff/oasdiff/load" ) diff --git a/tools/cli/internal/openapi/oasdiff_result.go b/tools/foas/openapi/oasdiff_result.go similarity index 97% rename from tools/cli/internal/openapi/oasdiff_result.go rename to tools/foas/openapi/oasdiff_result.go index c3b7d029a4..e6249b9927 100644 --- a/tools/cli/internal/openapi/oasdiff_result.go +++ b/tools/foas/openapi/oasdiff_result.go @@ -14,7 +14,7 @@ package openapi -//go:generate mockgen -destination=../openapi/mock_oasdiff_result.go -package=openapi github.com/mongodb/openapi/tools/cli/internal/openapi DiffGetter +//go:generate mockgen -destination=../openapi/mock_oasdiff_result.go -package=openapi github.com/mongodb/openapi/tools/foas/openapi DiffGetter import ( "github.com/getkin/kin-openapi/openapi3" "github.com/oasdiff/oasdiff/diff" diff --git a/tools/cli/internal/openapi/oasdiff_result_test.go b/tools/foas/openapi/oasdiff_result_test.go similarity index 100% rename from tools/cli/internal/openapi/oasdiff_result_test.go rename to tools/foas/openapi/oasdiff_result_test.go diff --git a/tools/cli/internal/openapi/oasdiff_test.go b/tools/foas/openapi/oasdiff_test.go similarity index 99% rename from tools/cli/internal/openapi/oasdiff_test.go rename to tools/foas/openapi/oasdiff_test.go index 76d3226699..15405e6a6e 100644 --- a/tools/cli/internal/openapi/oasdiff_test.go +++ b/tools/foas/openapi/oasdiff_test.go @@ -19,8 +19,8 @@ import ( "testing" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi/errors" - "github.com/mongodb/openapi/tools/cli/internal/pointer" + "github.com/mongodb/openapi/tools/foas/openapi/errors" + "github.com/mongodb/openapi/tools/foas/pointer" "github.com/oasdiff/oasdiff/diff" "github.com/oasdiff/oasdiff/load" "github.com/stretchr/testify/assert" diff --git a/tools/cli/internal/openapi/openapi.go b/tools/foas/openapi/openapi.go similarity index 98% rename from tools/cli/internal/openapi/openapi.go rename to tools/foas/openapi/openapi.go index 6c5e4b7576..ef6147d05d 100644 --- a/tools/cli/internal/openapi/openapi.go +++ b/tools/foas/openapi/openapi.go @@ -14,7 +14,7 @@ package openapi -//go:generate mockgen -destination=../openapi/mock_openapi.go -package=openapi github.com/mongodb/openapi/tools/cli/internal/openapi Parser,Merger +//go:generate mockgen -destination=../openapi/mock_openapi.go -package=openapi github.com/mongodb/openapi/tools/foas/openapi Parser,Merger import ( "encoding/json" "log" diff --git a/tools/cli/internal/openapi/openapi3.go b/tools/foas/openapi/openapi3.go similarity index 100% rename from tools/cli/internal/openapi/openapi3.go rename to tools/foas/openapi/openapi3.go diff --git a/tools/cli/internal/openapi/openapi3_test.go b/tools/foas/openapi/openapi3_test.go similarity index 100% rename from tools/cli/internal/openapi/openapi3_test.go rename to tools/foas/openapi/openapi3_test.go diff --git a/tools/cli/internal/openapi/openapi_test.go b/tools/foas/openapi/openapi_test.go similarity index 100% rename from tools/cli/internal/openapi/openapi_test.go rename to tools/foas/openapi/openapi_test.go diff --git a/tools/cli/internal/openapi/paths.go b/tools/foas/openapi/paths.go similarity index 100% rename from tools/cli/internal/openapi/paths.go rename to tools/foas/openapi/paths.go diff --git a/tools/cli/internal/openapi/paths_test.go b/tools/foas/openapi/paths_test.go similarity index 100% rename from tools/cli/internal/openapi/paths_test.go rename to tools/foas/openapi/paths_test.go diff --git a/tools/cli/internal/openapi/slice/slice.go b/tools/foas/openapi/slice/slice.go similarity index 97% rename from tools/cli/internal/openapi/slice/slice.go rename to tools/foas/openapi/slice/slice.go index 99056473d4..759742deb1 100644 --- a/tools/cli/internal/openapi/slice/slice.go +++ b/tools/foas/openapi/slice/slice.go @@ -20,7 +20,7 @@ import ( "slices" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/openapi/filter" + "github.com/mongodb/openapi/tools/foas/openapi/filter" ) // Criteria defines the selection criteria for slicing an OpenAPI spec. diff --git a/tools/cli/internal/openapi/slice/slice_test.go b/tools/foas/openapi/slice/slice_test.go similarity index 100% rename from tools/cli/internal/openapi/slice/slice_test.go rename to tools/foas/openapi/slice/slice_test.go diff --git a/tools/cli/internal/openapi/sunset/sunset.go b/tools/foas/openapi/sunset/sunset.go similarity index 100% rename from tools/cli/internal/openapi/sunset/sunset.go rename to tools/foas/openapi/sunset/sunset.go diff --git a/tools/cli/internal/openapi/sunset/sunset_test.go b/tools/foas/openapi/sunset/sunset_test.go similarity index 100% rename from tools/cli/internal/openapi/sunset/sunset_test.go rename to tools/foas/openapi/sunset/sunset_test.go diff --git a/tools/cli/internal/openapi/versions.go b/tools/foas/openapi/versions.go similarity index 96% rename from tools/cli/internal/openapi/versions.go rename to tools/foas/openapi/versions.go index c30b8521e8..368c88eb13 100644 --- a/tools/cli/internal/openapi/versions.go +++ b/tools/foas/openapi/versions.go @@ -21,8 +21,8 @@ import ( "strings" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/cli/internal/apiversion" - "github.com/mongodb/openapi/tools/cli/internal/openapi/filter" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/openapi/filter" ) // ExtractVersionsWithEnv extracts API version Content Type strings from the given OpenAPI specification and environment. diff --git a/tools/cli/internal/openapi/versions_test.go b/tools/foas/openapi/versions_test.go similarity index 100% rename from tools/cli/internal/openapi/versions_test.go rename to tools/foas/openapi/versions_test.go diff --git a/tools/cli/internal/pointer/pointer.go b/tools/foas/pointer/pointer.go similarity index 100% rename from tools/cli/internal/pointer/pointer.go rename to tools/foas/pointer/pointer.go diff --git a/tools/cli/scripts/doc_filters.sh b/tools/foas/scripts/doc_filters.sh similarity index 85% rename from tools/cli/scripts/doc_filters.sh rename to tools/foas/scripts/doc_filters.sh index c6160c8854..483b09613a 100755 --- a/tools/cli/scripts/doc_filters.sh +++ b/tools/foas/scripts/doc_filters.sh @@ -19,4 +19,4 @@ echo " - Filtering per version, so that only the endpoints that are available in echo "## What filters are available?" echo "### List of filters" -grep -n '// .*Filter: .*' internal/openapi/filter/*.go | sort -u -k2 | sed -n "s/\([^0-9]*\):\([0-9]*\):\/\/ \(.*Filter: .*\)/[\3](\.\.\/\1?plain=1#L\2) /p" | sort +grep -n '// .*Filter: .*' openapi/filter/*.go | sort -u -k2 | sed -n "s|openapi/filter/\([^:]*\):\([0-9]*\):// \(.*Filter: .*\)|[\3](./\1?plain=1#L\2) |p" | sort diff --git a/tools/foas/scripts/update_docs.sh b/tools/foas/scripts/update_docs.sh new file mode 100755 index 0000000000..89c01ee43f --- /dev/null +++ b/tools/foas/scripts/update_docs.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -euxo pipefail + +# Update the filters documentation +./scripts/doc_filters.sh > openapi/filter/README.md + +go fmt ./... + +if [ -n "$(git status --porcelain openapi/filter/README.md)" ]; then + git add "openapi/filter/README.md" +fi \ No newline at end of file diff --git a/tools/cli/test/data/apiregistry_spec.json b/tools/foas/test/data/apiregistry_spec.json similarity index 100% rename from tools/cli/test/data/apiregistry_spec.json rename to tools/foas/test/data/apiregistry_spec.json diff --git a/tools/cli/test/data/authn_spec.json b/tools/foas/test/data/authn_spec.json similarity index 100% rename from tools/cli/test/data/authn_spec.json rename to tools/foas/test/data/authn_spec.json diff --git a/tools/cli/test/data/base_spec.json b/tools/foas/test/data/base_spec.json similarity index 100% rename from tools/cli/test/data/base_spec.json rename to tools/foas/test/data/base_spec.json diff --git a/tools/cli/test/data/base_spec_with_mismatching_sunset_dates.json b/tools/foas/test/data/base_spec_with_mismatching_sunset_dates.json similarity index 100% rename from tools/cli/test/data/base_spec_with_mismatching_sunset_dates.json rename to tools/foas/test/data/base_spec_with_mismatching_sunset_dates.json diff --git a/tools/cli/test/data/base_spec_with_multiple_private_and_public_previews.json b/tools/foas/test/data/base_spec_with_multiple_private_and_public_previews.json similarity index 100% rename from tools/cli/test/data/base_spec_with_multiple_private_and_public_previews.json rename to tools/foas/test/data/base_spec_with_multiple_private_and_public_previews.json diff --git a/tools/cli/test/data/base_spec_with_private_preview.json b/tools/foas/test/data/base_spec_with_private_preview.json similarity index 100% rename from tools/cli/test/data/base_spec_with_private_preview.json rename to tools/foas/test/data/base_spec_with_private_preview.json diff --git a/tools/cli/test/data/base_spec_with_public_preview.json b/tools/foas/test/data/base_spec_with_public_preview.json similarity index 100% rename from tools/cli/test/data/base_spec_with_public_preview.json rename to tools/foas/test/data/base_spec_with_public_preview.json diff --git a/tools/cli/test/data/changelog/changelog.json b/tools/foas/test/data/changelog/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/changelog.json rename to tools/foas/test/data/changelog/changelog.json diff --git a/tools/cli/test/data/changelog/manual_generated_test_spec.json b/tools/foas/test/data/changelog/manual_generated_test_spec.json similarity index 100% rename from tools/cli/test/data/changelog/manual_generated_test_spec.json rename to tools/foas/test/data/changelog/manual_generated_test_spec.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/changelog.json b/tools/foas/test/data/changelog/new-api-preview-version/base/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/changelog.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/changelog.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/metadata.json b/tools/foas/test/data/changelog/new-api-preview-version/base/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/metadata.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/metadata.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/base/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/base/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/exemptions.yaml b/tools/foas/test/data/changelog/new-api-preview-version/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/exemptions.yaml rename to tools/foas/test/data/changelog/new-api-preview-version/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-02-01.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-02-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-10-01.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-01-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-10-01.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-02-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-10-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2023-11-15_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/2024-05-30_2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/output/2024-05-30_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/2024-05-30_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/2024-05-30_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/changelog-all.json b/tools/foas/test/data/changelog/new-api-preview-version/output/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/changelog-all.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/changelog-all.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/output/changelog.json b/tools/foas/test/data/changelog/new-api-preview-version/output/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/output/changelog.json rename to tools/foas/test/data/changelog/new-api-preview-version/output/changelog.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/exemptions.yaml b/tools/foas/test/data/changelog/new-api-preview-version/revision/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/exemptions.yaml rename to tools/foas/test/data/changelog/new-api-preview-version/revision/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/metadata.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/metadata.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/metadata.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2024-08-05.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-preview.json b/tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-preview.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-preview-version/revision/openapi-preview.json rename to tools/foas/test/data/changelog/new-api-preview-version/revision/openapi-preview.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/changelog.json b/tools/foas/test/data/changelog/new-api-version/base/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/changelog.json rename to tools/foas/test/data/changelog/new-api-version/base/changelog.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/metadata.json b/tools/foas/test/data/changelog/new-api-version/base/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/metadata.json rename to tools/foas/test/data/changelog/new-api-version/base/metadata.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-api-version/base/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-api-version/base/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-api-version/base/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-api-version/base/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-api-version/base/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-api-version/base/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-api-version/base/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-api-version/base/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-version/base/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/base/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/base/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/base/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/exemptions.yaml b/tools/foas/test/data/changelog/new-api-version/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/exemptions.yaml rename to tools/foas/test/data/changelog/new-api-version/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-02-01.json b/tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-02-01.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-10-01.json b/tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-01-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-01-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2023-10-01.json b/tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-02-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-02-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2023-11-15.json b/tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-10-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-10-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-11-15_2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/output/2023-11-15_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-11-15_2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-11-15_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2023-11-15_2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/output/2023-11-15_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2023-11-15_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/output/2023-11-15_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/2024-05-30_2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/output/2024-05-30_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/2024-05-30_2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/output/2024-05-30_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/changelog-all.json b/tools/foas/test/data/changelog/new-api-version/output/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/changelog-all.json rename to tools/foas/test/data/changelog/new-api-version/output/changelog-all.json diff --git a/tools/cli/test/data/changelog/new-api-version/output/changelog.json b/tools/foas/test/data/changelog/new-api-version/output/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/output/changelog.json rename to tools/foas/test/data/changelog/new-api-version/output/changelog.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/exemptions.yaml b/tools/foas/test/data/changelog/new-api-version/revision/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/exemptions.yaml rename to tools/foas/test/data/changelog/new-api-version/revision/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-api-version/revision/metadata.json b/tools/foas/test/data/changelog/new-api-version/revision/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/metadata.json rename to tools/foas/test/data/changelog/new-api-version/revision/metadata.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-api-version/revision/openapi-2024-08-05.json b/tools/foas/test/data/changelog/new-api-version/revision/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-api-version/revision/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/new-api-version/revision/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/changelog-all.json b/tools/foas/test/data/changelog/new-upcoming-version/base/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/changelog-all.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/changelog-all.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/changelog.json b/tools/foas/test/data/changelog/new-upcoming-version/base/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/changelog.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/changelog.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/metadata.json b/tools/foas/test/data/changelog/new-upcoming-version/base/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/metadata.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/metadata.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-04-23.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-04-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-04-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-04-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2043-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2043-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-2043-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-2043-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/base/openapi-preview.json b/tools/foas/test/data/changelog/new-upcoming-version/base/openapi-preview.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/base/openapi-preview.json rename to tools/foas/test/data/changelog/new-upcoming-version/base/openapi-preview.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/exemptions.yaml b/tools/foas/test/data/changelog/new-upcoming-version/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/exemptions.yaml rename to tools/foas/test/data/changelog/new-upcoming-version/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-02-01.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-02-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-10-01.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-11-15.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-01-01_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-10-01.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-10-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-11-15.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-02-01_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2023-11-15.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2023-11-15.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-10-01_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2023-11-15_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-05-30_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-08-05_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-10-23_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2024-11-13_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2025-02-19_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/2025-03-12_2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/output/2025-03-12_2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/2025-03-12_2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/2025-03-12_2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/changelog-all.json b/tools/foas/test/data/changelog/new-upcoming-version/output/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/changelog-all.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/changelog-all.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/output/changelog.json b/tools/foas/test/data/changelog/new-upcoming-version/output/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/output/changelog.json rename to tools/foas/test/data/changelog/new-upcoming-version/output/changelog.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/exemptions.yaml b/tools/foas/test/data/changelog/new-upcoming-version/revision/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/exemptions.yaml rename to tools/foas/test/data/changelog/new-upcoming-version/revision/exemptions.yaml diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/metadata.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/metadata.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/metadata.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-02-01.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-10-01.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-11-15.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-05-30.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-08-05.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-10-23.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-10-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-10-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-10-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-11-13.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-11-13.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2024-11-13.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2024-11-13.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-02-19.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-02-19.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-02-19.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-02-19.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-03-12.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-03-12.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-03-12.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-03-12.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-04-23.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-04-23.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-04-23.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-04-23.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-09-22.upcoming.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-09-22.upcoming.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2025-09-22.upcoming.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2025-09-22.upcoming.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2043-01-01.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2043-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-2043-01-01.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-2043-01-01.json diff --git a/tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-preview.json b/tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-preview.json similarity index 100% rename from tools/cli/test/data/changelog/new-upcoming-version/revision/openapi-preview.json rename to tools/foas/test/data/changelog/new-upcoming-version/revision/openapi-preview.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/changelog.json b/tools/foas/test/data/changelog/rename-api-version/base/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/changelog.json rename to tools/foas/test/data/changelog/rename-api-version/base/changelog.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/metadata.json b/tools/foas/test/data/changelog/rename-api-version/base/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/metadata.json rename to tools/foas/test/data/changelog/rename-api-version/base/metadata.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-01-01.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-02-01.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-10-01.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-11-15.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/base/openapi-2043-01-01.json b/tools/foas/test/data/changelog/rename-api-version/base/openapi-2043-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/base/openapi-2043-01-01.json rename to tools/foas/test/data/changelog/rename-api-version/base/openapi-2043-01-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/exemptions.yaml b/tools/foas/test/data/changelog/rename-api-version/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/exemptions.yaml rename to tools/foas/test/data/changelog/rename-api-version/exemptions.yaml diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-02-01.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-02-01.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-02-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-10-01.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-10-01.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-11-15.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2023-11-15.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-01-01_2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-01-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2023-10-01.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2023-10-01.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2023-11-15.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2023-11-15.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-02-01_2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-02-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2023-11-15.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2023-11-15.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-10-01_2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-10-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-11-15_2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-11-15_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-11-15_2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-11-15_2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2023-11-15_2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/output/2023-11-15_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2023-11-15_2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/output/2023-11-15_2024-08-05.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/2024-05-30_2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/output/2024-05-30_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/2024-05-30_2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/output/2024-05-30_2024-08-05.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/changelog-all.json b/tools/foas/test/data/changelog/rename-api-version/output/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/changelog-all.json rename to tools/foas/test/data/changelog/rename-api-version/output/changelog-all.json diff --git a/tools/cli/test/data/changelog/rename-api-version/output/changelog.json b/tools/foas/test/data/changelog/rename-api-version/output/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/output/changelog.json rename to tools/foas/test/data/changelog/rename-api-version/output/changelog.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/exemptions.yaml b/tools/foas/test/data/changelog/rename-api-version/revision/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/exemptions.yaml rename to tools/foas/test/data/changelog/rename-api-version/revision/exemptions.yaml diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/metadata.json b/tools/foas/test/data/changelog/rename-api-version/revision/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/metadata.json rename to tools/foas/test/data/changelog/rename-api-version/revision/metadata.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-01-01.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-02-01.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-10-01.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-11-15.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2024-05-30.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/rename-api-version/revision/openapi-2024-08-05.json b/tools/foas/test/data/changelog/rename-api-version/revision/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/rename-api-version/revision/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/rename-api-version/revision/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/changelog.json b/tools/foas/test/data/changelog/same-api-version/base/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/changelog.json rename to tools/foas/test/data/changelog/same-api-version/base/changelog.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/metadata.json b/tools/foas/test/data/changelog/same-api-version/base/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/metadata.json rename to tools/foas/test/data/changelog/same-api-version/base/metadata.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2023-01-01.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2023-02-01.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2023-10-01.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2023-11-15.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/base/openapi-2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/base/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/base/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/base/openapi-2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/exemptions.yaml b/tools/foas/test/data/changelog/same-api-version/exemptions.yaml similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/exemptions.yaml rename to tools/foas/test/data/changelog/same-api-version/exemptions.yaml diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-02-01.json b/tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-02-01.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-02-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-10-01.json b/tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-10-01.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-11-15.json b/tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2023-11-15.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-01-01_2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-01-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2023-10-01.json b/tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2023-10-01.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2023-10-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2023-11-15.json b/tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2023-11-15.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-02-01_2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-02-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2023-11-15.json b/tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2023-11-15.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2023-11-15.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-10-01_2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-10-01_2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-11-15_2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/output/2023-11-15_2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-11-15_2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-11-15_2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2023-11-15_2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/output/2023-11-15_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2023-11-15_2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/output/2023-11-15_2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/2024-05-30_2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/output/2024-05-30_2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/2024-05-30_2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/output/2024-05-30_2024-08-05.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/changelog-all.json b/tools/foas/test/data/changelog/same-api-version/output/changelog-all.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/changelog-all.json rename to tools/foas/test/data/changelog/same-api-version/output/changelog-all.json diff --git a/tools/cli/test/data/changelog/same-api-version/output/changelog.json b/tools/foas/test/data/changelog/same-api-version/output/changelog.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/output/changelog.json rename to tools/foas/test/data/changelog/same-api-version/output/changelog.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/metadata.json b/tools/foas/test/data/changelog/same-api-version/revision/metadata.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/metadata.json rename to tools/foas/test/data/changelog/same-api-version/revision/metadata.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-01-01.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-01-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-01-01.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-01-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-02-01.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-02-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-02-01.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-02-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-10-01.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-10-01.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-10-01.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-10-01.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-11-15.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-11-15.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2023-11-15.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2023-11-15.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2024-05-30.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2024-05-30.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2024-05-30.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2024-05-30.json diff --git a/tools/cli/test/data/changelog/same-api-version/revision/openapi-2024-08-05.json b/tools/foas/test/data/changelog/same-api-version/revision/openapi-2024-08-05.json similarity index 100% rename from tools/cli/test/data/changelog/same-api-version/revision/openapi-2024-08-05.json rename to tools/foas/test/data/changelog/same-api-version/revision/openapi-2024-08-05.json diff --git a/tools/cli/test/data/duplicated_path_apiregistry_spec.json b/tools/foas/test/data/duplicated_path_apiregistry_spec.json similarity index 100% rename from tools/cli/test/data/duplicated_path_apiregistry_spec.json rename to tools/foas/test/data/duplicated_path_apiregistry_spec.json diff --git a/tools/cli/test/data/duplicated_tag_authn_spec.json b/tools/foas/test/data/duplicated_tag_authn_spec.json similarity index 100% rename from tools/cli/test/data/duplicated_tag_authn_spec.json rename to tools/foas/test/data/duplicated_tag_authn_spec.json diff --git a/tools/cli/test/data/exemptions/invalid_exemptions.yaml b/tools/foas/test/data/exemptions/invalid_exemptions.yaml similarity index 100% rename from tools/cli/test/data/exemptions/invalid_exemptions.yaml rename to tools/foas/test/data/exemptions/invalid_exemptions.yaml diff --git a/tools/cli/test/data/exemptions/test_exemptions_expired.yaml b/tools/foas/test/data/exemptions/test_exemptions_expired.yaml similarity index 100% rename from tools/cli/test/data/exemptions/test_exemptions_expired.yaml rename to tools/foas/test/data/exemptions/test_exemptions_expired.yaml diff --git a/tools/cli/test/data/exemptions/test_exemptions_schema.yaml b/tools/foas/test/data/exemptions/test_exemptions_schema.yaml similarity index 100% rename from tools/cli/test/data/exemptions/test_exemptions_schema.yaml rename to tools/foas/test/data/exemptions/test_exemptions_schema.yaml diff --git a/tools/cli/test/data/exemptions/test_exemptions_v2_duplication.yaml b/tools/foas/test/data/exemptions/test_exemptions_v2_duplication.yaml similarity index 100% rename from tools/cli/test/data/exemptions/test_exemptions_v2_duplication.yaml rename to tools/foas/test/data/exemptions/test_exemptions_v2_duplication.yaml diff --git a/tools/cli/test/data/exemptions/valid_exemptions.yaml b/tools/foas/test/data/exemptions/valid_exemptions.yaml similarity index 100% rename from tools/cli/test/data/exemptions/valid_exemptions.yaml rename to tools/foas/test/data/exemptions/valid_exemptions.yaml diff --git a/tools/cli/test/data/not_identical_component_apiregistry_spec.json b/tools/foas/test/data/not_identical_component_apiregistry_spec.json similarity index 100% rename from tools/cli/test/data/not_identical_component_apiregistry_spec.json rename to tools/foas/test/data/not_identical_component_apiregistry_spec.json diff --git a/tools/cli/test/data/openapi-foas-dev.json b/tools/foas/test/data/openapi-foas-dev.json similarity index 100% rename from tools/cli/test/data/openapi-foas-dev.json rename to tools/foas/test/data/openapi-foas-dev.json diff --git a/tools/cli/test/data/openapi-foas-dev.yaml b/tools/foas/test/data/openapi-foas-dev.yaml similarity index 100% rename from tools/cli/test/data/openapi-foas-dev.yaml rename to tools/foas/test/data/openapi-foas-dev.yaml diff --git a/tools/cli/test/data/openapi_with_upcoming.json b/tools/foas/test/data/openapi_with_upcoming.json similarity index 100% rename from tools/cli/test/data/openapi_with_upcoming.json rename to tools/foas/test/data/openapi_with_upcoming.json diff --git a/tools/cli/test/data/split/dev/README.md b/tools/foas/test/data/split/dev/README.md similarity index 100% rename from tools/cli/test/data/split/dev/README.md rename to tools/foas/test/data/split/dev/README.md diff --git a/tools/cli/test/data/split/dev/openapi-api-registry.json b/tools/foas/test/data/split/dev/openapi-api-registry.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-api-registry.json rename to tools/foas/test/data/split/dev/openapi-api-registry.json diff --git a/tools/cli/test/data/split/dev/openapi-mms.json b/tools/foas/test/data/split/dev/openapi-mms.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-mms.json rename to tools/foas/test/data/split/dev/openapi-mms.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.json b/tools/foas/test/data/split/dev/openapi-v2-2023-01-01.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-01-01.json rename to tools/foas/test/data/split/dev/openapi-v2-2023-01-01.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-01-01.yaml b/tools/foas/test/data/split/dev/openapi-v2-2023-01-01.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-01-01.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2023-01-01.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.json b/tools/foas/test/data/split/dev/openapi-v2-2023-02-01.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-02-01.json rename to tools/foas/test/data/split/dev/openapi-v2-2023-02-01.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-02-01.yaml b/tools/foas/test/data/split/dev/openapi-v2-2023-02-01.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-02-01.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2023-02-01.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.json b/tools/foas/test/data/split/dev/openapi-v2-2023-10-01.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-10-01.json rename to tools/foas/test/data/split/dev/openapi-v2-2023-10-01.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-10-01.yaml b/tools/foas/test/data/split/dev/openapi-v2-2023-10-01.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-10-01.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2023-10-01.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.json b/tools/foas/test/data/split/dev/openapi-v2-2023-11-15.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-11-15.json rename to tools/foas/test/data/split/dev/openapi-v2-2023-11-15.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2023-11-15.yaml b/tools/foas/test/data/split/dev/openapi-v2-2023-11-15.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2023-11-15.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2023-11-15.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.json b/tools/foas/test/data/split/dev/openapi-v2-2024-05-30.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2024-05-30.json rename to tools/foas/test/data/split/dev/openapi-v2-2024-05-30.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-05-30.yaml b/tools/foas/test/data/split/dev/openapi-v2-2024-05-30.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2024-05-30.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2024-05-30.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.json b/tools/foas/test/data/split/dev/openapi-v2-2024-08-05.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2024-08-05.json rename to tools/foas/test/data/split/dev/openapi-v2-2024-08-05.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2024-08-05.yaml b/tools/foas/test/data/split/dev/openapi-v2-2024-08-05.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2024-08-05.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2024-08-05.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json b/tools/foas/test/data/split/dev/openapi-v2-2025-01-01.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json rename to tools/foas/test/data/split/dev/openapi-v2-2025-01-01.json diff --git a/tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml b/tools/foas/test/data/split/dev/openapi-v2-2025-01-01.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml rename to tools/foas/test/data/split/dev/openapi-v2-2025-01-01.yaml diff --git a/tools/cli/test/data/split/dev/openapi-v2.json b/tools/foas/test/data/split/dev/openapi-v2.json similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2.json rename to tools/foas/test/data/split/dev/openapi-v2.json diff --git a/tools/cli/test/data/split/dev/openapi-v2.yaml b/tools/foas/test/data/split/dev/openapi-v2.yaml similarity index 100% rename from tools/cli/test/data/split/dev/openapi-v2.yaml rename to tools/foas/test/data/split/dev/openapi-v2.yaml diff --git a/tools/cli/test/data/split/download_specs.sh b/tools/foas/test/data/split/download_specs.sh similarity index 100% rename from tools/cli/test/data/split/download_specs.sh rename to tools/foas/test/data/split/download_specs.sh diff --git a/tools/cli/test/data/split/prod/README.md b/tools/foas/test/data/split/prod/README.md similarity index 100% rename from tools/cli/test/data/split/prod/README.md rename to tools/foas/test/data/split/prod/README.md diff --git a/tools/cli/test/data/split/prod/openapi-api-registry.json b/tools/foas/test/data/split/prod/openapi-api-registry.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-api-registry.json rename to tools/foas/test/data/split/prod/openapi-api-registry.json diff --git a/tools/cli/test/data/split/prod/openapi-mms.json b/tools/foas/test/data/split/prod/openapi-mms.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-mms.json rename to tools/foas/test/data/split/prod/openapi-mms.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-01-01.json b/tools/foas/test/data/split/prod/openapi-v2-2023-01-01.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-01-01.json rename to tools/foas/test/data/split/prod/openapi-v2-2023-01-01.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-01-01.yaml b/tools/foas/test/data/split/prod/openapi-v2-2023-01-01.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-01-01.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2023-01-01.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-02-01.json b/tools/foas/test/data/split/prod/openapi-v2-2023-02-01.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-02-01.json rename to tools/foas/test/data/split/prod/openapi-v2-2023-02-01.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-02-01.yaml b/tools/foas/test/data/split/prod/openapi-v2-2023-02-01.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-02-01.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2023-02-01.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-10-01.json b/tools/foas/test/data/split/prod/openapi-v2-2023-10-01.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-10-01.json rename to tools/foas/test/data/split/prod/openapi-v2-2023-10-01.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-10-01.yaml b/tools/foas/test/data/split/prod/openapi-v2-2023-10-01.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-10-01.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2023-10-01.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-11-15.json b/tools/foas/test/data/split/prod/openapi-v2-2023-11-15.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-11-15.json rename to tools/foas/test/data/split/prod/openapi-v2-2023-11-15.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2023-11-15.yaml b/tools/foas/test/data/split/prod/openapi-v2-2023-11-15.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2023-11-15.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2023-11-15.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2-2024-05-30.json b/tools/foas/test/data/split/prod/openapi-v2-2024-05-30.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2024-05-30.json rename to tools/foas/test/data/split/prod/openapi-v2-2024-05-30.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2024-05-30.yaml b/tools/foas/test/data/split/prod/openapi-v2-2024-05-30.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2024-05-30.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2024-05-30.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2-2024-08-05.json b/tools/foas/test/data/split/prod/openapi-v2-2024-08-05.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2024-08-05.json rename to tools/foas/test/data/split/prod/openapi-v2-2024-08-05.json diff --git a/tools/cli/test/data/split/prod/openapi-v2-2024-08-05.yaml b/tools/foas/test/data/split/prod/openapi-v2-2024-08-05.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2-2024-08-05.yaml rename to tools/foas/test/data/split/prod/openapi-v2-2024-08-05.yaml diff --git a/tools/cli/test/data/split/prod/openapi-v2.json b/tools/foas/test/data/split/prod/openapi-v2.json similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2.json rename to tools/foas/test/data/split/prod/openapi-v2.json diff --git a/tools/cli/test/data/split/prod/openapi-v2.yaml b/tools/foas/test/data/split/prod/openapi-v2.yaml similarity index 100% rename from tools/cli/test/data/split/prod/openapi-v2.yaml rename to tools/foas/test/data/split/prod/openapi-v2.yaml From 8555c64c49ca08d52152182fcf70e354fabea8e2 Mon Sep 17 00:00:00 2001 From: Yeliz Henden Date: Wed, 27 May 2026 16:40:33 +0100 Subject: [PATCH 2/5] fix: gci import grouping, exclude e2e from unit-test, restore exemptions fixture - Reorder imports in 7 cli files to satisfy gci [standard, default] grouping - Exclude ./test/e2e from `make unit-test` (e2e needs the built binary; `make e2e-test` covers it separately) - Restore tools/foas/test/data/exemptions/exemptions.txt as tracked fixture (it's input for TestParseCommand, not test output) --- .gitignore | 1 - tools/cli/Makefile | 4 ++-- tools/cli/breakingchanges/exemptions/parse.go | 2 +- tools/cli/changelog/convert/slack.go | 2 +- tools/cli/changelog/create.go | 2 +- tools/cli/changelog/metadata/create.go | 4 ++-- tools/cli/filter/filter.go | 2 +- tools/cli/root/openapi/builder.go | 2 +- tools/cli/versions/versions.go | 2 +- tools/foas/test/data/exemptions/exemptions.txt | 5 +++++ 10 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 tools/foas/test/data/exemptions/exemptions.txt diff --git a/.gitignore b/.gitignore index 61fe8f23c5..4beb6a796f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ /tools/*/tmp/* /tools/cli/test/e2e/cli/output/** !/tools/cli/test/e2e/cli/output/.gitkeep -/tools/foas/test/data/exemptions/exemptions.txt /tools/*/dist/* /tools/*/output/* # We don't want to commit env variables diff --git a/tools/cli/Makefile b/tools/cli/Makefile index e8f1bc1b14..b3fcf38dd9 100644 --- a/tools/cli/Makefile +++ b/tools/cli/Makefile @@ -75,9 +75,9 @@ e2e-test: build ## Run E2E tests $(TEST_CMD) -v -p 1 -parallel $(E2E_PARALLEL) -timeout $(E2E_TIMEOUT) ./test/e2e... $(E2E_EXTRA_ARGS) .PHONY: unit-test -unit-test: ## Run unit-tests +unit-test: ## Run unit-tests (excludes ./test/e2e — see e2e-test target) @echo "==> Running unit tests..." - $(TEST_CMD) -race -cover ./... + $(TEST_CMD) -race -cover $$(go list ./... | grep -v '/test/e2e') .PHONY: gen-mocks gen-mocks: ## Generate mocks diff --git a/tools/cli/breakingchanges/exemptions/parse.go b/tools/cli/breakingchanges/exemptions/parse.go index 2cb94fa8a9..ab49cb7a46 100644 --- a/tools/cli/breakingchanges/exemptions/parse.go +++ b/tools/cli/breakingchanges/exemptions/parse.go @@ -17,9 +17,9 @@ package exemptions import ( "errors" - "github.com/mongodb/openapi/tools/foas/breakingchanges" "github.com/mongodb/openapi/tools/cli/flag" "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/breakingchanges" "github.com/spf13/afero" "github.com/spf13/cobra" ) diff --git a/tools/cli/changelog/convert/slack.go b/tools/cli/changelog/convert/slack.go index a76775c4e5..79c3e0c33b 100644 --- a/tools/cli/changelog/convert/slack.go +++ b/tools/cli/changelog/convert/slack.go @@ -20,9 +20,9 @@ import ( "sort" "strconv" - "github.com/mongodb/openapi/tools/foas/changelog" "github.com/mongodb/openapi/tools/cli/flag" "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/changelog" "github.com/spf13/cobra" ) diff --git a/tools/cli/changelog/create.go b/tools/cli/changelog/create.go index 911f5c9b82..059de83ca2 100644 --- a/tools/cli/changelog/create.go +++ b/tools/cli/changelog/create.go @@ -19,9 +19,9 @@ import ( "log" "time" - "github.com/mongodb/openapi/tools/foas/changelog" "github.com/mongodb/openapi/tools/cli/flag" "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/changelog" "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" diff --git a/tools/cli/changelog/metadata/create.go b/tools/cli/changelog/metadata/create.go index 398fd5bbfe..dfe5906efb 100644 --- a/tools/cli/changelog/metadata/create.go +++ b/tools/cli/changelog/metadata/create.go @@ -19,10 +19,10 @@ import ( "fmt" "time" - "github.com/mongodb/openapi/tools/foas/apiversion" - "github.com/mongodb/openapi/tools/foas/changelog" "github.com/mongodb/openapi/tools/cli/flag" "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/apiversion" + "github.com/mongodb/openapi/tools/foas/changelog" "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" diff --git a/tools/cli/filter/filter.go b/tools/cli/filter/filter.go index 12a32a5a64..0094e32c0c 100644 --- a/tools/cli/filter/filter.go +++ b/tools/cli/filter/filter.go @@ -19,9 +19,9 @@ import ( "log" "github.com/getkin/kin-openapi/openapi3" - "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/mongodb/openapi/tools/cli/flag" "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/mongodb/openapi/tools/foas/openapi" "github.com/mongodb/openapi/tools/foas/openapi/filter" "github.com/spf13/afero" diff --git a/tools/cli/root/openapi/builder.go b/tools/cli/root/openapi/builder.go index df14e9a2f4..ca1309325d 100644 --- a/tools/cli/root/openapi/builder.go +++ b/tools/cli/root/openapi/builder.go @@ -25,8 +25,8 @@ import ( "github.com/mongodb/openapi/tools/cli/slice" "github.com/mongodb/openapi/tools/cli/split" "github.com/mongodb/openapi/tools/cli/sunset" - "github.com/mongodb/openapi/tools/cli/versions" "github.com/mongodb/openapi/tools/cli/version" + "github.com/mongodb/openapi/tools/cli/versions" "github.com/spf13/cobra" ) diff --git a/tools/cli/versions/versions.go b/tools/cli/versions/versions.go index 48cdb9880c..1b542e48d8 100644 --- a/tools/cli/versions/versions.go +++ b/tools/cli/versions/versions.go @@ -20,9 +20,9 @@ import ( "fmt" "strings" - "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/mongodb/openapi/tools/cli/flag" "github.com/mongodb/openapi/tools/cli/usage" + "github.com/mongodb/openapi/tools/foas/apiversion" "github.com/mongodb/openapi/tools/foas/openapi" "github.com/spf13/afero" "github.com/spf13/cobra" diff --git a/tools/foas/test/data/exemptions/exemptions.txt b/tools/foas/test/data/exemptions/exemptions.txt new file mode 100644 index 0000000000..16da4cd26b --- /dev/null +++ b/tools/foas/test/data/exemptions/exemptions.txt @@ -0,0 +1,5 @@ +in components removed the schema 'GroupName' [api-schema-removed] +GET /api/atlas/v2/groups/{groupId}/clusters/provider/regions removed the 'GSP' enum value from the 'results/items/provider' response property for the response status '200' [response-property-enum-value-removed]. +GET /api/atlas/v1.0/groups/{groupId}/clusters/provider/regions removed the 'GSP' enum value from the 'results/items/provider' response property for the response status '200' [response-property-enum-value-removed]. +GET /api/atlas/v1.5/groups/{groupId}/clusters/provider/regions removed the 'GSP' enum value from the 'results/items/provider' response property for the response status '200' [response-property-enum-value-removed]. +GET /api/atlas/v1.0/groups/{groupId}/clusters/provider/regions removed the 'GSP' enum value from the 'results/items/provider' response property for the response status '200' [response-property-enum-value-removed]. From 94ad366005da385f18f195dd9d5677dc011212ca Mon Sep 17 00:00:00 2001 From: Yeliz Henden Date: Wed, 27 May 2026 16:52:26 +0100 Subject: [PATCH 3/5] docs(release): document three-tag release flow; clean up vestigial GOWORK - release-cli.yml: expand the docstring to describe the three-tag flow (vX.Y.Z + tools/foas/vX.Y.Z + tools/cli/vX.Y.Z) and remove the now-vestigial GOWORK=off env (tools/go.work no longer exists). - RELEASING.md: drop the stale `cd tools/foas` line and add a "What the workflow does" section explaining the three tags. --- .github/workflows/release-cli.yml | 5 +++-- tools/cli/RELEASING.md | 11 ++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 4a528d19e1..9cdbcc5c96 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -1,7 +1,9 @@ name: 'FOASCLI New Release' run-name: 'Release ${{ inputs.version_number }} (skip tests: ${{ inputs.skip_tests }}, use existing tag: ${{ inputs.use_existing_tag}})' -# Used for creating a new release. This workflow will run qa acceptance tests, create a new tag, and generate the release with GoReleaser. +# Used for creating a new release. This workflow runs QA acceptance tests, creates three tags +# (vX.Y.Z for the binary release plus tools/foas/vX.Y.Z and tools/cli/vX.Y.Z Go submodule tags), +# and publishes the foascli binary with GoReleaser. on: workflow_dispatch: inputs: @@ -85,7 +87,6 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GOWORK: off failure-handler: name: Failure Handler diff --git a/tools/cli/RELEASING.md b/tools/cli/RELEASING.md index 66841820dc..eaaa1287a9 100644 --- a/tools/cli/RELEASING.md +++ b/tools/cli/RELEASING.md @@ -10,7 +10,16 @@ - Using [GitHub CLI](https://cli.github.com/), run the command ```bash -cd tools/foas # Make sure to update version_number with the release version gh workflow run release-cli.yml -f version_number=vX.Y.Z -f skip_tests=false -f use_existing_tag=false ``` + +## What the workflow does + +1. Validates the version number format. +2. Creates three tags pointing at the release commit: + - `vX.Y.Z` — used by GoReleaser to publish the foascli binary and archives (`mongodb-foas-cli_*.tar.gz`). + - `tools/foas/vX.Y.Z` — Go submodule tag for the library module; external consumers (e.g. mcp-server in `mongodb-labs/oasis`) pin this. + - `tools/cli/vX.Y.Z` — Go submodule tag for the binary module (informational; rarely imported). +3. Runs the QA test suite (`code-health-foascli.yml`) against both modules unless `skip_tests=true`. +4. Runs GoReleaser in `tools/cli/` to build and publish the binary archives to GitHub Releases. From 54c852e7c9c677aca97c26f1b62d18a8ffc517cf Mon Sep 17 00:00:00 2001 From: Yeliz Henden Date: Wed, 27 May 2026 17:08:55 +0100 Subject: [PATCH 4/5] split code-health and release workflows per module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - code-health-foas.yml: library only, triggered by tools/foas/** changes - code-health-cli.yml: binary + e2e, triggered by tools/cli/** or tools/foas/** - release-foas.yml: library tag-only release (tools/foas/vX.Y.Z), QA-gated - release-cli.yml: binary release only — no longer pushes tools/foas/vX.Y.Z - delete code-health-foascli.yml (replaced by the two split workflows) - add tools/foas/RELEASING.md; expand tools/cli/RELEASING.md with when-to-bump guidance --- ...health-foascli.yml => code-health-cli.yml} | 74 ++++++------------- .github/workflows/code-health-foas.yml | 69 +++++++++++++++++ .github/workflows/release-cli.yml | 16 ++-- .github/workflows/release-foas.yml | 63 ++++++++++++++++ tools/cli/RELEASING.md | 15 +++- tools/foas/RELEASING.md | 28 +++++++ 6 files changed, 198 insertions(+), 67 deletions(-) rename .github/workflows/{code-health-foascli.yml => code-health-cli.yml} (52%) create mode 100644 .github/workflows/code-health-foas.yml create mode 100644 .github/workflows/release-foas.yml create mode 100644 tools/foas/RELEASING.md diff --git a/.github/workflows/code-health-foascli.yml b/.github/workflows/code-health-cli.yml similarity index 52% rename from .github/workflows/code-health-foascli.yml rename to .github/workflows/code-health-cli.yml index 83eb5fd88e..26770af50f 100644 --- a/.github/workflows/code-health-foascli.yml +++ b/.github/workflows/code-health-cli.yml @@ -1,19 +1,22 @@ -name: 'Code Health FoasCLI' +name: 'Code Health CLI' +# Triggered by changes to either `tools/cli/**` or `tools/foas/**`, because the +# binary depends on the library via a local `replace ../foas` directive — library +# changes can break the binary, so we re-test the binary whenever foas changes. on: push: branches: - main paths: - - 'tools/foas/**' - 'tools/cli/**' - - '.github/workflows/code-health-foascli.yml' + - 'tools/foas/**' + - '.github/workflows/code-health-cli.yml' pull_request: branches: - main paths: - - 'tools/foas/**' - 'tools/cli/**' - - '.github/workflows/code-health-foascli.yml' + - 'tools/foas/**' + - '.github/workflows/code-health-cli.yml' workflow_dispatch: {} workflow_call: {} @@ -23,31 +26,22 @@ permissions: jobs: build: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - module: [foas, cli] steps: - - name: Checkout CLI - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - - name: Install Go - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c - with: - go-version-file: 'tools/${{ matrix.module }}/go.mod' - - name: Build - working-directory: tools/${{ matrix.module }} - run: make build + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Install Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c + with: + go-version-file: 'tools/cli/go.mod' + - name: Build + working-directory: tools/cli + run: make build unit-tests: needs: build - env: - COVERAGE: coverage.out - UNIT_TAGS: unit - INTEGRATION_TAGS: integration strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - module: [foas, cli] runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -55,16 +49,12 @@ jobs: - name: Install Go uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c with: - go-version-file: 'tools/${{ matrix.module }}/go.mod' + go-version-file: 'tools/cli/go.mod' - name: Run unit tests - working-directory: tools/${{ matrix.module }} + working-directory: tools/cli run: make unit-test lint: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - module: [foas, cli] steps: - name: Checkout uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd @@ -75,35 +65,13 @@ jobs: - name: Install Go uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c with: - go-version-file: 'tools/${{ matrix.module }}/go.mod' + go-version-file: 'tools/cli/go.mod' cache: false # see https://github.com/golangci/golangci-lint-action/issues/807 - name: golangci-lint uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee with: version: v2.10.1 - working-directory: tools/${{ matrix.module }} - actionlint: - runs-on: ubuntu-latest - steps: - - name: Checkout GitHub actions - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - with: - sparse-checkout: | - .github - - name: Setup Node - uses: actions/setup-node@v6 - with: - node-version: '20.x' - cache: 'npm' - - name: Download actionlint - id: get_actionlint - run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) - shell: bash - - name: Check workflow files - run: | - echo "::add-matcher::.github/actionlint-matcher.json" - ${{ steps.get_actionlint.outputs.executable }} -color - shell: bash + working-directory: tools/cli e2e-tests: needs: build runs-on: ubuntu-latest diff --git a/.github/workflows/code-health-foas.yml b/.github/workflows/code-health-foas.yml new file mode 100644 index 0000000000..1f7897aef4 --- /dev/null +++ b/.github/workflows/code-health-foas.yml @@ -0,0 +1,69 @@ +name: 'Code Health FOAS' +on: + push: + branches: + - main + paths: + - 'tools/foas/**' + - '.github/workflows/code-health-foas.yml' + pull_request: + branches: + - main + paths: + - 'tools/foas/**' + - '.github/workflows/code-health-foas.yml' + workflow_dispatch: {} + workflow_call: {} + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Install Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c + with: + go-version-file: 'tools/foas/go.mod' + - name: Build + working-directory: tools/foas + run: make build + unit-tests: + needs: build + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Install Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c + with: + go-version-file: 'tools/foas/go.mod' + - name: Run unit tests + working-directory: tools/foas + run: make unit-test + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + sparse-checkout: | + .github + tools/foas + - name: Install Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c + with: + go-version-file: 'tools/foas/go.mod' + cache: false # see https://github.com/golangci/golangci-lint-action/issues/807 + - name: golangci-lint + uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee + with: + version: v2.10.1 + working-directory: tools/foas diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 9cdbcc5c96..991febe08f 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -1,9 +1,10 @@ name: 'FOASCLI New Release' run-name: 'Release ${{ inputs.version_number }} (skip tests: ${{ inputs.skip_tests }}, use existing tag: ${{ inputs.use_existing_tag}})' -# Used for creating a new release. This workflow runs QA acceptance tests, creates three tags -# (vX.Y.Z for the binary release plus tools/foas/vX.Y.Z and tools/cli/vX.Y.Z Go submodule tags), -# and publishes the foascli binary with GoReleaser. +# Used for releasing the foascli binary. Creates two tags (vX.Y.Z for the binary +# release plus tools/cli/vX.Y.Z Go submodule tag), runs QA acceptance tests, and +# publishes the foascli binary with GoReleaser. Library releases are handled +# separately by release-foas.yml. on: workflow_dispatch: inputs: @@ -39,13 +40,6 @@ jobs: commit_sha: ${{ steps.get-sha.outputs.sha }} gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} gpg_passphrase: ${{ secrets.PASSPHRASE }} - - name: Create Go submodule tag for tools/foas - uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 - with: - tag: tools/foas/${{ inputs.version_number }} - commit_sha: ${{ steps.get-sha.outputs.sha }} - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.PASSPHRASE }} - name: Create Go submodule tag for tools/cli uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 with: @@ -61,7 +55,7 @@ jobs: && !contains(needs.*.result, 'failure') && inputs.skip_tests == 'false' secrets: inherit - uses: ./.github/workflows/code-health-foascli.yml + uses: ./.github/workflows/code-health-cli.yml release: runs-on: ubuntu-latest diff --git a/.github/workflows/release-foas.yml b/.github/workflows/release-foas.yml new file mode 100644 index 0000000000..338ac9aaf2 --- /dev/null +++ b/.github/workflows/release-foas.yml @@ -0,0 +1,63 @@ +name: 'FOAS Library New Release' +run-name: 'Release tools/foas/${{ inputs.version_number }} (skip tests: ${{ inputs.skip_tests }}, use existing tag: ${{ inputs.use_existing_tag }})' + +# Used for releasing the tools/foas Go library module. Creates a single tag +# `tools/foas/vX.Y.Z` so external Go consumers (e.g. mcp-server in +# `mongodb-labs/oasis`) can pin the library at a stable version. No binary +# is produced — see release-cli.yml for the foascli binary release. +on: + workflow_dispatch: + inputs: + version_number: + description: 'Version number (e.g., v1.0.0, v1.0.0-pre, v1.0.0-pre1)' + required: true + skip_tests: + description: 'Set value to `true` to skip tests, default is `false`' + default: 'false' + use_existing_tag: + description: 'Set value to `true` to use an existing tag for the release process, default is `false`' + default: 'false' + +jobs: + create-tag: + runs-on: ubuntu-latest + if: >- + !cancelled() + && inputs.use_existing_tag == 'false' + steps: + - name: Validation of version format + run: | + echo "${{ inputs.version_number }}" | grep -P '^v\d+\.\d+\.\d+(-pre[A-Za-z0-9-]*)?$' + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + - name: Get the latest commit SHA + id: get-sha + run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" + - name: Create Go submodule tag for tools/foas + uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 + with: + tag: tools/foas/${{ inputs.version_number }} + commit_sha: ${{ steps.get-sha.outputs.sha }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.PASSPHRASE }} + + run-tests: + needs: [ create-tag ] + if: >- + !cancelled() + && !contains(needs.*.result, 'failure') + && inputs.skip_tests == 'false' + secrets: inherit + uses: ./.github/workflows/code-health-foas.yml + + failure-handler: + name: Failure Handler + needs: [ run-tests ] + if: ${{ always() && contains(needs.*.result, 'failure') }} + uses: ./.github/workflows/failure-handler.yml + with: + env: "prod" + release_name: "FOAS" + team_id: ${{ vars.JIRA_TEAM_ID_APIX_PLATFORM }} + secrets: + jira_api_token: ${{ secrets.JIRA_API_TOKEN }} diff --git a/tools/cli/RELEASING.md b/tools/cli/RELEASING.md index eaaa1287a9..4703abc2a6 100644 --- a/tools/cli/RELEASING.md +++ b/tools/cli/RELEASING.md @@ -17,9 +17,18 @@ gh workflow run release-cli.yml -f version_number=vX.Y.Z -f skip_tests=false -f ## What the workflow does 1. Validates the version number format. -2. Creates three tags pointing at the release commit: +2. Creates two tags pointing at the release commit: - `vX.Y.Z` — used by GoReleaser to publish the foascli binary and archives (`mongodb-foas-cli_*.tar.gz`). - - `tools/foas/vX.Y.Z` — Go submodule tag for the library module; external consumers (e.g. mcp-server in `mongodb-labs/oasis`) pin this. - `tools/cli/vX.Y.Z` — Go submodule tag for the binary module (informational; rarely imported). -3. Runs the QA test suite (`code-health-foascli.yml`) against both modules unless `skip_tests=true`. +3. Runs the cli QA test suite (`code-health-cli.yml`) unless `skip_tests=true`. 4. Runs GoReleaser in `tools/cli/` to build and publish the binary archives to GitHub Releases. + +## When to bump the binary version + +Cli releases are on-demand — bump when you want users (mms, humans, anyone running `foascli`) to get accumulated changes. Triggers: + +- Any change to cli plumbing (cobra commands, flags, output formats, bug fixes). +- A library change that adds a user-facing capability now exposed by cli. +- A library bugfix that affects binary behavior. + +Don't bump the binary for library-only refactors or library changes that don't surface through cli. Those are library-only releases (see [`tools/foas/RELEASING.md`](../foas/RELEASING.md)). diff --git a/tools/foas/RELEASING.md b/tools/foas/RELEASING.md new file mode 100644 index 0000000000..a774fafedc --- /dev/null +++ b/tools/foas/RELEASING.md @@ -0,0 +1,28 @@ +# Release FOAS Library + +## Trigger release workflow + +- Using our [Release GitHub Action](https://github.com/mongodb/openapi/actions/workflows/release-foas.yml) run a new workflow using `main` and the following inputs: + - Version number: `vX.Y.Z` + - Skip tests: Should be left empty. Only used in case failing tests have been encountered and the team agrees the release can still be done. + - Using an existing tag: Should be left empty (default `false` creates a new tag from `main`). Set to `true` only if you want to re-use an existing tag for the release (e.g. rerunning a failed release where the tag is already created). + +- Using [GitHub CLI](https://cli.github.com/), run: + ```bash + # Replace vX.Y.Z with the release version + gh workflow run release-foas.yml -f version_number=vX.Y.Z -f skip_tests=false -f use_existing_tag=false + ``` + +## What the workflow does + +1. Validates the version number format. +2. Creates a single tag pointing at the release commit: + - `tools/foas/vX.Y.Z` — Go submodule tag. External consumers (e.g. mcp-server in [`mongodb-labs/oasis`](https://github.com/mongodb-labs/oasis)) pin this via `go.mod`. +3. Runs the library QA test suite (`code-health-foas.yml`) unless `skip_tests=true`. +4. No binary is produced — see [`tools/cli/RELEASING.md`](../cli/RELEASING.md) for the foascli binary release. + +## When to bump the library version + +Library releases are independent of binary releases. Bump whenever there's a change in `tools/foas/**` that downstream Go consumers might want — added public API, behavior changes, bug fixes. The library tends to release more frequently than the binary. + +Internal-only changes (test helpers, internal package refactors, docs in `internal/`) typically don't need a version bump. From bf1cacfe586ade932441525c18c98349569c510b Mon Sep 17 00:00:00 2001 From: Yeliz Henden Date: Thu, 28 May 2026 12:56:02 +0100 Subject: [PATCH 5/5] fix doc_filters.sh grep to match current Go doc style; regenerate filter README MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-existing bug: the grep regex looked for '// XxxFilter:' (colon) style comments, but the source switched to standard Go doc style without the colon some time ago, so make gen-docs produced an empty filter list. Now matches '^// [A-Z][A-Za-z]*Filter ' (capitalized name + space) and skips mock files. README regenerated from the current source — 11 real filters. --- tools/foas/openapi/filter/README.md | 18 +++++++++++------- tools/foas/scripts/doc_filters.sh | 6 +++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/foas/openapi/filter/README.md b/tools/foas/openapi/filter/README.md index 755e3305f9..1c0befa1f9 100644 --- a/tools/foas/openapi/filter/README.md +++ b/tools/foas/openapi/filter/README.md @@ -8,10 +8,14 @@ The Atlas Admin API OpenAPI specifications are used not only to document REST en - Filtering per version, so that only the endpoints that are available in that version are shown. ## What filters are available? ### List of filters -[ExtensionFilter: is a filter that removes the x-xgen-IPA-exception extension from the OpenAPI spec (unless keepIPAExceptions is set in metadata).](./extension.go?plain=1#L21) -[HiddenEnvsFilter: is a filter that removes paths, operations,](./hidden_envs.go?plain=1#L28) -[InfoVersioningFilter: Filter that modifies the Info object in the OpenAPI spec with the target version.](./info.go?plain=1#L23) -[OperationsFilter: is a filter that removes the x-xgen-owner-team extension from operations.](./operations.go?plain=1#L20) -[TagsFilter: removes tags that are not used in the operations.](./tags.go?plain=1#L23) -[VersioningExtensionFilter: is a filter that updates the x-sunset and x-xgen-version extensions to a date string](./versioning_extension.go?plain=1#L25) -[VersioningFilter: is a filter that modifies the OpenAPI spec by removing operations and responses](./versioning.go?plain=1#L25) +[BumpFilter modifies includes the fields "x-state" and "x-beta" to the "preview" and "upcoming" APIs Operations.](./bump.go?plain=1#L21) +[CodeSampleFilter modifies includes the fields "x-state" and "x-beta" to the "preview" and "upcoming" APIs Operations.](./code_sample.go?plain=1#L45) +[ExtensionFilter is a filter that removes the x-xgen-IPA-exception extension from the OpenAPI spec.](./extension.go?plain=1#L21) +[HiddenEnvsFilter removes paths, operations, request/response bodies and content types](./hidden_envs.go?plain=1#L30) +[InfoVersioningFilter modifies the Info object in the OpenAPI spec with the target version.](./info.go?plain=1#L24) +[OperationsFilter is a filter that removes the x-xgen-owner-team extension from operations.](./operations.go?plain=1#L21) +[SchemasFilter removes unused #/components/schemas/.](./schemas.go?plain=1#L27) +[SunsetFilter removes the sunsetToBeDecided from the openapi specification.](./sunset.go?plain=1#L26) +[TagsFilter removes tags that are not used in the operations.](./tags.go?plain=1#L23) +[VersioningExtensionFilter is a filter that updates the x-sunset and x-xgen-version extensions to a date string](./versioning_extension.go?plain=1#L25) +[VersioningFilter is a filter that modifies the OpenAPI spec by removing paths, operations and responses](./versioning.go?plain=1#L25) diff --git a/tools/foas/scripts/doc_filters.sh b/tools/foas/scripts/doc_filters.sh index 483b09613a..228dd1bd53 100755 --- a/tools/foas/scripts/doc_filters.sh +++ b/tools/foas/scripts/doc_filters.sh @@ -3,8 +3,8 @@ echo "# List of filters applied to the OpenAPI specification" echo "These examples are automatically generated from filters docs." -# Expected format: -# // PlaceHolderFilter: is a filter that modifies the Info object in the OpenAPI spec. +# Expected format (Go doc comment on the type declaration): +# // PlaceHolderFilter is a filter that modifies the Info object in the OpenAPI spec. echo "# OpenAPI Filters" @@ -19,4 +19,4 @@ echo " - Filtering per version, so that only the endpoints that are available in echo "## What filters are available?" echo "### List of filters" -grep -n '// .*Filter: .*' openapi/filter/*.go | sort -u -k2 | sed -n "s|openapi/filter/\([^:]*\):\([0-9]*\):// \(.*Filter: .*\)|[\3](./\1?plain=1#L\2) |p" | sort +grep -n '^// [A-Z][A-Za-z]*Filter ' openapi/filter/*.go | grep -v Mock | sort -u -k2 | sed -n "s|openapi/filter/\([^:]*\):\([0-9]*\):// \(.*\)|[\3](./\1?plain=1#L\2) |p" | sort