Skip to content

Conversation

@l-trotta
Copy link
Contributor

@l-trotta l-trotta commented Jun 30, 2025

Closes #4628.
This doesn't affect main or 9.x, it's only an old docs system issue, but I'll port this everywhere for consistency.
In the old docs the branch name in ext_docs_url (externalDocs in openapi) is a {branch} placeholder that gets resolved in the rust openapi converter by getting the correct branch value from the schema model. The problem is that the branch/version doesn't exist in the schema model anymore, because it was causing problems with PRs, so right now it always defaults to "current".

This PR gets the version for externalDocs from a CLI argument instead. This is a temporary solution, since the whole logic will get rewritten when the repo is transfered.

So no changes for branches main, 9.1, 9.0, while for 8.18 and 8.19 it will be possible to run:

npm run transform-to-openapi -- --schema output/schema/schema.json --flavor stack --output output/openapi/elasticsearch-openapi.json --branch 8.19

and fix the url issue.

Output preview for 8.19: https://github.com/elastic/elasticsearch-specification/blob/backport-4722-to-8.19/output/openapi/elasticsearch-openapi.json

Copy link
Contributor

@lcawl lcawl left a comment

Choose a reason for hiding this comment

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

This sounds great, thanks! Once it's merged, I'll create a separate PR to add that option to the makefile for the 8.19 and 8.18 branches and update our release processes in case they need to be updated (e.g. right now the "8.19" branch has to point to 8.x docs but that will change once we have live 8.19 docs)

@l-trotta l-trotta merged commit fd09485 into main Jul 1, 2025
16 checks passed
@l-trotta l-trotta deleted the branch-name-docs-cli branch July 1, 2025 09:01
github-actions bot pushed a commit that referenced this pull request Jul 1, 2025
(cherry picked from commit fd09485)
github-actions bot pushed a commit that referenced this pull request Jul 1, 2025
(cherry picked from commit fd09485)
github-actions bot pushed a commit that referenced this pull request Jul 1, 2025
(cherry picked from commit fd09485)
github-actions bot pushed a commit that referenced this pull request Jul 1, 2025
(cherry picked from commit fd09485)
l-trotta added a commit that referenced this pull request Jul 1, 2025
(cherry picked from commit fd09485)

Co-authored-by: Laura Trotta <[email protected]>
l-trotta added a commit that referenced this pull request Jul 1, 2025
(cherry picked from commit fd09485)

Co-authored-by: Laura Trotta <[email protected]>
l-trotta added a commit that referenced this pull request Jul 1, 2025
(cherry picked from commit fd09485)

Co-authored-by: Laura Trotta <[email protected]>
l-trotta added a commit that referenced this pull request Jul 1, 2025
(cherry picked from commit fd09485)

Co-authored-by: Laura Trotta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OpenAPI] URL resolution is always current instead of branch

4 participants