fix: merge .percy.yml config into serialize options (PER-8053 regression)#250
Merged
Merged
Conversation
get_serialized_dom serialized only the raw per-call kwargs, so global .percy.yml `snapshot` config (enableJavaScript, percyCSS, discovery.*, etc.) never reached PercyDOM.serialize. The config-merge that PR #223 introduced was dropped when the CORS-iframe refactor (#226) rewrote this path. Restore it: deep-merge config.snapshot into the serialize kwargs (per-call wins at the leaves) after the readiness gate and before serialize, so it also flows to the CORS-iframe context (serialize_options) and the responsive-capture path. Adds unit tests asserting a config-only key reaches serialize, per-call wins, deep-merge keeps config siblings, and the helper degrades gracefully on malformed config — a regression guard the unit suite previously lacked. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
aryanku-dev
approved these changes
Jul 10, 2026
rishigupta1599
added a commit
that referenced
this pull request
Jul 10, 2026
Bumps past the published v2.2.1-beta.1 (which shipped the config-merge regression, PR #250) — PyPI versions are immutable so the fix ships as a new beta. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
get_serialized_domserialized only the raw per-callkwargs— the global.percy.ymlsnapshotconfig (enableJavaScript,percyCSS,discovery.*,widths, …) never reachedPercyDOM.serialize. This is a regression: the config-merge added in #223 (PER-8053) was silently dropped when the CORS-iframe refactor (#226) rewrote this path.Found by an end-to-end sanity harness that captures the exact options handed to
PercyDOM.serializeacross all SDKs — selenium-python was the only one where config-only keys didn't arrive (the siblingpercy-playwright-pythonmerges correctly via_deep_merge).v2.2.1-beta.1— a new beta (2.2.1-beta.2) will follow this merge.Fix
Deep-merge
config.snapshotinto the serializekwargs(per-call wins at the leaves) after the readiness gate (which intentionally reads the raw per-call kwargs) and before serialize. Because the mergedkwargsalso feed the CORS-iframe context (serialize_options) and the responsive-capture path routes throughget_serialized_dom, config now reaches nested-frame and per-width serialize too.Mirrors the known-good
_deep_mergesemantics already used inpercy-playwright-python.Tests
New
TestConfigMergeIntoSerialize:enableJavaScript) reaches serializediscovery.*)All new lines covered; maintains the repo's
fail_under = 100gate.