Skip to content

Remove x-distributions-excluded annotations from spec (Phase 2) - #1222

Draft
Hailong-am wants to merge 3 commits into
opensearch-project:mainfrom
Hailong-am:feat/overlay-phase2
Draft

Remove x-distributions-excluded annotations from spec (Phase 2)#1222
Hailong-am wants to merge 3 commits into
opensearch-project:mainfrom
Hailong-am:feat/overlay-phase2

Conversation

@Hailong-am

Copy link
Copy Markdown
Contributor

Description

Removes all x-distributions-excluded inline annotations from the OpenAPI spec source files and the distribution filtering logic from OpenApiVersionExtractor. Distribution-specific API filtering is now handled by OpenAPI Overlay files (Phase 1, #1218).

Depends on #1218 — should be merged after Phase 1 lands.

What changed

Spec YAML (89 annotations removed from 4 files):

  • security.yaml: 82 removed
  • indices.yaml: 5 removed
  • _core.yaml: 1 removed
  • cat.yaml: 1 removed

Tooling:

  • OpenApiVersionExtractor: removed target_distribution param, #exclude_per_distribution(), #remove_keys_not_matching_distribution()
  • types.ts: removed x-distributions-included/x-distributions-excluded from OperationSpec
  • Linter OperationGroup.OP_PRIORITY: removed distribution keys
  • Schema validators (SchemasValidator, SchemaValidator): removed distribution keys from IGNORED_KEYS

Tests:

  • Updated extractor tests (removed distribution param, updated expected response keys)
  • Regenerated expected YAML fixtures

What is NOT changed

  • Test story distributions (for test filtering) — separate concept, stays
  • x-version-added/x-version-removed version filtering — stays

Ref: #1183

Check List

  • New functionality includes testing
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Distribution-specific API filtering is now handled by OpenAPI Overlay
files (introduced in opensearch-project#1218). This removes the inline annotations and
the distribution filtering logic that processed them.

Spec changes:
- Remove all 89 x-distributions-excluded annotations from 4 files:
  security.yaml (82), indices.yaml (5), _core.yaml (1), cat.yaml (1)

Tooling changes:
- OpenApiVersionExtractor: remove target_distribution constructor param,
  #exclude_per_distribution(), and #remove_keys_not_matching_distribution()
- types.ts: remove x-distributions-included/excluded from OperationSpec
- Linter: remove distribution keys from OperationGroup.OP_PRIORITY
- Schema validators: remove distribution keys from IGNORED_KEYS

Test changes:
- Update extractor tests to remove distribution param
- Regenerate expected YAML fixtures

Ref: opensearch-project#1183

Signed-off-by: Hailong Cui <ihailong@amazon.com>
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.44%. Comparing base (fbe9ede) to head (83eb1d9).

Files with missing lines Patch % Lines
tools/src/tester/test.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1222      +/-   ##
==========================================
- Coverage   85.52%   85.44%   -0.09%     
==========================================
  Files          61       61              
  Lines        2156     2143      -13     
  Branches      566      562       -4     
==========================================
- Hits         1844     1831      -13     
  Misses        311      311              
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…on filtering

Replace x-distributions-excluded/included documentation with references
to the overlays/ directory and OpenAPI Overlay specification.

- DEVELOPER_GUIDE.md: replace x-distributions-* extension docs with
  a Distribution-Specific API Filtering section pointing to overlays/
- TESTING_GUIDE.md: remove spec annotation examples, keep test story
  distributions (included/excluded) which are a separate concept

Signed-off-by: Hailong Cui <ihailong@amazon.com>
- MergedOpenApiSpec: remove target_distribution constructor param
  (distribution filtering is no longer done at spec level)
- test.ts: remove distribution param from MergedOpenApiSpec constructor
- Remove distribution-specific response entries and component definitions
  from merger and tester test fixture YAML files
- Remove distribution-specific test cases (oracle-managed, amazon-serverless)
  from MergedOpenApiSpec.test.ts
- Update expected response keys and regenerate extractor fixtures

Test story distributions (tests/*.yaml) are unaffected — those are
test-level filtering, a separate concept from spec-level annotations.

Signed-off-by: Hailong Cui <ihailong@amazon.com>
@Hailong-am
Hailong-am marked this pull request as draft September 1, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant