Skip to content

Check assembled and rendered bundles with stage rules - #4933

Open
Mpdreamz wants to merge 1 commit into
split/10a-changelog-configfrom
split/10b-bundles
Open

Mpdreamz wants to merge 1 commit into
split/10a-changelog-configfrom
split/10b-bundles

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

The warning for a product listed with several targets and the render command's entry checks move out of two services into rules on two stage types. Output is unchanged. This is PR 10b of the release-notes stack.

Affects: Release notes, Configuration

Stack: 2 of 3 of the release-notes area of #4530, on top of #4929 (10a, configuration), which is on the wave-1 integration branch split/integration-wave1 (foundation #4888; wave 1: #4907, #4900, #4905, #4906, #4903, #4901, #4899, #4902, #4904). Next: 10c (entries and services).

Why

#4530 splits into one pull request per aggregate root. Bundle rules live as collector.EmitWarning and EmitError calls inside BundleBuilder and BundleValidationService, away from the domain.

What

Stage types

AuthoredBundle is the bundle changelog bundle assembles. Its rule reports a product listed with several targets (warning, no file). BundleToRender is the bundle changelog render receives with amend files merged. Its rule walks the entries once and reports, entry by entry, a repeated file name (warning), an entry without title and type, and an entry without products (errors). It is one rule so the report keeps today's interleaved order. A bundle read by BundleLoader is neither stage: the loader skips what it cannot render and says so, and keeps that text. No caller dispatches between the two stages, so there is no union.

Services

BundleBuilder applies AuthoredBundle.WithProducts through AuthoredBundle.Constraints.ApplyDetailed and writes the findings. BundleValidationService takes its findings from BundleLoader.CheckForRender, a thin public wrapper over the internal Check (services cannot run a set; the loader project can). The across-bundle tracking stays in the service and reuses BundledEntry.HasInlineContent and HasProducts so a PR is tracked under the same condition as before.

Why not Loader.For

Bundles are read by BundleLoader, which reports through a warning callback and skips entries. The S7 bundle-loading snapshots lock that, and Loader.For returns no value for an unreadable file where today's callers continue. The bundle read path is unchanged.

Deferred behaviour changes

  • Bundle amend operations (ApplyAmends): order-independence, idempotence and a canonical merge order. Main does not sort amends. BundleAmendMerger stays in the Configuration project.
  • Amend removal rules (entry exists, checksum matches, entry already in bundle): they interleave with --force and the skip logic in ChangelogBundleAmendService.
  • Across-bundle duplicate file and PR warnings in BundleValidationService: they read dictionaries built during the loop and emit after it.
  • R66 (bundle file name), R87, R88 (shared target hint), R17, bundle-has-one-product, release-date text rule (R82), and the LoadedBundle merge changes: each adds a finding or changes order.
  • LoadedBundle constraints and Bundle.Operations are not added: no rule applies today.

Verify

./build.sh unit-test      # 10,001 tests, 0 failed
./build.sh lint
dotnet snap status        # no pending snapshots
dotnet snap orphans
CI=true dotnet test --project tests/Elastic.Changelog.Tests
dotnet test --project tests/Elastic.Documentation.Tests --treenode-filter "/*/*/BundleStageConstraintsTests/*"

No verified file is modified. Mutation: changing the product group threshold and disabling the repeated-file check turned BundleStageConstraintsTests and two existing Changelog snapshot tests red; both were reverted. The AutoTest axes run on AuthoredBundle; BundleToRender has no operation, so only its rule axis runs.

🤖 Generated with Claude Code

Golden compare

Local builds of the isolated docs, the prod assembler site and the codex example site, this branch's head against the wave-1 integration branch (split/integration-wave1: current main plus the nine wave-1 PRs); aggregate counts, the output stays local.

4 paths differ across the three sites. All also differ between two captures of that baseline taken hours apart (159 paths: live OpenAPI specs, the release-notes CDN and the generated llms files), so none of these can be attributed to this change.

Limit: golden cannot show a real change inside those drifting pages.

The warning for a product with several targets and the render command's entry checks were inline in two services. They become rules on two stage types, AuthoredBundle and BundleToRender, so a bundle a loader reads is not held to rules it never had. Output is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
assembler-preview — fbe675e3 Deployed Nov 18, 2026 by github-actions[bot]
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.

1 participant