Merged
Conversation
518665a to
d280519
Compare
7d2db40 to
917d67a
Compare
rishigupta1599
added a commit
that referenced
this pull request
Mar 16, 2026
* initial commit * more changes * cleaning up few things * more changes * Adding specs * semgrep ignore * yarn lock with node 14 * adding coverage * Adding coverage * adding coverage * adding coverage * Removing function injection + more coverage * More coverage + refactoring * final coverage * package version update * windows test fix * covering macos cases * coverage * coverage * coverage * coverage * coverage * fixing flay specs * Removing ssl.js as it is removed * CodeQL/ semgrep * semgrep * Resolving comments from AI researcher * semgrep resolve * semgrep ci
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.
Percy Doctor – Network Diagnostics Command (
@percy/cli-doctor)Summary
Introduces a brand-new
@percy/cli-doctorpackage that addspercy doctorto the Percy CLI. The command diagnoses network connectivity, TLS/SSL, proxy configuration, PAC/WPAD auto-proxy, and browser-level reachability — giving users and support teams a single, actionable runbook whenever Percy builds fail for network-related reasons.Why
Percy builds silently fail on enterprise networks due to firewalls, SSL-intercepting proxies (Zscaler, Netskope, Bluecoat), authenticated proxies, and PAC/WPAD auto-proxy misconfiguration. Diagnosing these issues today requires manual
curlcommands, reading Node TLS error codes, and guessing which proxy env var to set.percy doctorautomates all of this: it probes the required endpoints, detects how traffic is being intercepted, evaluates PAC scripts, and prints a prioritised list of actionable suggestions.What Changed
1. New package:
@percy/cli-doctorsrc/doctor.jspercy doctorcommand entry point; JSON report writer (--output-json)src/index.jssrc/checks/connectivity.jsConnectivityChecker— parallel probe of percy.io, browserstack.com, hub.browserstack.com, storage.googleapis.com (optional)src/checks/proxy.jsProxyDetector— 5-layer proxy discovery + per-proxy validation via CONNECT tunnelsrc/checks/pac.jsPACDetector— PAC/WPAD discovery from env, macOS, Linux, Windows, Chrome, Firefox; sandboxedvmevaluationsrc/checks/browser.jsBrowserChecker— Chrome CDP capture; direct vs. via-proxy comparison tablesrc/utils/http.jsprobeUrl/httpProber— CONNECT-tunnelling HTTP prober with configurable timeout and TLS controlssrc/utils/helpers.jsrunConnectivityAndSSL,runProxyCheck,runPACCheck,runBrowserCheck,redactProxyUrl,captureProxyEnvsrc/utils/reporter.js2. Five diagnostic checks
NODE_TLS_REJECT_UNAUTHORIZEDwarn; actionable cert-error suggestionsscutil, Linux GNOME//etc, Windows registry) → (c) response-header fingerprinting (Via,X-Forwarded-For, Zscaler/Netskope headers) → (d) process inspection (50+ known agents) → (e) WPAD DNS auto-discoverynetworksetup, Linuxgsettings//etc/environment, WindowsAutoConfigURL, ChromeDefault/Preferences, Firefoxprefs.js; PAC fetched + evaluated in Node.jsvmsandbox; shows exactHTTPS_PROXY=exportrequestWillBeSent/responseReceived/loadingFailedevents; direct vs. proxy two-column table;--ignore-certificate-errorsmirrored fromNODE_TLS_REJECT_UNAUTHORIZED4. JSON report (
--output-json)Full machine-readable diagnostic output including environment metadata (Node version, platform, Percy CLI version, proxy env), per-check findings, and an
overallsummary field. Designed to be attached to Percy support tickets.Breaking Changes
None. This PR only adds a new package. No existing packages are modified beyond
packages/cli/package.json(to wire in the new command.