feat: add mergeSnapshotOptions utility to @percy/sdk-utils#2213
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. |
Centralizes the .percy.yml config merge logic that was duplicated across all 10 Percy JS SDKs. The function merges percy.config.snapshot options with per-snapshot options, giving snapshot options priority. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9322451 to
994d24a
Compare
…shot-options-utility
rishigupta1599
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 2 inline finding(s). Full report in the PR comment below. Verdict: Passed.
Claude Code PR ReviewPR: #2213 • Head: da98300 • Reviewers: stack:code-reviewer SummaryAdds a new Review Table
Findings
Verdict: PASS — Small, focused, well-tested additive utility with correct export wiring. No High/Critical issues. The shallow-merge semantics (vs. core's deep |
…llow-merge intent
Addresses PR review feedback on mergeSnapshotOptions:
- Use a default parameter (options = {}) instead of relying on spreading undefined.
- Document that the shallow merge is deliberate — for parity with the non-JS SDKs
and getReadinessConfig, and because the CLI does the authoritative deep config
merge server-side.
Ref: PER-8053
Claude Code PR ReviewPR: #2213 • Head: 33cf5cb • Reviewers: stack:code-review SummaryAdds a Review Table
FindingsNo failing items. The two prior review comments (default parameter and documented intentional shallow merge) are resolved in head commit 33cf5cb: the One non-blocking observation (not a finding): the local Verdict: PASS |
Addresses the review finding that the shallow merge dropped nested config keys: a per-snapshot override of one nested key (e.g. discovery.disableCache) no longer discards the config's sibling nested keys. Nested plain objects are merged recursively; per-snapshot values win at the leaves and arrays are replaced (not concatenated). Adds tests for nested merge + array replacement. Ref: PER-8053
|
PR: #2213 • Head: 465b72e • Reviewers: stack:code-review SummaryAdds a self-contained Review Table
FindingsNo blocking findings. Non-blocking observation (Low, not anchored): Verdict: PASS — correct, well-scoped deep merge with solid test coverage; matches the intended |
Summary
mergeSnapshotOptions(options)to@percy/sdk-utilsthat centralizes the.percy.ymlconfig merge logicpercy.config.snapshotoptions with per-snapshot options (snapshot options take priority)Test plan
@percy/cliversion to use this utility🤖 Generated with Claude Code