changelog: restructure S3 layout to artifact-root#3562
Conversation
Move changelog/bundle S3 keys from product-first to artifact-root: bundles are
product-scoped under bundle/{product}/{file}; changelog entries are stored once
per authoring repo under changelog/{repo}/{file}. This decouples repository
concerns (entries) from product concerns (bundles) and removes the developer-
foreknowledge requirement for entry distribution.
- upload: entries -> changelog/{repo}/{file} (repo via --repo > bundle.repo > git
remote); bundles -> bundle/{product}/{file}
- registries: bundle/{product}/registry.json and changelog/{repo}/registry.json;
scope-aware grouping and RegistryKey.IsRegistry validation
- CDN consumers + bundling: repo-scoped entry sourcing, decoupled gate,
ResolveCdnBundleUrl -> bundle/{product}/{file}
- scrubber Lambda: detect bundles by the bundle/ key prefix
- CLI: add --repo/--owner to `changelog upload`; regenerate cli-schema.json
- tests + docs updated; new cloud-shaped profile fixture
Refs elastic/docs-eng-team#413
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Caution Review failedAn error occurred during the review process. Please try again later. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe changelog pipeline now uses Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/development/changelog-bundle-registry.md`:
- Around line 111-112: The producer details section is inconsistent after the
repo-scope update: the bullet that still says “for each product” needs to match
the new changelog-entry path model. Update the affected wording in
changelog-bundle-registry.md so the bullet in the producer details section
refers to repo-scoped entry registries instead of product-scoped processing,
keeping it consistent with the bundle/product and entry/repo grouping described
nearby.
In `@src/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cs`:
- Around line 787-797: Normalize merged bundle repo values before they are used
to build CDN keys in ChangelogBundlingService, not just owner/repo inputs.
Update NormalizeRepo so it also maps combined defaults like elasticsearch+kibana
to the repo segment expected by the repo-scoped CDN layout, and ensure
BundleChangelogs and PlanBundleAsync both use the normalized value when
composing changelog/…/registry.json paths. Keep the behavior for null, empty,
and simple repo names unchanged.
In `@src/services/Elastic.Changelog/Uploading/RegistryKey.cs`:
- Around line 18-21: The RegistryKey validation currently allows dots in both
bundle and changelog registry segments, but bundle product scopes must stay
limited to the bundle upload pattern. Update the matching logic in RegistryKey
so IsRegistry only accepts dot-containing names for the changelog/{repo} form,
while bundle/{product}/registry.json remains restricted to the existing bundle
character class. Keep the regex or segment checks aligned with the scrubber
behavior so unchanged JSON is only passed through for valid bundle or changelog
registry keys.
In `@src/tooling/docs-builder/Commands/ChangelogCommand.cs`:
- Around line 1659-1664: The repo resolution in ChangelogCommand is using the
process current directory, which can pick up the wrong remote when --config or
--directory targets another checkout. Update the logic around
GitRemoteConfigurationReader.TryReadOriginUrl, Paths.FindGitRoot, and
resolvedRepo to derive the git root from the upload source (configPath or upload
directory) first, and only fall back to Directory.GetCurrentDirectory() when no
source-specific root is available. Ensure the repo lookup still flows through
GitHubRemoteParser.TryParseGitHubComOwnerRepo and the existing
repoCli/bundleConfig fallback order.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 5adba39d-1fdc-491f-ada6-5aefa9463e1b
📒 Files selected for processing (25)
docs/cli-schema.jsondocs/cli/changelog/cmd-upload.mddocs/contribute/configure-changelogs-ref.mddocs/development/changelog-bundle-registry.mdsrc/Elastic.Documentation.Configuration/ReleaseNotes/CdnChangelogEntryFetcher.cssrc/Elastic.Documentation.Configuration/ReleaseNotes/CdnChangelogFetcher.cssrc/Elastic.Documentation.Configuration/ReleaseNotes/ChangelogRegistry.cssrc/Elastic.Markdown/Myst/Directives/Changelog/ChangelogBlock.cssrc/infra/docs-lambda-changelog-scrubber/Program.cssrc/infra/docs-lambda-changelog-scrubber/README.mdsrc/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cssrc/services/Elastic.Changelog/Uploading/ChangelogUploadService.cssrc/services/Elastic.Changelog/Uploading/Registry.cssrc/services/Elastic.Changelog/Uploading/RegistryBuilder.cssrc/services/Elastic.Changelog/Uploading/RegistryKey.cssrc/tooling/docs-builder/Commands/ChangelogCommand.cstests/Elastic.Changelog.Tests/Changelogs/BundleCdnSourcingTests.cstests/Elastic.Changelog.Tests/Changelogs/BundlePlanTests.cstests/Elastic.Changelog.Tests/Changelogs/CloudProfileFixtureTests.cstests/Elastic.Changelog.Tests/Changelogs/LinkAllowlistSanitizerTests.cstests/Elastic.Changelog.Tests/Uploading/ChangelogUploadServiceTests.cstests/Elastic.Changelog.Tests/Uploading/RegistryBuilderTests.cstests/Elastic.Changelog.Tests/Uploading/RegistryKeyTests.cstests/Elastic.Documentation.Configuration.Tests/ReleaseNotes/CdnChangelogEntryFetcherTests.cstests/Elastic.Documentation.Configuration.Tests/ReleaseNotes/CdnChangelogFetcherTests.cs
- RegistryKey: scope dot characters to changelog/{repo} segments; bundle product
segments stay [a-zA-Z0-9_-]+ (matches producer validation), so the scrubber no
longer passes through bundle/foo.bar/registry.json
- CLI upload: anchor the git-remote repo fallback to the --config/--directory
source rather than the process cwd, so an out-of-tree config resolves the right origin
- docs: fix the producer-details bullet to describe repo-scoped entry registries
- condense private-method XML doc summaries to a single line
Skipped CodeRabbit's NormalizeRepo '+' suggestion: the config loader already
rejects '+' in bundle.repo, so merged values never reach key construction.
Refs elastic/docs-eng-team#413
Co-authored-by: Cursor <cursoragent@cursor.com>
Per the docs-builder boolean-parameter rule, pass useLocalChangelogs/ explicitDirectory (ShouldSourceFromCdn) and allowDots (IsValidSegment) as named arguments at their call sites. Refs elastic/docs-eng-team#413 Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
bundle/{product}/{file}; changelog entries are stored once per authoring repo atchangelog/{repo}/{file}. This decouples repository concerns (entries) from product concerns (bundles) and removes the developer-foreknowledge requirement for entry distribution.changelog upload): entries keyed by repo (--repo>bundle.repo> git remote), bundles keyed by product; scope-awareregistry.jsonandRegistryKey.IsRegistry.ResolveCdnBundleUrl->bundle/{product}/{file}.bundle/key prefix (the old/bundle/substring check silently breaks under the new layout).--repo/--ownertochangelog upload;docs/cli-schema.jsonregenerated.elastic/cloud-shaped profile fixture.Part of the changelog folder restructure. Refs elastic/docs-eng-team#413. Companion PRs in
elastic/docs-actionsandelastic/docs-infra.Important
Org CI consumes docs-builder via
edge, so this propagates to all consumers on release — deploy the scrubber Lambda in lockstep. End-to-end CDN smoke (bundle-fetch/{changelog} cdn:) only validates after the first publish under the new layout.Test plan
dotnet formatclean./build.sh build --skip-dirty-check(lint + compile) cleanElastic.Changelog.Tests(760) andElastic.Documentation.Configuration.Tests(416) greendocs/cli-schema.jsonstable vs. regenerated (CI schema check)Made with Cursor