fix(sdk-utils): drop the CLI major-version gate that blocks 2.x - #2409
Open
aryanku-dev wants to merge 2 commits into
Open
fix(sdk-utils): drop the CLI major-version gate that blocks 2.x#2409aryanku-dev wants to merge 2 commits into
aryanku-dev wants to merge 2 commits into
Conversation
isPercyEnabled() disabled snapshots whenever the CLI's major was not exactly 1:
if (percy.enabled && percy.version.major !== 1) {
log.info('Unsupported Percy CLI version, disabling snapshots');
Against a 2.x CLI that means capture silently stops. The build still passes,
with zero snapshots and a single info log as the only signal — the worst shape
a failure can take.
The check came in on 2020-10-19 with this package (#63) as
`getInfo.version[0] !== 1`, at the CLI 1.0 cutover from the legacy 0.x
@percy/agent, whose protocol predates /percy/healthcheck. The retained test
pinned 0.1.0, which is the fingerprint of that intent. It was written as a
floor when nothing above 1 existed, and only reads as a ceiling because it
used !== rather than >=. The 0.x agent is long gone, so it guards nothing and
blocks the next major.
percy.version stays populated for SDKs that read it. Replaces the old spec
with two: a 2.x CLI must stay enabled (the regression guard for exactly this),
and 0.x is no longer special-cased.
Verified: 170/170 specs, 100% coverage, node and karma suites.
Note this only covers the nine JS SDKs, and only once they upgrade. The 16
non-JS SDKs each carry their own hardcoded copy of the same check, so a 2.0.0
CLI is not safe until those are fixed and adopted too.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rishigupta1599
approved these changes
Aug 28, 2026
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.
Removes the check in
isPercyEnabled()that disables snapshots unless the CLI's major is exactly1.Against a 2.x CLI this silently stops capture — the build still passes, with zero snapshots and one
infolog as the only signal. That is the worst possible failure shape for a visual testing tool.Why the check existed
Added 2020-10-19 in #63, the commit that created
@percy/sdk-utils, asgetInfo.version[0] !== 1. That was the CLI 1.0 cutover from the legacy 0.x@percy/agent, whose protocol predates/percy/healthcheck. The test it replaced pinned0.1.0— the fingerprint of that intent.So it was written as a floor at a time when nothing above 1 existed, and only reads as a ceiling because it used
!==where>=was meant. Blocking 2.x was never intended; the case simply was not imaginable in 2020. The 0.x agent has been gone for years, so the guard protects nothing and only blocks the next major.percy.versionstays populated for SDKs that read it.Tests
Replaces the old spec with two, one of which is the direct regression guard:
Verified: 170/170 specs, 100% coverage, node and karma suites both green.
This does not make a 2.0.0 CLI safe on its own
Two limits worth being explicit about:
The check runs in the customer's installed copy. Publishing this changes nothing for anyone whose lockfile predates it — they must upgrade first.
This covers only the nine JS SDKs. Sixteen non-JS SDK repos each carry their own hardcoded copy of the same
major != 1comparison:percy-capybara·percy-selenium-ruby·percy-appium-ruby·percy-selenium-python·percy-playwright-python·percy-appium-python·percy-selenium-java·percy-playwright-java·percy-appium-java·percy-espresso-java·percy-selenium-dotnet·percy-playwright-dotnet·percy-appium-dotnet·percy-tosca-dotnet(2 targets) ·app-percy-tosca-dotnet·percy-xcui-swiftSo the ordering for any future major is: fix all SDKs → release → wait for adoption → then bump the CLI. This PR is step one of that, not a green light.
(Scope caveat: found by searching the exact string
"Unsupported Percy CLI version", so treat the count as a floor rather than a verified total.)🤖 Generated with Claude Code