Index OpenAPI specs published from a master branch - #4131
Merged
Merged
Conversation
The upload action keys objects by branch name. elastic/cloud publishes from master, so its specs land in S3 and the index builder dropped them as invalid keys. Mapping master to main here keeps the real branch in the object key without every consumer overriding version. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
reakaleek
force-pushed
the
fix/openapi-index-master-branch
branch
from
September 17, 2026 14:25
95e7155 to
47c6c9d
Compare
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4131/ |
Isolated serve needs a prefixed key so assembler preview does not collide with the docs-content entry. Co-Authored-By: Cursor Grok 4.6 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
2 tasks
This reverts commit 8520144.
Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Approved — no actionable issues found.
What is this? | From workflow: PR Review
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Specs uploaded from a repo whose default branch is
masternow appear in the OpenAPI version index under themainmoniker. Before this, the index builder dropped them as invalid keys, soelastic/cloud's Billing spec has been in S3 since July without ever reaching the API Explorer.Affects: API reference
Prompt summary: Publish the Elastic Cloud, Cloud Enterprise, and Cloud Billing OpenAPI specs to the version index so the native explorer can render them (elastic/docs-eng-team#832, elastic/docs-eng-team#833, elastic/docs-eng-team#835). The decision is to keep the real branch name in the S3 key and let the index do the mapping, rather than have each workflow override
version.Why
The
openapi/uploadaction writes objects as{org}/{repo}/{branch}/{spec}.VersionIndexBuilderacceptsmainor<major>.<minor>and reports anything else as an invalid key.elastic/cloudpublishes frommaster, soelastic/cloud/master/cloud-billing.yamlhas been uploaded on every billing change (7 green runs) and never indexed. elastic/cloud#156895 adds the ECH and ECE specs the same way and would hit the same gap.What
masterindexes undermainA
masterversion segment resolves to themainmoniker, withVersionkept asmastersoVersionIndexClientstill builds the correct object keyelastic/cloud/master/cloud.json. The unversioned URL for such a product renders from that object, the same as amainpublish.mainwins a collisionIf a repo ever publishes the same spec from both
mainandmaster, the existing highest-minor rule picksmain. No new branch in the code;mainsorts abovemasterinside the shared key.Tests
The invalid-key theory used
masteras its example of a rejected branch name. It now usesnot-a-branch, and two new tests cover themastermapping and themain-over-mastercollision.Verify
Risk: this ships in the
docs-lambda-openapi-indexLambda. After deploy, the next S3 event underelastic/rebuildsindex.jsonandelastic/cloudappears with the existing billing object, without any re-upload.Made with Cursor