Repository navigation
Preview Serverless and Elastic Cloud Hosted release notes before they ship - #5011
Conversation
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]>
Docs preview (local build)Handbook preview: https://docs-v3-preview.elastic.dev/elastic/docs-builder/pull/5011/ |
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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]>
| if (options.ScrubBundle is { } scrub) | ||
| content = await scrub(product.Id, fileName, content, ctx); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| // 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]>
| /// <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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 bundleandrelease preview buildreplace the tworelease unified ... previewcalls 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 bundlebundles the DRA products through the existingunifiedcode, then each serverless service.release preview buildbuilds the site with the serverless products added. Theunifiedandserverlesscommands keep their behaviour: arelease unified build previewof 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-serverlesssection, and ECH getscloud-hosted.ServerlessPromotion.PlanPreviewdecides the ranges.Same bundles as publication
release preview buildscrubs each bundle like the scrubber Lambda does: a reference to a repository thatassembler.ymlmarks private is removed from the entries and from their text.release unified buildis 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 serverlessintoServerlessBundler(first commit). A dry run for Kibana gives the same 522-line report before and after.Verify
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/cloudrange, 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.