Skip to content

Parse the wait flags in the library, and refresh the options after the wait - #116

Merged
Mpdreamz merged 1 commit into
mainfrom
wait-spec-and-refresh
Nov 17, 2026
Merged

Mpdreamz merged 1 commit into
mainfrom
wait-spec-and-refresh

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

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

…e wait

JourneyWait.Parse reads the --wait-for flags once for snap and any tool built on
JourneyConsoleRunner. Operators and the attribute separator are found outside quotes
and brackets, so a selector such as a[href='mailto:[email protected]'] needs no escaping.
Preconditions now run before the journeys are planned, and RefreshAfterPreconditions
lets the caller read the site's flags again once the wait is met.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@Mpdreamz Mpdreamz added the feature A new capability (minor bump) label Nov 17, 2026
@Mpdreamz
Mpdreamz merged commit 3fb01c8 into main Nov 17, 2026
14 checks passed
@Mpdreamz
Mpdreamz deleted the wait-spec-and-refresh branch November 17, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new capability (minor bump)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant