-
Notifications
You must be signed in to change notification settings - Fork 59
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 support for testing multiple distributions. #483
Conversation
Changes AnalysisCommit SHA: 090a038 API ChangesSummary
ReportThe full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/10386946783/artifacts/1811077711 API Coverage
|
7f96658
to
d75819d
Compare
d75819d
to
6def08d
Compare
Spec Test Coverage Analysis
|
f77597b
to
3cf584d
Compare
3cf584d
to
f1f1048
Compare
Should we have |
DEVELOPER_GUIDE.md
Outdated
@@ -146,6 +146,7 @@ This repository includes several OpenAPI Specification Extensions to fill in any | |||
- `x-ignorable`: Denotes that the operation should be ignored by the client generator. This is used in operation groups where some operations have been replaced by newer ones, but we still keep them in the specs because the server still supports them. | |||
- `x-global`: Denotes that the parameter is a global parameter that is included in every operation. These parameters are listed in the [spec/_global_parameters.yaml](spec/_global_parameters.yaml). | |||
- `x-default`: Contains the default value of a parameter. This is often used to override the default value specified in the schema, or to avoid accidentally changing the default value when updating a shared schema. | |||
- `x-distributions`: Contains a list of distributions known to include the API. Use `opensearch.org` for the official distribution, `aos` for Amazon Managed OpenSearch, and `aoss` for Amazon OpenSearch Serverless. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having aos
and aoss
as shortened versions is not immediately grokkable to someone without some AWS specific context. Even as someone with that context having one be a prefix of the other immediately hurts readability. Could we expand these to amazon-managed
& amazon-serverless
given we have a full form opensearch.org
?
We should think ahead for what precedent we set if in future we end up with contributions related to things like Oracle Cloud Infrastructure Search with OpenSearch. (oci
, ocisos
, oracle
, oracle-managed
, oci-managed
, etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. One thought I had is to use URIs, e.g. aws.amazon.com/opensearch-service
? WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be a bit verbose, AOSS would be aws.amazon.com/opensearch-service/features/serverless
presumably.
Either way we'd likely need to define an enum somewhere and validate correctness, as spelling mistakes will be a PITA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use ajv.addKeyword
to define a custom type for the new x-distribution
options, but couldn't make it work. Maybe @nhtruong can help me make these values check against an enum on top of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're only using AJV to validate JSON Schemas in the spec. x-distribution
is not used in a schema, but rather an operation. So it should be validated similar to how we validate x-operation-group
and other extensions.
In the very near future, we should create a json-schema for the namespace files and another for the category files in the ./spec
folder. Even though we currently only require our yaml
files to be OpenAPI valid, we actually require a much stricter json-schema for these files:
x-operation-group
is supported but a typo likex-opperation-group
should not.- Someone uses a new and valid OpenAPI keyword that the clients should handle accordingly but it got through the PR review without updating the Client Gen doc.
#paths
is not allowed in category yaml files#components/schemas
is not allowed in namespace yaml files- We can enforce validation on the extensions for free through AJV.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like we might really want both an "allow"/"include" and "deny"/"exclude" variant. As in the majority of cases all or most distributions will support an API and just |
I've added include and exclude variants, etc., but no value validation in this PR. Please take another look? We'll need jamesmbourne/aws4-axios#1621 to make serverless work. |
801c3f8
to
44c71cb
Compare
f021f4d
to
936fb9c
Compare
On this note. Do you @nhtruong @Xtansia have a (strong) preference for:
|
I think ideally we'd want There might be better verbiage than |
2ef9985
to
7097d88
Compare
Made updates per comments and rebased. We can expand into includes and excludes for the distribution in a future PR. |
Signed-off-by: dblock <dblock@amazon.com>
Signed-off-by: dblock <dblock@amazon.com>
Signed-off-by: dblock <dblock@amazon.com>
Signed-off-by: dblock <dblock@amazon.com>
Signed-off-by: dblock <dblock@amazon.com>
101ec85
to
090a038
Compare
Description
Introduces
x-distributions
that allows labelling APIs for various distributions and services. I propose we useopensearch.org
for the default distribution,aos
andaoss
for the two Amazon managed services, and others can add their own.If an API is not present in all distributions one has to list the distributions it is present in. I think it's better than having a negative list so that we can claim support for a well-known list of distributions in the spec and not have piecemeal support.
With this change,
npm run test:spec -- --opensearch-distribution=amazon-managed
passes against AOS 2.13.Corrects semver checks for ranges with multiple values (e.g.
>= 2.0, < 3
).Issues Resolved
Part of #84.
Closes #475.
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.