Skip to content

Wait for the deployed build before post-deploy journeys run - #4885

Merged
Mpdreamz merged 7 commits into
mainfrom
feature/demo-environment-failing-deploy
Nov 17, 2026
Merged

Mpdreamz merged 7 commits into
mainfrom
feature/demo-environment-failing-deploy

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

docs-journeys run takes --build and --wait-for and holds the run until the site shows the expected value. The landing page of an assembler build now carries a docs:build tag 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-paths at 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 +sha suffix. The workflow already derives the same string from docs-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-for is the general form: header:Name==value, selector==value (text) or selector@attribute==value, with =~ for a regular expression and =* for contains. --wait-path, --wait-timeout (10 s), --wait-interval and --wait-retries tune it. An unmet wait runs no journey, writes a failed preconditions/wait case to the JUnit file, and exits with 4. docs-journeys does not parse the checks: JourneyWait.Parse in Nullean.Snapshots 0.18.0 does, for snap and 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 @requires and feature blocks against what is live. The context line is printed again when it changed.

Dependencies and retries

Nullean.Snapshots.*, Nullean.HttpFileParser and the snap tool move to 0.18.0, Nullean.Cdp* to 0.13.0. --retries from 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-workflows does not pass --build yet; that is a separate PR in that repository.

Verify

mise run test
mise run journeys:synth demo --build 1.74.1 --wait-timeout 3s   # demo has no tag yet: exit 4, "last saw nothing"

mise run journeys:test passes except ApiExampleScrollingTests.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.

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]>
@Mpdreamz
Mpdreamz requested a review from a team as a code owner November 16, 2026 21:29
@Mpdreamz
Mpdreamz requested a review from reakaleek November 16, 2026 21:29
Comment thread docs/development/journeys.md Resolved
@github-actions

Copy link
Copy Markdown
Contributor

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]>
@Mpdreamz Mpdreamz changed the title Retry a failed post-deploy journey once and report it as flaky Wait for the deployed build before post-deploy journeys run Nov 17, 2026
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]>
Mpdreamz added a commit to nullean/snapshots that referenced this pull request Nov 17, 2026
…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]>
Mpdreamz and others added 2 commits November 17, 2026 13:29
… 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

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)

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.

Mpdreamz and others added 2 commits November 17, 2026 13:38
The journeys plan job fails when a test class is missing from shards.json.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz
Mpdreamz merged commit 19de586 into main Nov 17, 2026
44 checks passed
@Mpdreamz
Mpdreamz deleted the feature/demo-environment-failing-deploy branch November 17, 2026 12:50
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.

2 participants