Skip to content

Commit 6651a0b

Browse files
docs(adr): restore Percy automation context and tradeoffs
Reintroduce the original operational context and implementation details for Percy automation, including partial PR builds, full main builds, and metadata-based dependency tracking. Capture the key cost, speed, and maintenance tradeoffs without duplicating rationale across sections. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 43341d8 commit 6651a0b

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

docs/adr/0003-visual-regression-testing-tool.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Accepted
88

99
## Context
1010

11-
We need visual regression testing to catch unintended UI changes across our component library. With approximately 990 visual snapshots across our components, we needed to evaluate different visual regression testing tools to determine the best fit for our needs.
11+
We need visual regression testing to catch unintended UI changes across our component library. We have approximately 990 snapshots, and Percy snapshots were previously executed manually. That process was paused because full runs were costly and slow, and running the full suite for every PR was not sustainable.
1212

1313
The primary options considered were:
1414

@@ -18,26 +18,32 @@ The primary options considered were:
1818

1919
## Decision
2020

21-
We will use Percy for visual regression testing.
21+
We will use Percy for visual regression testing and run it through automated GitHub Actions with partial builds for PRs and full builds on `main`.
2222

23-
Key factors in this decision:
23+
Implementation approach:
2424

25-
1. **Existing infrastructure**: We already have an existing Percy account, eliminating procurement and setup overhead
26-
2. **Cross-browser testing**: Percy provides testing across multiple browsers (Chrome, Firefox, Safari, Edge), which visual-html does not natively support
27-
3. **Accurate**: Percy has been found to be accurate in finding differences between snapshots. Some other tools tend to show a lot of false positive
28-
4. **Cloud infrastructure**: Percy's cloud-based service provides a good UI to quickly see the visual differences and approve the build.
25+
1. **Partial builds for PRs**: Run snapshots only for components affected by changed files, and run full builds only when global files change (tokens, variables, mixins).
26+
2. **Full builds on `main`**: Run and auto-approve the complete snapshot suite for baseline coverage.
27+
3. **Metadata-based dependency tracking**: Reuse `component-metadata.json` mappings (including component/submodule relationships) instead of adding higher-complexity automated dependency analysis.
2928

3029
## Consequences
3130

3231
**Positive:**
3332

34-
- Cross-browser visual regression coverage without additional infrastructure
33+
- Existing Percy account avoids procurement and setup overhead
34+
- Cross-browser and responsive coverage out of the box, including mobile browser testing
35+
- Accurate visual diffing with fewer false positives than alternatives
36+
- Partial PR builds reduce build time and cost by running only snapshots impacted by changed files
37+
- Full builds on `main` preserve complete baseline coverage
38+
- Automation reduces manual effort and human error
39+
- Cloud UI and PR integration improve collaboration and review speed
40+
- Active product maintenance should improve long-term scalability and automation
3541
- No need to maintain custom visual regression infrastructure
36-
- Better collaboration through Percy's PR integration and review UI
3742

3843
**Negative:**
3944

40-
- Ongoing costs based on snapshot count (~990 snapshots)
41-
- Requires careful cost management through partial builds (only running snapshots for changed components)
45+
- Ongoing costs based on snapshot count (~990 snapshots), even with partial build optimization
46+
- Dependency mapping in `component-metadata.json` must be kept accurate and maintained
47+
- Risk of missing visual regressions when component dependencies are incomplete or stale
4248
- Dependency on external service rather than an internal eBay tool
4349
- Must trigger full builds when global files change (tokens, variables, mixins)

0 commit comments

Comments
 (0)