Repository navigation
Description
snap journey compare 0.10.0 fails every journey that includes a shared .differences file, and the rule syntax and the include? directive are documented in no README or skill.
I hit this comparing two deployments of the same docs site (a production site as the baseline, a pre-release site as the target) with a handful of journeys in one folder. Some differences come from the environment, not the release, and apply to several journeys. For example, a page links to https://www.elastic.co/training, and on the production site the transcript records that link as {origin}/training.
What happened
1. A shared rules file makes every other journey fail as stale. Each journey's {journey}.differences contains include? shared.differences, and shared.differences holds a rule for one journey's ## snapshot -c -s #markdown-content heading. The journeys that have no such step fail:
Journey differs between baseline and target: .../compare/home.journey
1 rule(s) matched nothing, so they are stale:
.../compare/shared.differences:2: changed link "{origin}/training" -> "https://www.elastic.co/training"
Result: 1 passed, 3 failed. --record <file> has the same effect, because it writes the rules of every journey into one file, so recording once makes all four journeys fail. There is no way to share an environment-wide rule between journeys, short of copying it into every {journey}.differences file.
2. The rule that --record writes does not match the reported difference. The unexplained difference was an extra line in the target transcript:
$[2].text line 2: expected (no line) actual "GET {origin}/static-res/fonts/MierB-Demi.woff2 (Font) 404"
Rules that would explain them (under these headings in a file the rules include, or with --record):
## network requests --failed
changed text # GET https://static-www.elastic.co/v3/ass... -> GET https://static-www.elastic.co/v3/ass...
The suggested rule describes a different, truncated line. It names neither the line that was added nor its font URL, and it uses changed text for an added line.
3. The rules are documented nowhere. None of the READMEs of Nullean.Snapshots.Cli and Nullean.Snapshots.Browser, and none of the skills in those packages, mention .differences, include? or the rule syntax. The only text is the snap journey compare --help summary ("which may include? a file"). I found the heading format (## <step>) and the changed link "a" -> "b" form only by reading failure output. Other rule kinds, how an added or removed line is expressed, whether wildcards are allowed, and where an include? may appear are unknown. (An include? after the first ## section fails with an include goes before the first '##' section.)
How to reproduce
- Put two journeys in one folder,
a.journeyandb.journey, and runsnap journey comparewith--baselineand--targetsites that differ in one step ofaonly. - Write the expected rule for
ainshared.differences, andinclude? shared.differencesin botha.differencesandb.differences. - Run the compare.
apasses, andbfails with1 rule(s) matched nothing, so they are stale.
What would you like instead
- A rule file several journeys can share without the unused rules counting as stale for the journeys that never reach them. For example, only rules whose heading appears in the journey's transcript count, or an include marks its rules as optional.
--recordwriting a rule that explains the difference it reports (an added line as an added line, not a truncatedchanged text), and an option to record into one file per journey.- A documentation page for
.differences: the file layout, every rule kind with an example, where an include goes, how stale rules are reported, and the--recordand--pruneworkflow. It should be linked from the README ofNullean.Snapshots.Cli, and mentioned in the Browser skill so agents find it.
Version
snap 0.10.0 (0.10.0+ed045b34e59df76aaa8a5f0a34938f51655c1635), Nullean.Snapshots.Browser 0.10.0, macOS arm64.
Activity