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

Workflow to publish schemas #4139

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Conversation

ralfhandl
Copy link
Contributor

@ralfhandl ralfhandl commented Oct 16, 2024

Example PR created by this workflow

@handrews handrews added Schema script Pull requests that update Bash or JavaScript code labels Oct 16, 2024
@ralfhandl ralfhandl marked this pull request as ready for review October 17, 2024 10:00
@ralfhandl ralfhandl requested review from a team as code owners October 17, 2024 10:00
@karenetheridge
Copy link
Member

karenetheridge commented Oct 17, 2024

to confirm, these are both edited in the files?

  • dates in the $id keywords
  • $comment links in each definition, that currently go to the 3.1.0 spec and should go to 3.1.1

@ralfhandl
Copy link
Contributor Author

  • What about the dates in the $ids?

Those are replaced when converting from YAML to JSON, see example PR https://github.com/ralfhandl/OpenAPI-Specification/pull/26/files

@ralfhandl
Copy link
Contributor Author

ralfhandl commented Oct 17, 2024

  • What about the description links in each definition, that currently go to the 3.1.0 spec and should go to 3.1.1?

These need to be adjusted manually. Changing them in main will then trigger the schema-publish workflow.

Copy link
Member

@handrews handrews left a comment

Choose a reason for hiding this comment

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

Thanks for doing this work! To the extend that I understand current JavaScript, this looks great.

However, I'd like to merge #4146 and update this PR accordingly before publishing any new schemas. Let's make sure that when we resume publication after such a long gap, the first newly-published schemas are what we want.

Unfortunately, this does introduce a complexity, which is that the various 3.1 schema resources (of which there are four) can change independently. Ideally, we would only re-publish and update the $id for each when it changes, although it would not be the end of the world to just publish all four at once with the same updated data whenever any of them change. For the first publication, we'll need to do that anyway, so perhaps supporting independent updating can be something for later to keep the immediate work manageable?

I believe that the search-and-replace could just become a global grep for WORK-IN-PROGRESS once #4146 is merged, rather than worrying about parsing anything. We'd have to know not to put "WORK-IN-PROGRESS" anywhere else in the schemas, but that shouldn't be too hard to document.

It's worth noting that there are more places than id, $id, and $ref where the replacement needs to be done, so a global grep for a unique token would be more robust anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Schema script Pull requests that update Bash or JavaScript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants