Skip to content

Support notes-product-version.json indices - #4120

Merged
Mpdreamz merged 3 commits into
mainfrom
changelog-note-registry-fixes
Nov 4, 2026
Merged

Mpdreamz merged 3 commits into
mainfrom
changelog-note-registry-fixes

Conversation

@lcawl

@lcawl lcawl commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds product-scoped notes indexes that are additive.
To ensure we don't break existing changelog users, the legacy notes-{version}.json keys stay, and {changelog} still does not read those indexes.

Background

Relates to #4090, #4103

Since the related issues touch the same areas of the code and have a significant, overlapping impact, this PR is part of a multi-PR phased approach.

Details

Indexes. The scrubber now writes changelog/{org}/{repo}/notes-{product}-{version}.json (with product and version on the body) and still dual-writes notes-{version}.json as a version union without those fields. Stale product-scoped keys can be deleted; a version-only key is kept while any note still declares that version.

Consumers. changelog bundle GETs the product-scoped URL first and falls back to the version-only URL only on HTTP 404. An empty product-scoped index does not fall back. MergeNotesAsync walks each (product, version) from --output-products and still dedups by checksum.

Docs (same change set). docs/development/changelog-bundle-registry.md, docs/cli/changelog/cmd-note.md, and docs/cli/changelog/cmd-backfill.md.

The dual-write path is in the changelog-scrubber Lambda. It will not show up on the live CDN until that Lambda is deployed.

Generative AI disclosure

  1. Did you use a generative AI (GenAI) tool to assist in creating this contribution?
  • Yes
  • No
  1. If you answered "Yes" to the previous question, please specify the tool(s) and model(s) used (e.g., Google Gemini, OpenAI ChatGPT-4, etc.).

Tool(s) and model(s) used: Cursor Grok 4.6

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: the current product/version notes flow can surface wrong-product notes in both CDN fallback and amend reconciliation paths.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@lcawl
lcawl added this pull request to stack #4123 September 16, 2026 19:49
@lcawl
lcawl force-pushed the changelog-note-registry-fixes branch 3 times, most recently from 0457365 to bf054a0 Compare September 21, 2026 16:06
github-actions Bot added a commit that referenced this pull request Sep 21, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found.


What is this? | From workflow: PR Review

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@lcawl
lcawl force-pushed the changelog-note-registry-fixes branch from cd4534a to 09940a0 Compare September 22, 2026 19:26
@theletterf

Copy link
Copy Markdown
Member

Hi @lcawl, you asked on Slack whether these note issues could be closed. The bugs in #4090 and #4103 are still there on main, so I'd rather finish this stack than drop it. I'm rebasing all three PRs onto current main and force-pushing your branches in a moment.

Nothing in your code changed. Main moved 326 commits since 22 September, and the only conflicts were in tests:

Locally, the solution builds, Elastic.Changelog.Tests (1,730) and Elastic.Documentation.Configuration.Tests (861) pass on each branch, and the lint is clean.

Your phasing from #4103 still applies. Three green PRs are not three mergeable PRs: #4124 must wait until the docs-builder that reads notes-{product}-{version}.json is what CI and changelog bundle use.

Next: CI on all three, then a review. Martijn is back on 3 November.

@theletterf
theletterf force-pushed the changelog-note-registry-fixes branch from 09940a0 to 846557a Compare October 28, 2026 09:50
Comment on lines +1873 to +1875
foreach (var (product, version) in noteTargets)
{
var noteEntries = await FetchCdnNotesAsync(collector, org, repo, noteTarget, ctx);
var noteEntries = await FetchCdnNotesAsync(collector, org, repo, product, version, ctx);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: P3 (Low)

Add a bundling-service regression test with two output products at the same version, using distinct product-scoped indexes, and another case where both fall back to a shared legacy index. The added tests exercise the fetcher and reconciler independently, while existing bundle tests use one output product and legacy indexes. The new product/version iteration and cross-product checksum deduplication therefore have no service-level coverage; reverting to version-only target deduplication would still pass those tests.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

Comment on lines +108 to 112
if (write.Product is not null)
return;
lock (written)
written[version] = sortedEntries;
written[write.Version!] = write.Entries;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: P2 (Medium)

The product-scoped indexes never receive the second-pass bundle_seq update. They are written with every sequence set to 0, but NoteAmendReconciler still rewrites only notes-{version}.json. Consequently, the new indexes permanently report already-shipped and amended notes as unreleased. Update the product-scoped indexes during amend reconciliation as well.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

{
var v = raw!.Trim();
if (v.Contains('/', StringComparison.Ordinal))
if (v.Contains('/', StringComparison.Ordinal) || !ChangelogKeys.IsValidRepo(v))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: P3 (Low)

Using IsValidRepo to validate a release version newly rejects valid SemVer build metadata, such as 9.3.0+build.1. Note creation accepts that version, and the previous reconciler indexed it, but this check now silently excludes the note from both the product index and the legacy version union, as well as amend reconciliation. Preserve the existing version support rather than applying repository-name character restrictions.

Generated by Libra. React with 👍 or 👎 to give feedback on this comment.

@Mpdreamz Mpdreamz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the source and tests. Additive as described: new notes-{product}-{version}.json keys, the legacy key still dual-written with no product/version in its body, and the fetcher falls back to the legacy key on a 404 only. A present-but-empty product index deliberately does not fall back. Product and version segments are validated before they become key parts. One minor note: version segments are now validated with IsValidRepo, which is stricter than the old /-only check, so a version with unusual characters is skipped with a warning instead of indexed. CI and Libra are green.

@Mpdreamz
Mpdreamz merged commit abe1e25 into main Nov 4, 2026
56 of 58 checks passed
@Mpdreamz
Mpdreamz deleted the changelog-note-registry-fixes branch November 4, 2026 13:01
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.

3 participants