changelog backfill cli command
docs-builder changelog backfill [options]
Backfills changelog entries, notes registries, and bundle YAML from published release-notes pages — either the live elastic.co site page or a pinned raw.githubusercontent.com ref for products whose published page is an empty <changelog> stub. All output is written to disk; nothing is published to S3. Use changelog upload to publish the output.
For each product in scope the command:
- Fetches the release-notes Markdown — from
elastic.co/docs/release-notes/{path}.md(site source) orraw.githubusercontent.com/{owner}/{repo}/{ref}/{path}(repo source). - Parses each
## {version}section into typed entries. Unrecognized### …subsections whose body is bullets becomeOther-typed entries; prose subsections are preserved in the bundle description. - Writes bundle YAML to
{output}/{product}/changelog/bundles/{version}.yaml. - Writes per-entry YAML files:
{pr}.yamlfor entries that reference a pull request,note-{slug}.yamlfor entries with no PR reference. - Writes
notes-{target}.jsonper version listing allnote-*.yamlfiles for that target (the notes registry). - Prints a per-product report including entry counts and no-PR rates.
The primary use case is measuring how much published release-notes content cannot be traced back to a PR — determining how much historical content needs the PR-less "note" format from docs-eng-team#789.
Behaviour flags:
--dry-run — Fetch and parse every page but write nothing to disk.
--productsstring[]-
Restrict the run to specific product ids (comma-separated or repeated). Defaults to every product in the scope table.
Repeatable: pass
--productsmultiple times to supply more than one value --versionsstring[]-
Restrict the run to specific versions (comma-separated or repeated).
Repeatable: pass
--versionsmultiple times to supply more than one value --outputstring- Output directory. Defaults to .artifacts/release-notes-backfill/ under the checkout root.
--concurrencyint-
Maximum number of pages fetched concurrently (1–16, default 4).
Default:
4 --dry-run-
Fetch and parse every page but write nothing to disk. (preview changes without applying them)
Default:
false -l--log-levelenum-
Minimum log level.
Values: trace, debug, information, warning, error, critical, none
Default:
information -c--config-sourceenum-
Override the configuration source: local, remote
Values: local, remote, embedded
--skip-private-repositories- Skip cloning private repositories
-l--log-levelenum-
Minimum log level.
Values: trace, debug, information, warning, error, critical, none
Default:
information -c--config-sourceenum-
Override the configuration source: local, remote
Values: local, remote, embedded
--skip-private-repositories- Skip cloning private repositories
The scope table is checked into the command itself (BackfillScope.All in the docs-builder repository). It covers 40 products — 39 via site source and one (edot-java) via a pinned GitHub ref, because the published elastic.co page for edot-java is an empty <changelog> stub.
| Field | Meaning |
|---|---|
ProductId |
Bundle product id (the bundle/{product}/ S3 prefix, see config/products.yml). |
Path |
Site-relative path used to build the .md export URL. |
Owner / Repo / Ref |
Repo-source only: pinned commit for reproducible fetches. |
Cutoff |
Inclusive upper version bound; releases above it are skipped (live pipeline owns them). |
Runs cover the whole table unless narrowed with --products.
{output}/{product}/changelog/bundles/{version}.yaml
{output}/{product}/changelog/{pr}.yaml
{output}/{product}/changelog/note-{slug}.yaml
{output}/{product}/changelog/notes-{target}.json
- bundle — upload with changelog upload
- entry file for a PR-traced entry
- entry file for a PR-less entry
- notes registry for a version
The bundles/ leaf is a flat directory shaped for changelog upload --artifact-type bundle --directory {product}/changelog/bundles.
PR numbers are deduplicated across versions (first-wins). Same-version slug collisions append -2, -3; cross-version slug collisions append the sanitized version string. Every notes-{target}.json registry only references files whose target matches that version — the prototype bug where a registry could point to a note file belonging to a different version is fixed here.
| Outcome | Meaning |
|---|---|
ok |
Parsed and wrote bundles successfully. |
empty |
Fetch succeeded but found no ## version headings (e.g. an empty <changelog> stub). |
unavailable |
The page returned HTTP 404 — the URL may have moved. |
failed |
Non-404 HTTP error after retries. The run exits non-zero but other products still complete. |
skipped |
Version filtered by --versions or above the product's cutoff. |
docs-builder changelog backfill --dry-run
docs-builder changelog backfill --products elastic-security,kibana
docs-builder changelog backfill --output /tmp/release-notes-backfill
docs-builder changelog backfill \
--products edot-java \
--versions 1.9.0,1.10.0
docs-builder changelog backfill --products edot-java
docs-builder changelog upload \
--artifact-type bundle \
--directory .artifacts/release-notes-backfill/edot-java/changelog/bundles \
--target s3 \
--s3-bucket-name my-changelog-bundles