fix: merge .percy.yml config options into serializeDOM#714
Conversation
|
This PR is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
|
This PR was closed because it has been stalled for 28 days with no activity. |
…izeDOM Previously, only per-snapshot options were passed to PercyDOM.serialize(), ignoring config-level settings (enableJavaScript, disableShadowDOM, etc.) from .percy.yml. Now config.snapshot is used as defaults, with per-snapshot options taking priority. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace inline config merge with centralized utility from sdk-utils. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
490318f to
c24592c
Compare
rishigupta1599
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 1 inline finding(s). Full report in the PR comment below. Verdict: Failed - see PR comment.
| await b.executeScript(percyDOMScript); | ||
|
|
||
| // Merge .percy.yml config options with snapshot options (snapshot options take priority) | ||
| const mergedOptions = utils.mergeSnapshotOptions(options); |
There was a problem hiding this comment.
[High] mergeSnapshotOptions is missing from the pinned @percy/sdk-utils version
This calls utils.mergeSnapshotOptions(options), but package.json pins @percy/sdk-utils to 1.31.14-beta.4, which does not export mergeSnapshotOptions (verified by unpacking the published tarball — no merge-snapshot-options.js and no reference to the symbol in its dist/). It only exists in 1.32.0-beta.9, which happens to be installed locally/in CI. On a clean install honoring the pin, utils.mergeSnapshotOptions is undefined and this line throws TypeError, which the surrounding try/catch swallows as a generic "Could not take DOM snapshot" — silently breaking every snapshot.
Suggestion: Bump @percy/sdk-utils in package.json to the first published version exporting mergeSnapshotOptions (e.g. 1.32.0-beta.x / corresponding stable) and update the lockfile. Optionally add a defensive fallback: const mergedOptions = (typeof utils.mergeSnapshotOptions === 'function') ? utils.mergeSnapshotOptions(options) : (options || {});
Reviewer: stack:code-review
Claude Code PR ReviewPR: #714 • Head: c24592c • Reviewers: stack:code-review SummaryMerges global Review Table
Findings
Verdict: FAIL — declared dependency version does not provide |
Claude Code PR ReviewPR: #714 • Head: c24592c • Reviewers: stack:code-review SummaryMerges Review Table
Findings
The merge-before-serialize change is correct: serialization now receives config-merged options while Verdict: PASS — correct, focused fix; the only open item is the accepted release-order dependency on the next |
…SnapshotOptions) Ref: PER-8053
|
This PR is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
…-config-with-serialize-dom # Conflicts: # package.json # yarn.lock
Summary
.percy.ymlconfig options were not being passed toPercyDOM.serialize()— only per-snapshot options were usedutils.percy.config.snapshotas defaults with per-snapshot options taking priorityTest plan
enableJavaScript) flow through to DOM serialization🤖 Generated with Claude Code