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

πŸ› οΈ [TASK] : Add OpenAPI linting to our CI process. #143

Closed
7 tasks done
stevenj opened this issue Nov 13, 2023 · 0 comments Β· Fixed by #208, #209, #229 or #236
Closed
7 tasks done

πŸ› οΈ [TASK] : Add OpenAPI linting to our CI process. #143

stevenj opened this issue Nov 13, 2023 · 0 comments Β· Fixed by #208, #209, #229 or #236
Assignees
Labels
good first issue Good for newcomers

Comments

@stevenj
Copy link
Collaborator

stevenj commented Nov 13, 2023

Summary

Add OpenAPI linting for catalyst-gateway but in a way we can easily re-use on other targets.

Description

We want to add openapi-linting to catalyst-gateway.
Catalyst-gateway auto generates the OpenAPI spec document, but we still need to ensure it follows best practice.
This will help keep our documentation of high quality and ensure we don't have any issues that could cause problems for people trying to use our specifications or documentation.

We should use: https://github.com/stoplightio/spectral
It has a feature to allow it to lint any json/yaml document with custom rules. As we want to use jason-schema to define forms for catalyst-gateway this could be a useful re-usable too to enforce consistency or limit our forms to features we support vs the entire json-schema feature set.

Tasks

  • make a builder (or add to one) in cat-ci that incorporates spectral and any rulesets we want (both third party and in-house).
    • Minimum 3rd party rule sets owasp top 10 and documentation others listed in the spectral repo should be evaluated for usefulness given our projects. This might be simply a target that exports the necessary ruleset artefacts, so they can be used consistently in other parts of the build.
    • It might be easiest to just use the binary install method: https://meta.stoplight.io/docs/spectral/b8391e051b7d8-installation and integrate directly into the rust builder as our api's are generated from rust.
  • Generate the OpenAPI spec during the build step of catalyst-gateway, after the binary images themselves have been built.
  • Then add a check to run the linter against them with the necessary rules. (If possible this could be a UDC to reduce boiler plate).
  • Correct any issues the linter picks up in the catalyst-gateway API.
    • If the issue is with how Poem generates its specification we will need to work out how to make poem produce a compliant document, or temporarily disable the failing lint (or set it to a warning level) and then raise a ticket to fix poem upstream so it can produce better specifications.
@stevenj stevenj added the good first issue Good for newcomers label Nov 13, 2023
@stevenj stevenj added this to Catalyst Nov 13, 2023
@stevenj stevenj moved this to πŸ†• New in Catalyst Nov 13, 2023
@Mr-Leshiy Mr-Leshiy moved this from πŸ†• New to πŸ”– Ready in Catalyst Dec 13, 2023
@bkioshn bkioshn self-assigned this Jan 8, 2024
@bkioshn bkioshn moved this from πŸ”– Ready to πŸ— In progress in Catalyst Jan 10, 2024
@bkioshn bkioshn moved this from πŸ— In progress to πŸ›‘ Blocked in Catalyst Jan 16, 2024
@bkioshn bkioshn mentioned this issue Jan 17, 2024
8 tasks
@github-project-automation github-project-automation bot moved this from πŸ›‘ Blocked to βœ… Done in Catalyst Jan 17, 2024
@Mr-Leshiy Mr-Leshiy moved this from βœ… Done to πŸ— In progress in Catalyst Jan 17, 2024
@Mr-Leshiy Mr-Leshiy moved this from πŸ— In progress to βœ… Done in Catalyst Jan 17, 2024
@Mr-Leshiy Mr-Leshiy moved this from βœ… Done to πŸ— In progress in Catalyst Jan 17, 2024
@Mr-Leshiy Mr-Leshiy reopened this Jan 17, 2024
@github-project-automation github-project-automation bot moved this from πŸ— In progress to βœ… Done in Catalyst Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment