Skip to content

Index OpenAPI specs published from a master branch - #4131

Merged
reakaleek merged 5 commits into
mainfrom
fix/openapi-index-master-branch
Sep 18, 2026
Merged

reakaleek merged 5 commits into
mainfrom
fix/openapi-index-master-branch

Conversation

@reakaleek

@reakaleek reakaleek commented Sep 17, 2026

Copy link
Copy Markdown
Member

Specs uploaded from a repo whose default branch is master now appear in the OpenAPI version index under the main moniker. Before this, the index builder dropped them as invalid keys, so elastic/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/upload action writes objects as {org}/{repo}/{branch}/{spec}. VersionIndexBuilder accepts main or <major>.<minor> and reports anything else as an invalid key. elastic/cloud publishes from master, so elastic/cloud/master/cloud-billing.yaml has 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

master indexes under main

A master version segment resolves to the main moniker, with Version kept as master so VersionIndexClient still builds the correct object key elastic/cloud/master/cloud.json. The unversioned URL for such a product renders from that object, the same as a main publish.

main wins a collision

If a repo ever publishes the same spec from both main and master, the existing highest-minor rule picks main. No new branch in the code; main sorts above master inside the shared key.

Tests

The invalid-key theory used master as its example of a rejected branch name. It now uses not-a-branch, and two new tests cover the master mapping and the main-over-master collision.

Verify

dotnet test tests/Elastic.Documentation.OpenApiIndex.Tests/
# Build_MasterVersion_IndexesUnderMainWithMasterObjectKey — master lands under "main" with version "master"
# Build_MainAndMasterBothPublished_MainWins — collision keeps main

Risk: this ships in the docs-lambda-openapi-index Lambda. After deploy, the next S3 event under elastic/ rebuilds index.json and elastic/cloud appears with the existing billing object, without any re-upload.

Made with Cursor

@reakaleek
reakaleek requested a review from a team as a code owner September 17, 2026 14:21
@reakaleek reakaleek added the bug label Sep 17, 2026
@reakaleek
reakaleek requested a review from akira28 September 17, 2026 14:21
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
reakaleek force-pushed the fix/openapi-index-master-branch branch from 95e7155 to 47c6c9d Compare September 17, 2026 14:25
@github-actions

Copy link
Copy Markdown
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>
reakaleek and others added 2 commits September 17, 2026 16:48
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved — no actionable issues found.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@reakaleek
reakaleek merged commit 54a1053 into main Sep 18, 2026
32 checks passed
@reakaleek
reakaleek deleted the fix/openapi-index-master-branch branch September 18, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant