Repository navigation
Wait for the deployed build before post-deploy journeys run - #4885
Conversation
Two journey runs against demo and edge each stalled once on a 30 s navigation wait and failed the deploy workflow. A rerun passed both. docs-journeys run takes --retries, and Nullean.Snapshots 0.16.0 and Nullean.Cdp 0.12.0 report a retried pass as flaky and name the requests in flight when a navigation wait times out. 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/4885/ Sample changed pages: |
The landing page of an assembler build carries a docs:build tag with the docs-builder version that rendered it. docs-journeys run takes --build and --wait-for, and holds the run until the site shows the expected value, so a deploy that did not land or a cache that did not clear ends the run once, with exit code 4, instead of failing journeys one by one. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The journeys plan job fails when a test class is missing from shards.json. The new wait tests are tool tests, so they join the http-and-tool shard. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…e wait (#116) ## Why Review of the first consumer (elastic/docs-builder#4885) found two gaps in #115. - The `--wait-for` syntax was parsed inside `snap`'s CLI, so a tool built on `JourneyConsoleRunner` had to copy it. docs-builder did, and the copy had the same bug: it split a selector at any `@`, so `a[href='mailto:[email protected]']==Contact` became an invalid selector plus an attribute. Quoted text could also hold an operator. - A tool reads the site's feature flags and build type before the run. A deploy that the wait is for can change them, so journeys ran against the previous build's flags. ## What - `JourneyWait.Parse(JourneyWaitFlags)` returns a `JourneyWaitParse` (preconditions, or a plain-text problem). `snap journey run` / `compare` call it, and so can any tool. The operators `==`, `=~` and `=*` and the attribute `@` are found outside quotes and brackets. - Preconditions now run before the journeys are planned, and `JourneyRunOptions.RefreshAfterPreconditions` returns the options the run uses once the wait is met, so `@requires`, `feature` blocks and the skips use the refreshed flags. Without preconditions nothing changes. The wait now also happens when every journey would be skipped. - Additive public API, accepted in the snapshot. Docs and DECISIONS.md updated. ## Verification Full suite passes (1297). New tests cover quoted `@` and quoted operators, the options, bad input, the refresh (a journey skipped before it runs after it), no refresh when a wait is unmet, and the wait happening first. Reverting the `@` rule to a plain last-`@` split made two tests fail; restored. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <[email protected]>
… the wait docs-journeys no longer parses --wait-for: Nullean.Snapshots 0.18.0 does, once, for snap and for this tool, and handles an @ or an operator inside a quoted selector. After the wait is met the run reads the site's flags and build type again, so a deploy that changes them is judged against what is live. Process tests now cover --retries (recovered, exhausted, default) and the refresh. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…etries Completes the previous commit, which held only the deletion of WaitOptions.cs. docs-journeys takes the wait checks from JourneyWait.Parse (Nullean.Snapshots 0.18.0), including an @ or an operator inside a quoted selector. After the wait is met it reads the site's flags and build type again, so a deploy that changes them is judged against what is live. Process tests cover --retries (recovered, exhausted, default) and the refresh; the retries docs no longer say a workflow uses them. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
| ) | ||
| { | ||
| var baseUrl = SiteContext.ParseUrl(url); | ||
| var wait = JourneyWait.Parse(new JourneyWaitFlags |
There was a problem hiding this comment.
Severity: P3 (Low)
Parsing moved from WaitOptions into the library's JourneyWait.Parse, and the usage error for --wait-timeout/--wait-path with no check now says only "describe a --wait-for; give one". The library never sees --build, which this tool folds into Checks. The message no longer mentions --build, the option the post-deploy workflows are meant to use, and the test was weakened to match. Keep the --build hint, for example by checking for this case before calling the library or by rewording the message.
Generated by Libra. Specialist: libra-complexity. React with 👍 or 👎 to give feedback on this comment.
…ently Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The journeys plan job fails when a test class is missing from shards.json. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
docs-journeys runtakes--buildand--wait-forand holds the run until the site shows the expected value. The landing page of an assembler build now carries adocs:buildtag with the docs-builder version that rendered it.Affects: Deploys & previews, Site UI
Prompt summary: The demo and edge deploy workflows failed on a post-deploy journey that stalled once and passed on a rerun. The ask is to wait for the deploy to show the expected version instead of retrying. That also flags a deploy that went through but did not land, or whose cache was not cleared. The wait is a native runner precondition with its own timeout and retries.
Why
Demo and edge each failed
navigation/main-pathsat the same minute, on different steps, after a successful deploy. A rerun passed. The run cannot tell a stall from a deploy that is not live yet, and the site shows no version, so a workflow has nothing to wait for.What
A version tag on the landing page
The landing page of an assembler build renders
<meta name="docs:build" content="1.74.1-canary.0.3">, the docs-builder version without the+shasuffix. The workflow already derives the same string fromdocs-builder --version. Other pages, and isolated and Codex builds, are unchanged. Only one page carries it because a value in every page would change every page on each version and the S3 sync would upload them all.The wait
--build <version>waits for that tag.--wait-foris the general form:header:Name==value,selector==value(text) orselector@attribute==value, with=~for a regular expression and=*for contains.--wait-path,--wait-timeout(10 s),--wait-intervaland--wait-retriestune it. An unmet wait runs no journey, writes a failedpreconditions/waitcase to the JUnit file, and exits with 4.docs-journeysdoes not parse the checks:JourneyWait.Parsein Nullean.Snapshots 0.18.0 does, forsnapand for this tool, and it reads an@or an operator inside a quoted selector as part of the selector.The site is read again after the wait
The site context (feature flags, build type) is read before the wait. A deploy the wait is for can change it, so once the wait is met the run reads it again and judges
@requiresandfeatureblocks against what is live. The context line is printed again when it changed.Dependencies and retries
Nullean.Snapshots.*,Nullean.HttpFileParserand thesnaptool move to 0.18.0,Nullean.Cdp*to 0.13.0.--retriesfrom the earlier commits stays as an option, but nothing here uses it.Risk: the tag holds the docs-builder version, not the content. A content-only deploy that keeps the version shows the old value and passes at once, so the wait proves the toolchain deployed, not the content.
Out of scope:
docs-internal-workflowsdoes not pass--buildyet; that is a separate PR in that repository.Verify
mise run journeys:testpasses exceptApiExampleScrollingTests.Request_ScrollingSideways_KeepsLineNumbersAndNoteInPlace. That test takes 4 to 5 minutes and sometimes hits its 300 s HTTP timeout. It also took 4 m 17 s on the unmodified branch, so the dependency bump probably did not cause it, but I did not rule that out.