chore(ci): reduce Percy visual-snapshot usage - #34366
Draft
claude[bot] wants to merge 3 commits into
Draft
Conversation
The run-webpack-dev-server-integration-tests and
run-vite-dev-server-integration-tests jobs wrapped their Cypress run in
`yarn percy exec` and carried the test-runner:percy context, but their
specs (npm/{webpack,vite}-dev-server/cypress/e2e) contain no
`cy.percySnapshot()` calls, and neither do the projects they scaffold.
As a result these jobs captured zero Percy snapshots while still spinning
up a Percy agent and joining the parallel build as empty shards.
Strip the Percy wrapper, env vars, and context from both jobs (the
functional `yarn cypress:run` invocation is unchanged) and drop them from
percy-finalize's requires/guard so a dev-server-only PR no longer tries to
finalize a build that was never created.
Note: this removes vestigial Percy overhead; it does not reduce billed
snapshots, because these jobs were not producing any.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CnNBfto8Tk3K2wryockMR3
…aram Percy snapshotting was tied to the same pipeline parameters that gate the functional UI test jobs, so any change that made an app/launchpad job run (for example a data-context-only or telemetry-only PR) also re-uploaded the full snapshot set. Introduce a dedicated `run-percy` pipeline parameter, computed in generate-pipeline-parameters.sh, that is true only when a change touches front-end/UI code (packages/app, launchpad, reporter, frontend-shared, runner, web-config, icons, resolve-dist, and cli for the static CLI snapshots). The six app/launchpad/frontend-shared/reporter component & integration jobs now take `percy: << pipeline.parameters.run-percy >>` instead of a hard-coded `true`, so on PRs whose changes are not UI-relevant the jobs still run their Cypress tests but skip the `percy exec` layer and upload no snapshots. percy-finalize is simplified to a single `run-percy` guard: a Percy build now exists exactly when run-percy is true, so this halts finalize cleanly when no build was produced (and drops the stale dev-server params). run-percy defaults to true and emit_all_true sets it true, so develop/release branches, API-triggered pipelines, run-all-jobs, and global-trigger changes (deps, config, .circleci) keep full visual coverage. Develop pushes are intentionally left running full Percy: the path-filter script cannot compute a meaningful changed-file set on a develop push (merge-base with develop is HEAD), which is why develop uses emit_all_true. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CnNBfto8Tk3K2wryockMR3
Collaborator
|
…e-usage # Conflicts: # .circleci/scripts/generate-pipeline-parameters.sh
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.
Requested by Ganesh RK, Jennifer Shehane · Slack thread
Additional details
This PR reduces how often we upload Percy visual snapshots in CI. It is config-only — no product, library, or test code changes, and every functional Cypress run keeps running exactly as before. Only the Percy snapshot layer is affected.
Before → After, in plain terms
Dev-server integration jobs no longer spin up Percy for nothing.
run-webpack-dev-server-integration-testsandrun-vite-dev-server-integration-testswrapped their Cypress run inyarn percy execand carried thetest-runner:percycontext — but their specs (and the projects they scaffold) never callcy.percySnapshot(), so they captured zero snapshots while still starting a Percy agent and joining the parallel build as empty shards.yarn cypress:runas before.Percy snapshots are gated to UI-relevant changes on PRs.
packages/data-context,packages/telemetry) still re-uploaded the full snapshot set.run-percypipeline parameter (set bygenerate-pipeline-parameters.sh) turns Percy on only when a change touches front-end/UI code. On such PRs the UI jobs still run their Cypress tests — they just skip thepercy execlayer and upload nothing.How
/.circleci/src/pipeline/@pipeline.ymlpercy execwrapper +PERCY_*env fromrun-webpack-dev-server-integration-testsandrun-vite-dev-server-integration-tests.run-percyboolean pipeline parameter (defaulttrue).percy-finalizeto a singlehalt-if-skipped: run-percyguard (a Percy build now exists exactly whenrun-percyis true), and dropped the stale dev-server params from it./.circleci/src/pipeline/workflows/@main.ymlandpull-request.ymlpercy: << pipeline.parameters.run-percy >>instead of a hard-codedtrue.percy-finalize'srequires/context./.circleci/scripts/generate-pipeline-parameters.shrun-percy = trueonly for front-end paths:packages/{app,launchpad,reporter,frontend-shared,runner,web-config,icons,resolve-dist}andcli/(for the static CLI visual snapshots). It staystrueforemit_all_true(develop/release, API triggers,run-all-jobs, and global-trigger changes such as deps/config/.circleci).Expected usage impact
data-context/telemetry-only PRs). The existing halt-based path filtering already skips Percy for pure backend PRs, so this closes the remaining "non-UI change dragged in a UI job" gap..circlecichanges still snapshot (kept intentionally, so visual coverage is not lost when a change could plausibly affect rendering).developis intentionally left running full Percy. The path-filter script cannot compute a meaningful changed-file set on adeveloppush (the merge-base withdevelopisHEAD), which is exactly whydevelopusesemit_all_true. Gatingdevelopwould need a different diff strategy and is out of scope here.Steps to test
Because the config source lives in
.circleci/src/, runyarn pack-ci --validatelocally (or let this PR's own CI pack + validate). Then, to confirm the path-filter behavior ofgenerate-pipeline-parameters.sh:CIRCLE_BRANCH=develop bash .circleci/scripts/generate-pipeline-parameters.sh→run-percy: true.packages/app(orlaunchpad/reporter/frontend-shared/runner/web-config/icons/resolve-dist/cli) →run-percy: true.packages/server/packages/data-context/packages/telemetry→run-percy: false(functional UI jobs may still run, but take no snapshots), andpercy-finalizehalts.How has the user experience changed?
No change — this is CI/Percy configuration only. No product or library code is touched.
PR Tasks
cypress-documentation?Generated by Claude Code