Repository navigation
Keep the API sitemap when assembler index runs - #4991
Merged
Merged
Conversation
`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]>
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]>
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4991/ |
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.
assembler indexno longer deletes the output folder ofassembler build, soassembler sitemaplistssitemap-api.xmlinsitemap.xmlagain. Todayhttps://docs-edge.elastic.dev/docs/sitemap.xmllists onlysitemap-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 indexandassembler sitemapin one output folder.AssemblerBuildServicekeeps that folder for Elasticsearch-only runs, butAssemblerBuilder.BuildAllAsyncdeleted it on every run. Soassembler indexremoved the build'ssitemap-api.xml, andassembler sitemapuploaded an index with onlysitemap-docs.xmlover 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.BuildAllAsyncno longer deletes the output folder.AssemblerBuildService.BuildAllstill deletes it before every run that writes HTML, soassembler buildstarts 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 sitemapwarns when the environment renders the API Explorer and the search index has API documents, but the output folder has nositemap-api.xml. The step lost the API sitemap without any message, which is why this reached edge unnoticed.Verify
The test fails when the delete in
AssemblerBuilder.BuildAllAsyncis restored. After the next edge deploy,https://docs-edge.elastic.dev/docs/sitemap.xmllists two<sitemap>entries.🤖 Generated with Claude Code