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 tools/linter along with jest tests. #219

Merged
merged 4 commits into from
Apr 10, 2024

Conversation

nhtruong
Copy link
Collaborator

@nhtruong nhtruong commented Apr 9, 2024

Description

Added a Linter to validate all yaml files in the /spec folder

Issues Resolved

#205
(Not closing as we still need to turn this into a workflow with a follow-up PR)

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.

Signed-off-by: Theo Truong <theotr@amazon.com>
Copy link
Contributor

github-actions bot commented Apr 9, 2024

API specs implemented for 246/649 (37%) APIs.

dblock
dblock previously approved these changes Apr 9, 2024
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Looks good.

  1. Add the linter build/test to CI part of this commit (even if you want to add linting itself as part of another), so future changes to the linter are tested.
  2. How much of the linter is OpenSearch-specific? Longer term, I wonder if it should be built as its own project in its own repo.

tools/README.md Outdated Show resolved Hide resolved
tools/README.md Outdated Show resolved Hide resolved
@nhtruong
Copy link
Collaborator Author

nhtruong commented Apr 9, 2024

@dblock
2. How much of the linter is OpenSearch-specific? Longer term, I wonder if it should be built as its own project in its own repo.

Half of the validator rules are OpenSearch specific:

  • Rules regarding x-operation-group
  • Rules regarding parameter naming conventions

The other rules enforce the multi-file structure we created for OpenSearch (divinding paths into namespaces in schemas into categories). The merger tool assumes that there are no infractions in these rules to ensure that the result single-file is a valid OpenAPI file. Projects that want to reuse this structure will benefit from these (Though the namespace is actually a part of x-operation-group so we will have to untangle that first.)

nhtruong added 2 commits April 9, 2024 16:49
Signed-off-by: Theo Truong <theotr@amazon.com>
Signed-off-by: Theo Truong <theotr@amazon.com>
Copy link
Contributor

github-actions bot commented Apr 9, 2024

API specs implemented for 246/649 (37%) APIs.

Signed-off-by: Theo Truong <theotr@amazon.com>
Copy link
Contributor

github-actions bot commented Apr 9, 2024

API specs implemented for 246/649 (37%) APIs.

@dblock dblock merged commit 5a31985 into opensearch-project:main Apr 10, 2024
4 checks passed
@nhtruong nhtruong deleted the validator branch April 10, 2024 14:49
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