Skip to content

Preview Serverless and Elastic Cloud Hosted release notes before they ship - #5011

Merged
Mpdreamz merged 8 commits into
mainfrom
feature/publish-previews-unified-release
Nov 23, 2026
Merged

Mpdreamz merged 8 commits into
mainfrom
feature/publish-previews-unified-release

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

changelogs.elastic.dev can now show the release notes of Kibana and Elasticsearch Serverless and of Elastic Cloud Hosted before a promotion ships them. release preview bundle and release preview build replace the two release unified ... preview calls that the hourly workflow makes today.

Affects: Release notes, CLI, Isolated builds

Prompt summary: The DRA products already get a preview on changelogs.elastic.dev. Do the same for the serverless releases (Kibana and Elasticsearch) and for ECH, which today get release notes only after a promotion completes.

Why

Serverless and ECH bundles are built when the last production slice finishes. Writers cannot see or fix those notes while the changes are still on staging or on main.

What

One entry point for the preview site

release preview bundle bundles the DRA products through the existing unified code, then each serverless service. release preview build builds the site with the serverless products added. The unified and serverless commands keep their behaviour: a release unified build preview of the same bundles gives the same site before and after.

Two releases per serverless product

Each service is bundled as the commits since the version in production, up to the version on its staging slice (Staging) and up to the head of its base branch (HEAD). A release with no changes has no bundle. Kibana and Elasticsearch share the cloud-serverless section, and ECH gets cloud-hosted. ServerlessPromotion.PlanPreview decides the ranges.

Same bundles as publication

release preview build scrubs each bundle like the scrubber Lambda does: a reference to a repository that assembler.yml marks private is removed from the entries and from their text. release unified build is unchanged.

Safe re-runs

A service writes its bundles aside and replaces the earlier ones only when both its ranges succeed. A range with no notes is skipped.

Shared bundler

The code that bundles a service range and its submodules moves from release serverless into ServerlessBundler (first commit). A dry run for Kibana gives the same 522-line report before and after.

Verify

dotnet test --project tests/Elastic.Changelog.Tests --treenode-filter "/*/*/ServerlessPromotionTests/*"
dotnet test --project tests/Elastic.Documentation.Build.Tests --treenode-filter "/*/*/UnifiedReleaseNotesTests/*"
GITHUB_TOKEN=$(gh auth token) docs-builder release preview bundle --services kibana --products kibana --output-dir bundles
docs-builder release preview build --bundles-dir bundles --output site

