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

[DOC] Auto-generate openapi.json #782

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

pavithraes
Copy link
Member

Ref: #766

Description

This pull request:

  • Adds a script and action to auto-update the openapi.json static file. This file is used to generate the REST API docs.
  • Adds conda-store.sqlite to .gitignore

Pull request checklist

  • Did you test this change locally?
  • Did you update the documentation (if required)?
  • Did you add/update relevant tests for this change (if required)?

Additional information

  • While this works, there is likely a cleaner/minimal way to do this. Please let me know if you ideas to simplify this!
  • Please make sure to squash-merge this PR.

How to test

I've tested it on my fork: pavithraes#4

Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
Signed-off-by: Pavithra Eswaramoorthy <[email protected]>
@pavithraes pavithraes added area: documentation 📖 Improvements or additions to documentation needs: review 👀 labels Mar 14, 2024
@pavithraes pavithraes requested a review from dcmcand March 14, 2024 19:17
Copy link

netlify bot commented Mar 14, 2024

Deploy Preview for kaleidoscopic-dango-0cf31d ready!

Name Link
🔨 Latest commit 269d2cc
🔍 Latest deploy log https://app.netlify.com/sites/kaleidoscopic-dango-0cf31d/deploys/65f34d4bf9e3b40008cb07ff
😎 Deploy Preview https://deploy-preview-782--kaleidoscopic-dango-0cf31d.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 14, 2024

Deploy Preview for kaleidoscopic-dango-0cf31d ready!

Name Link
🔨 Latest commit f3a99d4
🔍 Latest deploy log https://app.netlify.com/sites/kaleidoscopic-dango-0cf31d/deploys/65f34d5b8f66cf00081d3a45
😎 Deploy Preview https://deploy-preview-782--kaleidoscopic-dango-0cf31d.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@pavithraes pavithraes mentioned this pull request Mar 14, 2024
3 tasks
Comment on lines +9 to +11
push: # temporary, only for testing
branches:
- "gen-openapi-json"
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove these before merging

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remember to remove these.

Copy link
Contributor

@peytondmurray peytondmurray left a comment

Choose a reason for hiding this comment

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

Quick question: this will make a PR against the branch that someone is trying to merge, right? So the workflow looks like this:

  1. I make a PR
  2. This action runs, updating openapi.json. A PR against my branch is opened.
  3. I merge the PR to my branch
  4. Then I merge my branch to main

Is that the workflow?


If I've got that workflow right, I'd vote to have a different workflow similar to how pre-commit.ci works:

  1. I make a PR
  2. This action runs, updating openapi.json. A commit to my branch is made.
  3. I merge my branch to main

But that's just my preference.

name: "Generate openapi.json"

env:
DEFAULT_PYTHON_VERSION: "3.10"
Copy link
Contributor

Choose a reason for hiding this comment

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

Active support for 3.10 ended a year ago, any reason not to use the latest python version?

Comment on lines +27 to +28
def main():
gen_openapi_json()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with this, or if you want to drop main() entirely and just call gen_openapi_json that seems fine too.

Comment on lines +9 to +11
push: # temporary, only for testing
branches:
- "gen-openapi-json"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remember to remove these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation 📖 Improvements or additions to documentation needs: review 👀
Projects
Status: In review 👀
Development

Successfully merging this pull request may close these issues.

None yet

2 participants