Skip to content

Serve the current released minor in API docs, not an unreleased one - #5102

Merged
akira28 merged 1 commit into
mainfrom
feature/point-current-api-spec
Dec 2, 2026
Merged

akira28 merged 1 commit into
mainfrom
feature/point-current-api-spec

Conversation

@akira28

@akira28 akira28 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

The v9 API reference tree now renders the spec of the product's current release (9.5) instead of the highest published branch (9.6, not released yet).

Affects: API reference

Prompt summary: The API docs show 9.6 while the 9.6 release is delayed. The ask is to point each API at its current released spec version, taken from config/versions.yml. Showing every maintained minor is a later step.

Why

The OpenAPI version index (index.json) keeps only the highest published minor per major, so it maps 9 to 9.6 as soon as the 9.6 spec branch publishes. The docs then show APIs for a release that has not shipped. The 9.5 spec is already in the bucket.

What

Cap the resolved minor at the current release

VersionIndexClient.CapAtCurrentRelease compares each index version with the API product's versioning system. A minor above the current: minor in the same major falls back to that minor, so with stack 9.5.7 the v9 tree reads elastic/elasticsearch-specification/9.5/elasticsearch.json. Older majors, main (served at /next), and versionless products such as serverless stay as the index lists them. ECE follows its own current:.

Test fixtures declare a realistic current release

TestHelpers.CreateStackVersionsConfiguration now defaults currentMinor to 4. The generator tests serve a 9.4 index entry, and with the old 9.0 default the cap asked for a spec the stubs do not serve.

Risk: an API whose spec was never published at the current minor (first published in a later minor) loses its numeric tree until that release ships.

Out of scope: listing every maintained minor in the version switcher, and a serverless-kibana product.

Closes https://github.com/elastic/docs-eng-team/issues/1296

Verify

dotnet test --project tests/Elastic.ApiExplorer.Tests
# CapAtCurrentRelease_StackVersioning_NeverPassesTheCurrentMinor

🤖 Generated with Claude Code

The OpenAPI version index lists the highest published minor per major, so the `v9` tree showed `9.6` before 9.6 shipped. The resolved minor is now capped at the product's `current:` in `versions.yml`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@akira28
akira28 requested a review from a team as a code owner December 2, 2026 11:17
@akira28
akira28 requested a review from reakaleek December 2, 2026 11:17
@akira28 akira28 added the bug label Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Docs preview (local build)

Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/5102/

@akira28
akira28 merged commit 8a38221 into main Dec 2, 2026
51 checks passed
@akira28
akira28 deleted the feature/point-current-api-spec branch December 2, 2026 14: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.

2 participants