Repository navigation
Read changelog entries in other formats, defined as data - #4528
Open
theletterf wants to merge 5 commits into
Open
theletterf wants to merge 5 commits into
theletterf wants to merge 5 commits into
Conversation
elastic/elasticsearch and elastic/elasticsearch-serverless write entries with summary, area, their own type names, and breaking, deprecation and highlight blocks. docs-builder rejected all 715 Elasticsearch files with "Property 'area' not found", and range bundling failed on the 772 such files already in the Elasticsearch entry pool. NormalizeYaml and DeserializeEntry now convert that format to the docs-builder schema. The files have no products: validation accepts them when products.default is set, and range bundling resolves their products from the pull request labels, then products.default, like a synthesized entry. Fixes elastic/docs-eng-team#1106 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TjZFCvQhL3DdrcjFKU6jDT
An Elasticsearch-format entry with source_repo now puts the qualified reference in prs, so validation still compares pr with the file name. The docs say that only commit-range bundles fill products for these entries. Related to elastic/docs-eng-team#1106 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TjZFCvQhL3DdrcjFKU6jDT
Contributor
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4528/ Sample changed pages: |
Replace the hardcoded Elasticsearch conversion with entry formats defined in config/changelog-entry-formats.yml. A repository selects one with entry_format in its changelog.yml, and docs-builder converts its entry files where it reads them with that configuration: changelog validate, changelog upload (the pool then holds docs-builder entries), and commit-range bundling (for pool entries uploaded before the repository set it). Ships two formats: elasticsearch and elastic-agent-changelog-tool (beats, elastic-agent, fleet-server). Adding a format is a change to the YAML file. Related to elastic/docs-eng-team#1106 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TjZFCvQhL3DdrcjFKU6jDT
An entry format with files: any has file names that don't carry the PR, as with elastic-agent-changelog-tool fragments. changelog validate assigns such a file to the pull request that adds it. changelog upload looks up the pull request that added each file that names none and uploads the entry under that PR. Commit-range bundling matches a pool entry that names no PR to the PR in the range that added a file with the same name. Translate the Elasticsearch schema area names that the elasticsearch docs/changelog.yml spells differently. Related to elastic/docs-eng-team#1106 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TjZFCvQhL3DdrcjFKU6jDT
- Upload keeps the file name as the key for formats with files: any, so several fragments of one PR don't overwrite each other. - Upload reads entry_format even when --directory overrides the directory. - Converted entries no longer count as PR-alias markers in conflict messages. - Range bundling attributes a fragment to the PR that added it, not one that edited it, keeps looking while fragments remain unowned, and keeps file-name matching for docs-builder entries named <pr>.yaml. Related to elastic/docs-eng-team#1106 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TjZFCvQhL3DdrcjFKU6jDT
Member
Author
|
@Mpdreamz Ready to review |
Member
Author
|
@Mpdreamz Let's mothball this one till repos decide on whether to use a changelog file without following our standard, I'd say. This still means we might have to rewrite all existing .yml files though. |
This branch was successfully deployed
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.
While working out what Elasticsearch still needs for unified release notes, I found that docs-builder can't read the changelog entries Elasticsearch already writes. Rather than teach it that one format in code, this makes entry formats data that a repository opts into.
Why
elastic/elasticsearchkeeps one file per PR indocs/changelog/withpr,summary,area,typeandissues, plus optionalbreaking,deprecationandhighlightblocks. docs-builder rejected all 715 of them (Property 'area' not foundorProperty 'summary' not found). That has two effects today:release-notes.ymlworkflow to Elasticsearch would failrelease-notes / validateon every PR that adds an entry, about a quarter of recent PRs.release unified bundle,release serverless) fails with "matches PR #N but could not be parsed" when a PR in the range has one.Beats, elastic-agent and fleet-server have the same problem with a third format (elastic-agent-changelog-tool fragments), so a one-off conversion wouldn't last.
What
config/changelog-entry-formats.yml(embedded) defines each format as a mapping from docs-builder fields to source fields:from(first path with a value wins, nested paths likebreaking.details),split,unless,template,present, per-fieldvaluestranslations, andignore. Any other key in a source file is an error, so typos still surface. It ships two formats:elasticsearch:summary→title,area→areas,bug/breaking/breaking-java/new-aggregation/upgrade→bug-fix/breaking-change/breaking-change/feature/other, blockdetails/impact/body→description/impact,highlight→highlight,source_repo→prs: elastic/<repo>#<pr>.elastic-agent-changelog-tool:kind,summary,description,component,pr,issue,impact,action.entry_format: <name>inchangelog.yml. An unknown name is a configuration error that lists the known ones. Nothing changes for a repository that doesn't set it.changelog validateconverts before validating. Converted entries have noproducts, so a missingproductsis accepted whenproducts.defaultis set.changelog uploaduploads the converted entry, so the pool holds docs-builder entries from then on.entry_format. A pool entry without products takes them like a synthesized entry:pivot.productslabels, thenproducts.default. Those PRs now have their metadata fetched for that.files: any(elastic-agent-changelog-tool) has file names that don't carry the PR.changelog validateassigns such a file to the PR that adds it;changelog uploadlooks up the PR that added each file that names none (commits?path=thencommits/{sha}/pulls) and uploads the entry under that PR's number; commit-range bundling matches a pool entry that still names no PR to the PR in the range that added a file with that name (onepulls/{n}/filescall per PR without a pool entry, only when such entries exist).create.md,entry_formatinconfigure-ref.md, and a commented line inchangelog.example.yml.Checks
Elastic.Changelog.Tests: 1670/1670 pass. New tests cover both shipped formats, a format defined in the test, unknown source keys and target fields, the config key, upload conversion, validation, and a commit-range bundle with a mixed pool (two Elasticsearch-format entries, one resolved byproducts.defaultand one by a label, plus one docs-builder entry). Withoutentry_format, an Elasticsearch-format pool entry still fails to parse, as before.docs-builder --path docs --strict: 0 errors.changelog validateover all 715 files inelastic/elasticsearchwith itsdocs/changelog.ymlplusentry_format: elasticsearch: 697 pass. The other 18 used the schema areaSnapshot/Restore; the format now translates it andExtract&Transformto the names the Elasticsearch config uses, and with [DOCS] Read changelog entries with the elasticsearch entry format elasticsearch#162667 all 718 files onmainpass.elastic-agent-changelog-tool.Not covered
changelog bundlewith a product filter, outside a commit range) don't add products to converted entries.elastic/docs-actions(changelog/upload) doesn't passGITHUB_TOKENto docs-builder yet, so the upload-time PR lookup would run unauthenticated until it does. That's a one-line follow-up there.Fixes elastic/docs-eng-team#1106
🤖 Generated with Claude Code
https://claude.ai/code/session_01TjZFCvQhL3DdrcjFKU6jDT