Skip to content

Enhance spec-filter to support x-operation-group filtering and merge parameters across operations in same x-operation-group instead of selecting by max parameters#374

Merged
lucy66hw merged 4 commits intoopensearch-project:mainfrom
lucy66hw:verb_check
Jan 27, 2026
Merged

Enhance spec-filter to support x-operation-group filtering and merge parameters across operations in same x-operation-group instead of selecting by max parameters#374
lucy66hw merged 4 commits intoopensearch-project:mainfrom
lucy66hw:verb_check

Conversation

@lucy66hw
Copy link
Collaborator

Description

  1. Enhance spec-filter to support x-operation-group filtering
  2. Merge parameters across operations in same x-operation-group instead of selecting by max parameters.
  3. Remove google/protobuf/struct.proto from template.
  4. increase test coverage.

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

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.

…parameters across operations in same x-operation-group instead of selecting by max parameters

Signed-off-by: xil <fridalu66@gmail.com>
@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

❌ Patch coverage is 90.32258% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.19%. Comparing base (62f2e42) to head (45f88e6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tools/proto-convert/src/PreProcessing.ts 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #374       +/-   ##
===========================================
+ Coverage   43.89%   56.19%   +12.30%     
===========================================
  Files          17       17               
  Lines        1383     1397       +14     
  Branches      371      378        +7     
===========================================
+ Hits          607      785      +178     
+ Misses        672      528      -144     
+ Partials      104       84       -20     

☔ View full report in Codecov by Sentry.
📢 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.

@lucy66hw lucy66hw marked this pull request as ready for review January 25, 2026 22:43
paths:
- /{index}/_bulk
- /{index}/_search
/{index}/_bulk:
Copy link
Collaborator

Choose a reason for hiding this comment

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

how do we join the two /_bulk and /{index}/_bulk together, since both share the same x-operation-group: bulk, but the /_bulk endpoint has one less parameter?

  - $ref: '#/components/parameters/bulk::path.index'

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we don't join both. only join specified path with same group.

Copy link
Collaborator

Choose a reason for hiding this comment

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

so users can technically add both of these to spec-filter.yaml right:

/_bulk: 

   x-operation-group:
    - bulk
 /{index}/_bulk
   x-operation-group:
    - bulk

but both endpoints will be named after the x-operation-group, so both RPC endpoints will be named Bulk(). How do we prevent/consolidate that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

To me, it feels like x-opertion-group should be the top-level one then. Since x-operation-group ≈ endpoint and the REST API endpoint (e.g. /_bulk or /{index}/_bulk) is what determines the schema (the Protobuf message content)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we only keep the x-operation-group. Any endpoint with the included x-operation-group will be joined together and use merged parameter.

- /{index}/_search
/{index}/_bulk:
x-operation-group:
- bulk
Copy link
Collaborator

Choose a reason for hiding this comment

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

why does the operation group need to be list instead of a singular string field? are there examples in the spec where endpoints correspond to more than 1 x-operation-group?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for API: /{index}/_doc/{id}, it has get, exist, index and delete operation.

} from '../../src/utils/helper';
import { OpenAPIV3 } from 'openapi-types';

describe('getSchemaNames', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice, thanks for the test coverage

@karenyrx
Copy link
Collaborator

Also noticed that the PR does not actually 3. Remove google/protobuf/struct.proto from template. as claimed in the PR description. Does the PR description need to be updated, or is the PR missing that code change?

@lucy66hw
Copy link
Collaborator Author

Also noticed that the PR does not actually 3. Remove google/protobuf/struct.proto from template. as claimed in the PR description. Does the PR description need to be updated, or is the PR missing that code change?

The changes are in tools/proto-convert/src/config/protobuf-schema-template/partial_header.mustache file.

Signed-off-by: xil <fridalu66@gmail.com>
Signed-off-by: xil <fridalu66@gmail.com>
Signed-off-by: Xi Lu <fridalu66@gmail.com>
@lucy66hw lucy66hw merged commit d74c385 into opensearch-project:main Jan 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants