Skip to content

Keep the API sitemap when assembler index runs - #4991

Merged
reakaleek merged 3 commits into
mainfrom
docs-edge-sitemap-api-289ced64
Nov 20, 2026
Merged

reakaleek merged 3 commits into
mainfrom
docs-edge-sitemap-api-289ced64

Conversation

@reakaleek

@reakaleek reakaleek commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

assembler index no longer deletes the output folder of assembler build, so assembler sitemap lists sitemap-api.xml in sitemap.xml again. Today https://docs-edge.elastic.dev/docs/sitemap.xml lists only sitemap-docs.xml.

Affects: Assembler builds

Prompt summary: Find out why the sitemap index on edge has one entry when edge renders API pages and should list sitemap-api.xml, and fix it.

Why

CI runs assembler build, assembler index and assembler sitemap in one output folder. AssemblerBuildService keeps that folder for Elasticsearch-only runs, but AssemblerBuilder.BuildAllAsync deleted it on every run. So assembler index removed the build's sitemap-api.xml, and assembler sitemap uploaded an index with only sitemap-docs.xml over the correct one. The edge deploy of 2026-11-20 shows this order: the build uploaded a two-entry index at 12:28, and the sitemap step replaced it with a one-entry index at 12:33.

What

One owner for cleaning the output folder

AssemblerBuilder.BuildAllAsync no longer deletes the output folder. AssemblerBuildService.BuildAll still deletes it before every run that writes HTML, so assembler build starts from an empty folder as before. Elasticsearch-only runs now keep it, which the service already said it does.

A warning when the API sitemap is missing

assembler sitemap warns when the environment renders the API Explorer and the search index has API documents, but the output folder has no sitemap-api.xml. The step lost the API sitemap without any message, which is why this reached edge unnoticed.

Verify

dotnet test --project tests/Elastic.Documentation.Build.Tests --treenode-filter "/*/*/SitemapTests/*"
# Build_IntoAnEarlierBuildsOutput_KeepsItsApiSitemapListedInTheIndex
# BuildSitemapMissing_WarnsOnlyWhenRenderedApiPagesLoseTheirSitemap

The test fails when the delete in AssemblerBuilder.BuildAllAsync is restored. After the next edge deploy, https://docs-edge.elastic.dev/docs/sitemap.xml lists two <sitemap> entries.

🤖 Generated with Claude Code

`AssemblerBuilder` deleted the output folder on every run. That overrode
`AssemblerBuildService`, which keeps the folder for Elasticsearch-only runs.
On edge, `assembler index` then removed the build's `sitemap-api.xml`, and
`assembler sitemap` uploaded an index with only `sitemap-docs.xml`. The
service now decides alone, and `assembler sitemap` warns when the index has
API documents but the folder has no API sitemap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@reakaleek
reakaleek requested a review from a team as a code owner November 20, 2026 13:58
@reakaleek reakaleek added the bug label Nov 20, 2026
@reakaleek
reakaleek requested a review from akira28 November 20, 2026 13:58
The Elasticsearch index can hold API documents in an environment that
does not render API pages, such as `prod`. There, a sitemap without
`sitemap-api.xml` is correct. Per review by Libra.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The condition moves into `ApiSitemapDates.BuildSitemapMissing`, a pure
function, so a test covers it without Elasticsearch. One case per input
shows that the API Explorer flag, the API documents and the build's API
sitemap each decide the warning. Per review by Libra.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

@reakaleek
reakaleek merged commit 1ab0bea into main Nov 20, 2026
44 checks passed
@reakaleek
reakaleek deleted the docs-edge-sitemap-api-289ced64 branch November 20, 2026 14:28
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