Out of scope: The workflow change (elastic/docs-internal-workflows#1262), the token policy (elastic/catalog-info#5072) and the page for writers (elastic/docs-release-notes#17) are separate PRs.

Risk: GitHub's compare endpoint can answer 422 "taking too long to generate" on a cold elastic/cloud range, as it did for ECH HEAD (290 commits). #5012 compares such a range in stages. Merge it before the workflow change, or a run can fail on a cold ECH range. The published site stays unchanged when a run fails.

Mpdreamz and others added 2 commits November 23, 2026 16:25
The bundling of a service range and its submodules now lives in ServerlessBundler, so a second command can reuse it. The command behaves as before: a dry run against Kibana gives the same report.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
changelogs.elastic.dev only showed DRA products. release preview bundle now also bundles each serverless service as Staging (the version on its staging slice) and HEAD (the base branch), both against the version in production. release preview build puts them on the site under cloud-serverless and cloud-hosted. The unified commands are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner November 23, 2026 15:25
@Mpdreamz
Mpdreamz requested a review from akira28 November 23, 2026 15:25
@github-actions

Copy link
Copy Markdown
Contributor

The new release preview commands add entries to docs/cli-schema.json. The CLI reference nav gains one toggle input, so the home and content-page a11y snapshots count 29 nodes instead of 28.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A range with no release notes is now skipped instead of failing the run, the serverless bundles can be written outside the git root like the DRA ones, and a reused output folder loses the bundles a service no longer produces. release preview build reads the bundles on disk and no longer needs the release schedule. The feedback a11y baselines gain the toggle that the CLI reference nav now has.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
{
string[] serverlessProducts = [.. ServerlessPromotion.Services.Values.Select(s => s.Product).Distinct(StringComparer.Ordinal)];
return await Unified.BuildSiteAsync(
null,

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 command-level test that builds from serverless-only bundles with the release schedule unavailable. The new tests call the build service directly, so they would still pass if this argument changed back to "preview" and the CLI started depending on the schedule again.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did not add a unit test. The command classes are internal to the tooling assembly, and a test would need the schedule URL to fail, which means an HTTP seam in production code just for it. I checked it by running release preview build offline instead (HTTPS_PROXY pointing at a closed port): release unified build preview fails with Connection refused on past-releases.json, and release preview build builds the site with the Staging and HEAD pages. Say so if you want the seam.

Mpdreamz and others added 2 commits November 23, 2026 17:11
The notes of the command changed in the last commit without the schema.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ood bundles

release preview build now scrubs every bundle with the scrubber and allowlist that publication uses, so the preview shows what will be published. A service writes its preview bundles aside and replaces the earlier ones only when both ranges succeed. The empty-range skip that the last commit meant to add is now set on the request.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment on lines +183 to +184
if (options.ScrubBundle is { } scrub)
content = await scrub(product.Id, fileName, content, 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)

A malformed YAML file can abort the entire preview even after BundleLoader has rejected it with a warning. The scrub pass reads every file again if the folder has at least one valid bundle, so the same bad file is ignored when it is alone but fatal when a valid sibling is present. Scrub only files that can participate in rendering, including valid amend files.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not changing this. A file that the loader rejects is still copied into the docset folder, so failing the build when it cannot be scrubbed is the safe side. The bundler never writes a malformed file, so this only fires when something is wrong in the bundles folder, and then a site that does not update is better than one that might show unscrubbed text.

Comment on lines +189 to +233
// The bundles of a run are written aside and replace the earlier ones only when every range has finished. A failed
// comparison then leaves the last good bundles in place, and not a Staging bundle next to a missing HEAD one.
var pending = new DirectoryInfo(Path.Combine(rootOutput.FullName, "preview-pending", svc.Id));
if (pending.Exists)
pending.Delete(true);
_ = Directory.CreateDirectory(pending.FullName);
try
{
foreach (var target in targets)
{
_logger.LogInformation(
"Previewing '{Service}' as {Label}: {Start}..{End}",
svc.Id,
target.Label,
target.StartRef,
target.EndRef
);
var request = new ServerlessBundleRequest(svc, target.StartRef, target.EndRef, target.Label, pending)
{
OnEmptyRange =
() => _logger.LogInformation(
"'{Service}' has no release notes between {Start} and {End}, so it has no {Label} page.",
svc.Id,
target.StartRef,
target.EndRef,
target.Label
)
};
var result = await bundler.BundleAsync(request, ctx);
if (!result.Success)
return false;
}

ReplaceBundles(svc, rootOutput, pending);
return true;
}
finally
{
pending.Delete(true);
if (pending.Parent is { Exists: true } parent && !parent.EnumerateFileSystemInfos().Any())
parent.Delete();
}
}

// A reused output folder may hold the bundles of an earlier run, such as a Staging release that production has caught up with.

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)

No test covers the new staged write in BundleServiceAsync/ReplaceBundles. Its main promise is that a failed range keeps the last good Staging/HEAD bundles, while a successful run (or one with nothing to preview) replaces only this service's files in the shared cloud-serverless folder. The empty-range change (OnEmptyRange instead of an error) is untested too. A later edit could delete the previous bundles before a failure, or remove the other service's bundles, and nothing would catch it. Move the replace logic into a helper that takes the paths as input, and test it with a mock filesystem: the failure case, the empty case, and two services that share a product folder.

Generated by Libra. Specialist: libra-complexity. React with 👍 or 👎 to give feedback on this comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 0e2b19f. The replace step is ServerlessPreviewBundles.Replace, with tests on temp folders for new files replacing old ones, a service with nothing left, two services in one product folder, and no empty folder left behind. Deleting every file of the folder, or not deleting the earlier bundles, each fails two of them. The rule that a failed range keeps the last good bundles lives in the command: it calls Replace only after every range succeeded. That part has no test, because the command classes are internal. The empty-range callback has none either.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The helper tests cover replacement with no pending files, but they do not exercise the two remaining behaviors you call out: the command returns on a failed range before calling Replace, and the OnEmptyRange callback is installed on each request. Those paths are visible in BundleServiceAsync; the tests exercise Replace itself (tests). So the shared-folder and removal cases are covered, while the original failure-path and empty-range-callback coverage concerns remain.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed that these two paths have no test, as said in the earlier reply: they sit in an internal command class that needs the GitHub API. The replace rules are covered, and the live Kibana run exercised the failure-free path. Leaving it.

…mises

The replace step moves into ServerlessPreviewBundles with tests for the first run, a service that has nothing left, and two services in one product folder. Each run uses its own scratch folder. The scrub test now renders a description that holds a private reference. The help text names the references the scrubber recognizes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Comment on lines +110 to +111
/// <c>assembler.yml</c> marks private is removed from the entries and from their text. Other links, such as to a repository, a commit
/// or a comparison, are not recognized and stay as written, as they do in publication.

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)

Qualify “other links … stay as written” as applying to free text. In prs or issues, a repository URL is checked against the allowlist, and a commit or comparison URL can fail the build rather than pass through.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fair, the sentence is about free text. In the prs and issues lists a commit or comparison URL can fail the build, which is the safe side. Not changing the wording in this PR.

products:
- product: kibana
target: 9.5.0
repo: edot-cloud-forwarder-aws

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)

Use a synthetic private repository in test-owned assembler config, or derive the name from the loaded config. Hard-coding a real repo here makes both Follows assertions fail if that repo is renamed or made public, even though scrubbing still works.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

True, the fixture depends on edot-cloud-forwarder-aws staying private in assembler.yml. A test-owned config would be sturdier. Leaving it for now, because a rename fails loudly in the two scrubber tests.

@Mpdreamz
Mpdreamz merged commit 7868e47 into main Nov 23, 2026
44 checks passed
@Mpdreamz
Mpdreamz deleted the feature/publish-previews-unified-release branch November 23, 2026 17:06
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