Fix authoring repo on bundle products - #4061
Conversation
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/4061/ Sample changed pages: |
|
@copilot Investigate and fix the CI failures. |
The authoring repo fallback now writes `repo:` into bundles and can switch amend tests to CDN sourcing in CI. The test expectations and local amend inputs must match that behavior to keep the suite deterministic. Co-Authored-By: Claude <noreply@anthropic.com>
Fixed in |
There was a problem hiding this comment.
🟡 Changes recommended
Repo resolution is applied only when building the bundle products, leaving other repo-dependent logic in the same run still using the unresolved input.Repo, which can cause inconsistent behavior when repo is omitted from CLI/config.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes changelog bundle output so products[].repo reflects the authoring GitHub repository (the checkout/bundle filename convention) rather than the docs catalog products.yml repository: value, preventing incorrect default PR/issue link resolution for bundled products.
Changes:
- Stop resolving per-product repo from the product catalog; instead stamp the authoring repo onto every bundled product.
- Resolve the authoring repo for bundling (via CLI/config/env/git origin) and update unit/e2e tests to validate the new behavior.
- Update CLI/config documentation to clarify what
bundle.repoand profilerepomean and how they affect output.
File summaries
| File | Description |
|---|---|
| tests/Elastic.Changelog.Tests/Changelogs/BundleChangelogsTests.cs | Adds an end-to-end-style test asserting bundles write the authoring repo even when the catalog maps the product to a different repository. |
| tests/Elastic.Changelog.Tests/Bundling/BundleBuilderPerProductRepoTests.cs | Updates unit tests to reflect stamping the authoring repo on all products and the new null behavior when repo can’t be resolved. |
| src/services/Elastic.Changelog/Bundling/ChangelogBundlingService.cs | Passes a resolved authoring repo into BundleBuilder and removes catalog dependency from the bundle build call. |
| src/services/Elastic.Changelog/Bundling/BundleBuilder.cs | Removes catalog-based per-product repo resolution and stamps the provided authoring repo on each bundled product. |
| src/Elastic.Documentation.Configuration/Changelog/BundleConfiguration.cs | Updates BundleProfile.Repo docs/obsolete messaging to reflect new repo derivation behavior. |
| docs/data/release-notes/configure-ref.md | Clarifies semantics and precedence of bundle.repo and profile repo, and that products[].repo is authored-repo based. |
| docs/cli/changelog/cmd-bundle.md | Clarifies conventional output filename derivation and repo resolution precedence. |
| config/changelog.example.yml | Updates example comments to align with new meaning of profile repo. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| var buildResult = bundleBuilder.BuildBundle( | ||
| collector, | ||
| filteredEntries, | ||
| input.OutputProducts, | ||
| input.Repo, | ||
| BundleOutputNaming.ResolveRepo(_fileSystem, input.Config, _env, input.Repo), |
| /// GitHub repository name for link and file name generation. | ||
| /// <para> | ||
| /// <b>Deprecated.</b> Per-product repo is now resolved from <c>products.yml</c> via the | ||
| /// product's <c>repository:</c> field, making the bundle-level override redundant. | ||
| /// Remove from profile config; a mismatch with the running repository is a hard error. | ||
| /// <b>Deprecated.</b> Derived from <c>GITHUB_REPOSITORY</c> or git <c>origin</c> when omitted. | ||
| /// </para> | ||
| /// </summary> |
Summary
Fixes #4060
Details
products[].repois now the authoring GitHub repo (same resolution as the bundle filename), notproducts.ymlrepository:.Code
BundleBuilderstamps therepoargument on every product. It no longer reads the product catalog.ChangelogBundlingServicefills that argument with--repo/ profile /bundle.repo, thenGITHUB_REPOSITORY/ git origin.GetProductsByRepositoryName,repository: cloud) is unchanged.Tests and docs
BundleBuilderPerProductRepoTestsnow expect authoring repo (includingcloud-serverless+elasticsearch).BundleChangelogs_ServerlessProfile_WritesAuthoringRepoNotCatalogRepositoryuses a catalog withrepository: cloudand assertsrepo: elasticsearch.cmd-bundle.md,configure-ref.md,changelog.example.yml, and theBundleProfile.Repocomment.Tests
Related to elastic/elasticsearch#158728, I ran the following command:
docs-builder changelog bundle serverless-release 2026-09-08 "./docs/temp/Elasticsearch serverless Promotion Report.html"Before this PR, it generated a bundle that contained the following:
After this PR, it contains the correct repo name:
Generative AI disclosure
Tool(s) and model(s) used: Cursor Grok 4.6