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

[FR] API schema tracking in QC #6269

Closed
matmair opened this issue Jan 17, 2024 · 6 comments · Fixed by #6440
Closed

[FR] API schema tracking in QC #6269

matmair opened this issue Jan 17, 2024 · 6 comments · Fixed by #6440
Assignees
Labels
CI CI / unit testing ecosystem enhancement This is an suggested enhancement or new feature
Milestone

Comments

@matmair
Copy link
Member

matmair commented Jan 17, 2024

I would like to create a new org repo that holds all API schemas from now on and maybe a few versions back(starting from the point where it was possible to create OpenAPI schemas).
Additionally, I would like to add a CI check that generates the schema of the current PR and checks it against the latest one from the new repo to ensure API changes do not go unnoticed.
Thoughts? @inventree/triage

Originally posted by @matmair in #5861

@matmair matmair self-assigned this Jan 17, 2024
@matmair matmair added enhancement This is an suggested enhancement or new feature CI CI / unit testing ecosystem labels Jan 17, 2024
@matmair matmair added this to the 0.14.0 milestone Jan 17, 2024
This was referenced Jan 18, 2024
@SchrodingersGat
Copy link
Member

@matmair with reference to #6456

Would it be a better approach to encode the API schema into the documentation itself?

Your API change detection PR can be used to ensure that the API schema documentation is always up-to-date. We can potentially use something like this to generate docs pages from the schema file. Additionally the schema file can be made available for download.

This means that the "latest" API is always accessible on the docs site.

Then whenever we make a versioned release, that release has the pinned API docs available too.

If we can get this workflow up and running, is there an advantage to a separate repo where we track these API changes also?

@matmair
Copy link
Member Author

matmair commented Feb 8, 2024

@SchrodingersGat I think we should include as little generated content as possible in the source repo (inventree/inventree) to keep the git repo small/useable. The user can always create the schema purely from the source code using the schema command (that is reproducible).

Generating API docs is certainly something to shoot for but should take place in the build step. As a comparison: We also do not commit the HTML for the docs or the rendered language js files to the main repo.
A separate repo keeps the main history cleaner and leaves us more flexibility in regard to repo layout.

@SchrodingersGat
Copy link
Member

Check out #6463 - we can generate the API as part of the docs generation, and provide:

  • A documented schema in the docs
  • A copy of the schema file for download

In this manner, we get versioned snapshots of the API for "free" without having to track another external repo - readthedocs does this for us

@matmair
Copy link
Member Author

matmair commented Feb 10, 2024

How do you reference specific API versions (for automatic client generation/backtesting between versions) with that? Are we releasing docs for every API version and does this mean we will have 2 different version numbers in releases? That does not seem easier than having another org repo similar to the Python client or app.

@SchrodingersGat
Copy link
Member

We would release docs for every version release of InvenTree - i.e. 0.14.0, 0.14.1, 0.15.0 ... - and then also a version which is built for the master branch (which is latest on readthedocs).

@matmair
Copy link
Member Author

matmair commented Feb 11, 2024

So we are changing the API versioning system? Having (an unknown number of) missing schemas for versions will pose problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI / unit testing ecosystem enhancement This is an suggested enhancement or new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants