Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added distributions/included and excluded. #510

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions TESTING_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,16 @@ OpenSearch consists of plugins that may or may not be present in various distrib
description: Returns basic information about the cluster.
```

Similarly, skip tests that are not applicable to a distribution by listing the distributions that support it.
Similarly, skip tests that are not applicable to a distribution by listing the distributions that support or do not support it.

```yaml
description: Test root endpoint.
distributions:
- amazon-managed
- opensearch.org
included:
- amazon-managed
- opensearch.org
excluded:
- amazon-serverless
chapters:
- synopsis: Get server info.
path: /
Expand Down
10 changes: 10 additions & 0 deletions json_schemas/test_story.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ definitions:
type: string

Distributions:
description: |
The list of distributions that support this API.
type: object
properties:
included:
$ref: '#/definitions/DistributionsList'
excluded:
$ref: '#/definitions/DistributionsList'

DistributionsList:
description: |
The list of distributions that support this API.
type: array
Expand Down
3 changes: 3 additions & 0 deletions spec/namespaces/cat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ paths:
operationId: cat.nodeattrs.0
x-operation-group: cat.nodeattrs
x-version-added: '1.0'
x-distributions-excluded:
Copy link

@reta reta Aug 22, 2024

Choose a reason for hiding this comment

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

@dblock coming from opensearch-project/opensearch-java#1152 (comment), I understand the bias towards supporting AWS, but I honestly believe the spec has to be vendor neutral. I believe it should be feasible to keep the distribution specific details outside of the spec and allow the distribution specific spec to be produced if needed:

For example:

  • the vendor neutral spec: openapi-oss.yaml
  • the AWS managed spec: openapi-aws.yaml (would only contain new APIs, excluded APIs or APIs that are tailored)

The final spec for AWS: openapi-oss.yaml + openapi-aws.yaml

Copy link
Member Author

@dblock dblock Aug 22, 2024

Choose a reason for hiding this comment

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

I think you can/should open an issue copy-pasting the above about removing x-distribution-excluded.

When I introduced this feature I did not intend it to be biased towards supporting AWS in any way, but I did want to run the tests against Amazon Managed so I annotated some APIs. We would welcome other keywords here, be it oracle-oci, aiven-managed or something platform-specific like community-freebsd in the short term. Therefore I believe the spec is vendor netural today. I think it's ok to mention vendors in the spec this way, but we can talk about it.

What you are looking at is the source for the spec, not the spec. We currently publish the all-versions spec in a release that includes these x- options. But this repo is capable of producing a version-specific spec (e.g. 1.3.x, without APIs added in/after 2.0 for example or vice-versa) (see https://github.com/opensearch-project/opensearch-api-specification/blob/main/DEVELOPER_GUIDE.md#spec-merger), and that could be extended to produce a vendor-less (by stripping x-distribution options), or a vendor-specific spec (e.g. -amazon-managed.yaml).

- amazon-managed
- amazon-serverless
description: Returns information about custom node attributes.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/cat/cat-nodeattrs/
Expand Down
15 changes: 15 additions & 0 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ paths:
operationId: indices.clear_cache.0
x-operation-group: indices.clear_cache
x-version-added: '1.0'
x-distributions-excluded:
- amazon-managed
- amazon-serverless
description: Clears all or specific caches for one or more indices.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/
Expand Down Expand Up @@ -319,6 +322,9 @@ paths:
operationId: indices.forcemerge.0
x-operation-group: indices.forcemerge
x-version-added: '1.0'
x-distributions-excluded:
- amazon-managed
- amazon-serverless
description: Performs the force merge operation on one or more indices.
externalDocs:
url: https://opensearch.org/docs/latest
Expand Down Expand Up @@ -589,6 +595,9 @@ paths:
operationId: indices.segments.0
x-operation-group: indices.segments
x-version-added: '1.0'
x-distributions-excluded:
- amazon-managed
- amazon-serverless
description: Provides low-level information about segments in a Lucene index.
externalDocs:
url: https://opensearch.org/docs/latest
Expand All @@ -605,6 +614,9 @@ paths:
operationId: indices.get_settings.0
x-operation-group: indices.get_settings
x-version-added: '1.0'
x-distributions-excluded:
- amazon-managed
- amazon-serverless
description: Returns settings for one or more indices.
externalDocs:
url: https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/
Expand Down Expand Up @@ -1564,6 +1576,9 @@ paths:
operationId: indices.segments.1
x-operation-group: indices.segments
x-version-added: '1.0'
x-distributions-excluded:
- amazon-managed
- amazon-serverless
description: Provides low-level information about segments in a Lucene index.
externalDocs:
url: https://opensearch.org/docs/latest
Expand Down
Loading
Loading