tagreeve 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +3 -1
- package/dist/cli.js +28 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.2
|
|
4
|
+
|
|
5
|
+
`npm i -g tagreeve` installs this release. 0.9.2 is a patch release after 0.9.1. It has no new command, option or record field. The record stays at schema version 5. A 0.9.1 record reads as before.
|
|
6
|
+
|
|
7
|
+
### Fixes in 0.9.2
|
|
8
|
+
|
|
9
|
+
- `pinterest-capi`: a `body.only` rule no longer fails on the five transport fields of the call (#1662, #1677).
|
|
10
|
+
- Baseline: a gcd letter split with a count change is now a count change in the baseline, not drift (#1599, #1678).
|
|
11
|
+
- Variables: an undeclared `{name}` inside a variable value prints a warning on stderr. The run still exits as before (#1673, #1676).
|
|
12
|
+
- Cleanups to tests and comments for the hash label guard. No behaviour change (#1600, #1675).
|
|
13
|
+
|
|
14
|
+
### Upgrading from 0.9.1
|
|
15
|
+
|
|
16
|
+
- **A `body.only` rule on `pinterest-capi` that failed now passes.** The rule failed on the five transport fields of the call. A suite that was red for that reason turns green.
|
|
17
|
+
- **A gcd letter split with a count change is no longer drift.** A `run --baseline` that exited 1 for it now passes. The related split case still reports drift (#1599).
|
|
18
|
+
- **A new warning line on stderr.** A run with an undeclared `{name}` in a variable value that the start URL or a visit path uses prints it. The exit code and stdout do not change. A script that treats any stderr output as a failure sees it.
|
|
19
|
+
- **A new release needs a new server image.** On arm64 (Apple silicon), run `tagreeve server-container build` after `npm i -g tagreeve`. A run with `--server-container` exits 2 with "The image tagreeve-sgtm:<version> is not available" until the image for that version exists. On amd64 the command builds nothing.
|
|
20
|
+
|
|
21
|
+
### Known in 0.9.2
|
|
22
|
+
|
|
23
|
+
Issues still open that you can meet, in addition to those in 0.7.0:
|
|
24
|
+
|
|
25
|
+
- The canary search reads only the forms it lists. It skips gzip and binary bodies, bodies cut at 64 KiB and net-log requests with no body, and it does not search headers. A pass means no planted value was found in the searched forms.
|
|
26
|
+
- The Stape loader unwrap covers `/g/collect` and `/data`. Stape's hosting layer may act on a loader request in other ways, and the record says so in fixed text.
|
|
27
|
+
- A gcd letter split of a gone tuple into two new variants still reports drift (#1599).
|
|
28
|
+
- The two vendor name tables, `VENDOR_NAMES` and `HASH_REQUIRED_VENDORS`, are still separate (#1485). A guard test fails when a vendor in the second has no label.
|
|
29
|
+
|
|
3
30
|
## 0.9.1
|
|
4
31
|
|
|
5
32
|
`npm i -g tagreeve` installs this release. 0.9.1 is a patch release after 0.9.0. It has no new command, option or record field. The record stays at schema version 5. A 0.9.0 record reads as before.
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
Agent-first testing for tags and consent. Tagreeve plays a visitor in a real browser, records every tracking hit the site sends, and checks the result against what you expect. Web tag reports (which GTM web tags fired) come from a GTM template you install. Server tag reports are planned.
|
|
11
11
|
|
|
12
|
-
> **Status: 0.9 (`0.9.
|
|
12
|
+
> **Status: 0.9 (`0.9.2`).** Tagreeve plays a visitor in Chromium, records and decodes hits, answers the consent banner, checks YAML expectations and writes a JSONL record. 0.3 adds rules on payload fields and cookies, a `deniedIdentifiers` check, `tagreeve suite`, an HTML report, a Done control for handoff steps, role-based locators and a `select` step. 0.4 adds handoffs that end by themselves, an opt-in test payment step, baselines, a viewport option and fake identities by country. 0.5 adds `--server-container`, which runs your own server container in Docker and records what it sends to each vendor, a Conversions API decoder, several stores in one suite and platform hosts for Shopify. 0.6.0-rc.1 adds path defaults, `tagreeve init`, `tagreeve/config.yml`, `--label`, default baseline paths and `suite --baseline`, exact links between server container calls and browser hits by client ID, and the frame of each `dataLayer` push. 0.6.0-rc.2 adds web tag reports, `tagreeve template web`, `tag` rules, `expectedTags`, masked `dataLayer` push shapes in `diff` and baselines, and the `consentModeSetup` check. 0.6.0-rc.3 fixes the reporter in real GTM, keeps the `dataLayer` hook working when a page replaces `push`, adds push kinds and a `dataLayerIncomplete` flag, and sends handoff text to stderr. 0.6.0 is rc.3 with the release prep and no code change; it was field-tested on a real store with a real GTM web container in a workspace preview (rc.2 and rc.3). 0.7.0 adds the `earlyIdentityPush`, `idHandover` and `serverContainerRejected` checks and `dataLayer:` rules. 0.8.0-rc.1 adds a consent audit: `suite --consent`, identifier canaries and the `identifierRoute` check. 0.8.0 is rc.4 with the release prep and no code change; it was field-tested on a real Shopify store with a first-party server container (rc.1 to rc.4). 0.9.0-rc.1 fixes server container links, canaries, consent matrix names and `dataLayer` loaders, and decodes Pinterest Conversions API calls. 0.9.0 is rc.1 with the release prep and no code change; it was field-tested on a real store with no regressions. 0.9.1 fixes nested variables and the transform of a padded digest. 0.9.2 fixes a `pinterest-capi` `body.only` rule and a baseline gcd split, and warns on an undeclared `{name}` in a variable value. The rest of this README describes where Tagreeve is going, and marks what is not built yet. The design is in [docs/design.md](docs/design.md). Feedback is welcome in issues.
|
|
13
13
|
>
|
|
14
14
|
> **In 0.1:** `tagreeve run` with `stub` and `live` network modes; consent epochs, with withdrawals labelled apart from first rejects; seeded fake identities, hash checks and leak detection; decoders for GA4, Google Ads, Meta, Stape custom loader and a minimal server-container data client; banner handling through autoconsent; expectations; JSONL output.
|
|
15
15
|
>
|
|
@@ -17,6 +17,8 @@ Agent-first testing for tags and consent. Tagreeve plays a visitor in a real bro
|
|
|
17
17
|
>
|
|
18
18
|
> **In 0.3:** `body.has` and `body.only` rules on the field names of a hit; `cookie` rules; a `deniedIdentifiers` check that fails when an identifier goes out on a denied hit; `tagreeve suite` runs a folder of scenarios against several GTM builds; `tagreeve report` writes an HTML report of one run or a suite; a Done button in the handoff window; `click` and `wait` by role and name or from a list of selectors; a `select` step; the `server` network mode; record schema version 2. `deniedIdentifiers` fails by default, so a run that passed in 0.2 can exit 1. See [CHANGELOG.md](CHANGELOG.md).
|
|
19
19
|
>
|
|
20
|
+
> **In 0.9.2:** a patch release after 0.9.1, with no new command, option or record field. A `body.only` rule on `pinterest-capi` no longer fails on the five transport fields. A gcd letter split with a count change is no longer drift in a baseline, so a `run --baseline` that exited 1 for it passes. An undeclared `{name}` in a variable value prints a warning on stderr. The record stays at schema version 5, and a 0.9.1 record reads as before. `npm i -g tagreeve` installs it. On arm64, run `tagreeve server-container build` after the upgrade. What is new is in [CHANGELOG.md](CHANGELOG.md) under 0.9.2.
|
|
21
|
+
>
|
|
20
22
|
> **In 0.9.1:** a patch release after 0.9.0, with no new command, option or record field. A `{name}` inside a variable value is now filled, so a start URL or visit path that uses a nested variable opens the filled page, and a variable cycle exits 2. A padded Base64 SHA-256 digest of a canary reads transform `sha256` in an `identifierRoute` flag. The record stays at schema version 5, and a 0.9.0 record reads as before. `npm i -g tagreeve` installs it. On arm64, run `tagreeve server-container build` after the upgrade. What is new is in [CHANGELOG.md](CHANGELOG.md) under 0.9.1.
|
|
21
23
|
>
|
|
22
24
|
> **In 0.9.0:** the final 0.9.0, the same as 0.9.0-rc.1 with no changes since the candidate, and with no new command or option. A server call that arrives up to 2000 ms after its answered same-key hit now links exactly, so a rule that only warned can now fail the run. Pinterest Conversions API calls are decoded as `pinterest-capi` and link to browser hits by event ID. Fixes to canaries, consent matrix event names and `dataLayer` iframe loaders. The record stays at schema version 5. `npm i -g tagreeve` installs it. On arm64, run `tagreeve server-container build` after the upgrade. What is new is in [CHANGELOG.md](CHANGELOG.md) under 0.9.0.
|
package/dist/cli.js
CHANGED
|
@@ -1023,6 +1023,7 @@ var META_BODY_ONLY_IGNORE = [
|
|
|
1023
1023
|
"a"
|
|
1024
1024
|
];
|
|
1025
1025
|
var META_CAPI_BODY_ONLY_IGNORE = ["event_name", "event_time", "event_id", "event_source_url", "action_source"];
|
|
1026
|
+
var PINTEREST_CAPI_BODY_ONLY_IGNORE = ["event_name", "event_time", "event_id", "event_source_url", "action_source"];
|
|
1026
1027
|
var SGTM_BODY_ONLY_IGNORE = ["v", "tid", "event", "en", "dtdc"];
|
|
1027
1028
|
function matchesIgnoreList(name, list3) {
|
|
1028
1029
|
return list3.some((entry) => globToRegExp(entry).test(name));
|
|
@@ -4119,7 +4120,7 @@ function loaderReachesScope(loader, ctx, inScope, windowStartAt) {
|
|
|
4119
4120
|
}
|
|
4120
4121
|
var NOT_RECORDED = "cannot evaluate: field names not recorded";
|
|
4121
4122
|
var BODY_CUT = "cannot evaluate: body not fully recorded";
|
|
4122
|
-
var VENDOR_IGNORE = { ga4: GA4_BODY_ONLY_IGNORE, meta: META_BODY_ONLY_IGNORE, "meta-capi": META_CAPI_BODY_ONLY_IGNORE, sgtm: SGTM_BODY_ONLY_IGNORE };
|
|
4123
|
+
var VENDOR_IGNORE = { ga4: GA4_BODY_ONLY_IGNORE, meta: META_BODY_ONLY_IGNORE, "meta-capi": META_CAPI_BODY_ONLY_IGNORE, "pinterest-capi": PINTEREST_CAPI_BODY_ONLY_IGNORE, sgtm: SGTM_BODY_ONLY_IGNORE };
|
|
4123
4124
|
function listNames(names) {
|
|
4124
4125
|
return names.length > MAX_NAMES ? `${names.slice(0, MAX_NAMES).join(", ")} and ${names.length - MAX_NAMES} more` : names.join(", ");
|
|
4125
4126
|
}
|
|
@@ -5701,12 +5702,16 @@ function diffShapes(a, b, options = {}) {
|
|
|
5701
5702
|
} else if (first && !tb.has(first.tid)) {
|
|
5702
5703
|
first.left = 0;
|
|
5703
5704
|
if (first.t.count !== t.count) result.countChanges.push({ key, consent: t.consent, ids: t.ids, a: first.t.count, b: t.count });
|
|
5705
|
+
} else if (first && need > 0) {
|
|
5706
|
+
if (first.t.count !== t.count) result.countChanges.push({ key, consent: t.consent, ids: t.ids, a: first.t.count, b: t.count });
|
|
5704
5707
|
} else if (need > 0) {
|
|
5705
5708
|
result.added.push({ key, consent: t.consent, ids: t.ids, wholeKey: !ka });
|
|
5706
5709
|
}
|
|
5707
5710
|
}
|
|
5708
5711
|
for (const l of lost) {
|
|
5709
|
-
if (l.left
|
|
5712
|
+
if (l.left <= 0 || tb.has(l.tid)) continue;
|
|
5713
|
+
if (l.left < l.t.count) result.countChanges.push({ key, consent: l.t.consent, ids: l.t.ids, a: l.t.count, b: l.t.count - l.left });
|
|
5714
|
+
else result.removed.push({ key, consent: l.t.consent, ids: l.t.ids, wholeKey: !kb });
|
|
5710
5715
|
}
|
|
5711
5716
|
}
|
|
5712
5717
|
result.drift = result.added.length > 0 || result.removed.length > 0;
|
|
@@ -13581,6 +13586,23 @@ async function scrubStepErrors(path, canaries) {
|
|
|
13581
13586
|
const kept = lines.map((line, i) => i > 0 && line.startsWith('{"type":"step"') ? nameCanaries(line, canaries) : line);
|
|
13582
13587
|
await writeFile4(path, kept.join("\n"));
|
|
13583
13588
|
}
|
|
13589
|
+
function undeclaredInValues(text2, vars) {
|
|
13590
|
+
const found = [];
|
|
13591
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13592
|
+
const walk2 = (value) => {
|
|
13593
|
+
for (const [, name] of value.matchAll(/\{(\w+)\}/g)) {
|
|
13594
|
+
if (!Object.hasOwn(vars, name) || seen.has(name)) continue;
|
|
13595
|
+
seen.add(name);
|
|
13596
|
+
const own = vars[name];
|
|
13597
|
+
for (const [, inner] of own.matchAll(/\{(\w+)\}/g)) {
|
|
13598
|
+
if (!Object.hasOwn(vars, inner) && !found.some(([v, n]) => v === name && n === inner)) found.push([name, inner]);
|
|
13599
|
+
}
|
|
13600
|
+
walk2(own);
|
|
13601
|
+
}
|
|
13602
|
+
};
|
|
13603
|
+
walk2(text2);
|
|
13604
|
+
return found;
|
|
13605
|
+
}
|
|
13584
13606
|
async function executeRun(spec, rawIo) {
|
|
13585
13607
|
const { gtmOverride, variant } = spec;
|
|
13586
13608
|
let parsed = spec.parsed;
|
|
@@ -13598,16 +13620,20 @@ async function executeRun(spec, rawIo) {
|
|
|
13598
13620
|
};
|
|
13599
13621
|
let filledStart = parsed.start;
|
|
13600
13622
|
const places = [["start", parsed.start], ...parsed.steps.flatMap((s, i) => s.kind === "visit" ? [[`step ${i + 1}`, s.value]] : [])];
|
|
13623
|
+
const undeclared = [];
|
|
13601
13624
|
for (const [place, text2] of places) {
|
|
13602
13625
|
try {
|
|
13603
13626
|
const filled = fillVars(text2, parsed.vars);
|
|
13604
13627
|
if (place === "start") filledStart = filled;
|
|
13628
|
+
for (const [variable, name] of undeclaredInValues(text2, parsed.vars)) undeclared.push(`Warning: variable ${variable} holds {${name}}, which no variable declares (${place}).
|
|
13629
|
+
`);
|
|
13605
13630
|
} catch (error) {
|
|
13606
13631
|
if (!(error instanceof VarCycleError)) throw error;
|
|
13607
13632
|
return failed(`${place}: ${error.message}. Break the cycle.
|
|
13608
13633
|
`);
|
|
13609
13634
|
}
|
|
13610
13635
|
}
|
|
13636
|
+
for (const line of undeclared) io.stderr(line);
|
|
13611
13637
|
if (parsed.options.canaries) {
|
|
13612
13638
|
const held = queryNames(filledStart);
|
|
13613
13639
|
const taken = CANARY_NAMES.find((name) => held.includes(name));
|