feat(webdriver-utils): env-var overrides for staging/percy-dev testing#2274
feat(webdriver-utils): env-var overrides for staging/percy-dev testing#2274bhokaremoin wants to merge 2 commits into
Conversation
Replace manual node_modules edits with env vars that default to prod: - PERCY_ENABLE_DEV=true injects projectId:'percy-dev' once at the shared browserstackExecutor chokepoint (covers begin/end + automate/playwright getTiles); omitted entirely when unset, so prod payloads are unchanged. - PERCY_CDP_DOMAIN overrides the Playwright driver CDP host. - PERCY_AUTOMATE_DOMAIN overrides the Automate debug-URL host. Adopts the existing Python percy-appium-app PERCY_ENABLE_DEV convention so one export works across JS + Python. Adds tests for on/off/non-screenshot paths and host overrides. Usage runbook lives in internal docs (not this public repo) to avoid exposing staging cluster hostnames. 🤖 Generated with Claude Opus 4.8 (1M context) via Claude Code + Compound Engineering v2.50.0 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bhokaremoin
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: #2274 • Head: 364dded • Reviewers: stack:code-reviewer SummaryAdds three developer-only, default-off environment-variable overrides to Review Table
FindingsAll findings below are Low severity for this PR's context (an internal, env-gated, default-off developer override). The original reviewer rated [1] Critical and [2]/[3] High; those severities are downgraded here after verifying the real call sites and threat model — documented so the rationale is transparent.
Verdict: PASS — Small, focused, well-tested change that defaults to byte-identical production behavior when the new env vars are unset. Remaining findings are optional Low-severity hardening/nits, not blockers. |
364dded to
ae01e19
Compare
…cutor Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
bhokaremoin
left a comment
There was a problem hiding this comment.
Claude Code Review (automated) — 4 inline finding(s). Full report in the PR comment below. Verdict: Passed.
Claude Code PR ReviewPR: #2274 • Head: ce10d36 • Reviewers: stack:code-reviewer SummaryAdds three opt-in env-var overrides to Review Table
FindingsNo findings rise to Critical/High. The notable non-blocking items:
Verdict: PASS — no Critical/High findings; the Medium cache-key note is non-blocking (unreachable outside test harnesses) and the rest are nits. |
Summary
Makes the screenshot executor's project routing and the CDP / Automate host resolution optionally configurable, all defaulting to current behavior. No change unless explicitly opted in.
Changes
genericProvider.browserstackExecutor: optionally include aprojectIdin thepercyScreenshotpayload, injected once at this shared chokepoint (covers begin/end andgetTilesfor both the Automate and Playwright providers).playwrightDriver: CDP execute host is now resolved with a default ofcdp.browserstack.com.automateProvider/playwrightProvider: Automate debug-URL host resolved with a default ofautomate.browserstack.com.All three are opt-in and fall back to the existing values, so the default path is unchanged.
Testing
Post-Deploy Monitoring & Validation
No additional operational monitoring required: the overrides are opt-in and default to current production behavior; default-path payloads and hosts are byte-identical (covered by unit tests).
🤖 Generated with Claude Opus 4.8 (1M context) via Claude Code