René's URL Explorer Experiment


Title: SDK-8048: support BROWSERSTACK_ENV=preprod|staging for internal testing by AakashHotchandani · Pull Request #1217 · browserstack/browserstack-cypress-cli · GitHub

Open Graph Title: SDK-8048: support BROWSERSTACK_ENV=preprod|staging for internal testing by AakashHotchandani · Pull Request #1217 · browserstack/browserstack-cypress-cli

X Title: SDK-8048: support BROWSERSTACK_ENV=preprod|staging for internal testing by AakashHotchandani · Pull Request #1217 · browserstack/browserstack-cypress-cli

Description: What is this about? The cli hardcodes production hosts. Testing a cli change on preprod today means hand-editing bin/helpers/config.json plus the accessibility and observability constants.js files (the #1001 pattern), packing a tarball and shipping it through npm_dependencies. This came up while verifying #1206 (Cypress 16) on preprod for SDK-8048. browserstack-binary (core/utils/environment-url.js) and browserstack-node-agent (src/bin/utils/constants.js, test-observability/constants.js) already switch hosts on BROWSERSTACK_ENV. This PR gives the cli the same switch: BROWSERSTACK_ENV=preprod npx browserstack-cypress run ... Unset, or any other value: production hosts, unchanged. Related Jira task/s SDK-8048 Dependent PRs / release order Dependent PRs: None. CLI-only; builds on #1214 (collector override + forwarding to the remote reporter), already on master. No cross-repo deploy order applies. Automation cases to add None. Internal-only switch, off by default; unit-tested below. Code changes to check Spread operator is not used. Syntax supported by older Node: no ?. / ??. The change bin/helpers/environmentUrl.js (new): getEnvironmentUrl(url) swaps the whole host from a preprod or staging map and keeps the path, so app-automate.browserstack.com and eds.browserstack.com:443 are left alone. Accepts preprod/pre-prod and staging/stag, case-insensitive. The preprod map mirrors the binary, plus the web accessibility host (accessibility-preprod.bsstag.com), which the binary has no explicit entry for. bin/helpers/config.js: in the production config only (the BSTACK_CYPRESS_NODE_ENV dev path is untouched), maps uploadUrl, rails_host, dashboardUrl, turboScaleUrl, turboScaleAPIUrl before the derived URLs are built. bin/accessibility-automation/constants.js: API_URL goes through the map. bin/testObservability/helper/constants.js: apiUrl() falls back to the mapped collector. An explicit BROWSERSTACK_TEST_OBSERVABILITY_API_URL still wins, and setSystemEnvs still forwards the result to the remote reporter (#1214), so the machine posts to the same collector. bin/testObservability/helper/helper.js: the printed Test Reporting build link uses the mapped host. On preprod it used to print the production automation.browserstack.com link. Verification Resolved hosts from the packed tarball: unset BROWSERSTACK_ENV=preprod rails api.browserstack.com api-preprod.bsstag.com upload api-cloud.browserstack.com/... api-cloud-preprod.bsstag.com/... dashboard automate.browserstack.com/... automate-preprod.bsstag.com/... accessibility accessibility.browserstack.com/api accessibility-preprod.bsstag.com/api collector (cli + remote reporter) collector-observability.browserstack.com collector-observability-preprod.bsstag.com Preprod E2E: branch tarball, config.json untouched, only BROWSERSTACK_ENV=preprod set. Cypress 15.21.1, OS X Ventura, Chrome 148, headed, testObservability: true, cli shipped via npm_dependencies + cache_dependencies: true: Run Upload Build Test Reporting Accessibility a11y off ✅ api-cloud-preprod ✅ ee251f15 ✅ build created; link printed on automation-preprod.bsstag.com n/a a11y on ✅ ✅ a4fc1331 ✅ same reached accessibility-preprod.bsstag.com; it refused the test account's plan ("You cannot run automation builds on the current plan"), an account entitlement, not routing Not covered: staging (devtestops) hosts are mapped from the binary's list and were not run end to end; Windows terminals. Unit tests: 6 new (test/unit/bin/helpers/environmentUrl.js). Full suite: branch 751 passing / 16 failing, untouched origin/master 745 passing / 16 failing, the same 16 tests on both, so none are new. 🤖 Generated with Claude Code Summary by CodeRabbit Improvements Automation and observability services now use the appropriate hosts in supported preproduction and staging environments, while production defaults remain unchanged. Custom observability API URLs continue to take precedence over environment-based defaults.

Open Graph Description: What is this about? The cli hardcodes production hosts. Testing a cli change on preprod today means hand-editing bin/helpers/config.json plus the accessibility and observability constants.js files ...

X Description: What is this about? The cli hardcodes production hosts. Testing a cli change on preprod today means hand-editing bin/helpers/config.json plus the accessibility and observability constants.js files ...

Opengraph URL: https://github.com/browserstack/browserstack-cypress-cli/pull/1217

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:e36e0c31-bbc2-aaab-53e0-086326791733
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDA30:1F63A9:1AE27E:254774:6B044884
html-safe-nonce984ec1b37b5ecc2c94f4f0a3191f883f576a11e2380951c030812e0017927e53
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTMwOjFGNjNBOToxQUUyN0U6MjU0Nzc0OjZCMDQ0ODg0IiwidmlzaXRvcl9pZCI6IjQ4NjkwNzcwOTY2NzAxODU2MDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac381248d1f8587f976ea4bf92143917d575ab65d00556f047fde3a1f2c8e48703
hovercard-subject-tagpull_request:5272974289
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
twitter:imagehttps://avatars.githubusercontent.com/u/187596484?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/187596484?s=400&v=4
og:image:altWhat is this about? The cli hardcodes production hosts. Testing a cli change on preprod today means hand-editing bin/helpers/config.json plus the accessibility and observability constants.js files ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/browserstack/browserstack-cypress-cli git https://github.com/browserstack/browserstack-cypress-cli.git
octolytics-dimension-user_id1119453
octolytics-dimension-user_loginbrowserstack
octolytics-dimension-repository_id242935045
octolytics-dimension-repository_nwobrowserstack/browserstack-cypress-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id242935045
octolytics-dimension-repository_network_root_nwobrowserstack/browserstack-cypress-cli
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrowserstack%2Fbrowserstack-cypress-cli%2Fpull%2F1217%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrowserstack%2Fbrowserstack-cypress-cli%2Fpull%2F1217%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=browserstack%2Fbrowserstack-cypress-cli
Reloadhttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
Reloadhttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
Reloadhttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
browserstackhttps://github.com/browserstack
browserstack-cypress-clihttps://github.com/browserstack/browserstack-cypress-cli
Codehttps://github.com/browserstack/browserstack-cypress-cli
Issues28 (28)https://github.com/browserstack/browserstack-cypress-cli/issues
Pull requests47 (47)https://github.com/browserstack/browserstack-cypress-cli/pulls
Actionshttps://github.com/browserstack/browserstack-cypress-cli/actions
Projectshttps://github.com/browserstack/browserstack-cypress-cli/projects
Security and quality1 (1)https://github.com/browserstack/browserstack-cypress-cli/security
Insightshttps://github.com/browserstack/browserstack-cypress-cli/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fbrowserstack%2Fbrowserstack-cypress-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fbrowserstack%2Fbrowserstack-cypress-cli%2Fissues%2Fnew%2Fchoose
AakashHotchandanihttps://github.com/AakashHotchandani
masterhttps://github.com/browserstack/browserstack-cypress-cli/tree/master
SDK-8048-browserstack-env-preprodhttps://github.com/browserstack/browserstack-cypress-cli/tree/SDK-8048-browserstack-env-preprod
Conversation 1 https://github.com/browserstack/browserstack-cypress-cli/pull/1217
Commits 1 https://github.com/browserstack/browserstack-cypress-cli/pull/1217/commits
Checks 6 https://github.com/browserstack/browserstack-cypress-cli/pull/1217/checks
Files changed https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
Please reload this pagehttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
SDK-8048: support BROWSERSTACK_ENV=preprod|staging for internal testing https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#top
Show all changes 1 commit https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
c961827 SDK-8048: support BROWSERSTACK_ENV=preprod|staging for internal testing Nov 12, 2026 https://github.com/browserstack/browserstack-cypress-cli/pull/1217/commits/c96182740843426159039399f4870283977052c8
Clear filters https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
Please reload this pagehttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
Please reload this pagehttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
constants.js https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-1596064992ce0e7ef96c9239928bfd9b3db04a57caa0bfc243ab31bbd383b51c
config.js https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-897085e5322b0e10348313dfa9e4515c50981147821f2b6bfdb634ab7e29d5ed
environmentUrl.js https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-59868cc7e814fd2a69314fd36e97a61cbcf6bf14daf7daba02920b0a1c94a9d5
constants.js https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-7c5d8208281c535bcc2cd4c56474ec54619e6d00f296f09312245011436a18dc
helper.js https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-88327a4e0e4fd30fc5e51b0e5f91faaeacd56d8f1b8b86fbdab294b9a8d5c9a2
environmentUrl.js https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-bc510b67fb81eaea2fc14af5314c2b74f0641673839f58e269109926990de0c9
https://github.com/browserstack/browserstack-cypress-cli/blob/master/CODEOWNERS#L9
bin/accessibility-automation/constants.jshttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-1596064992ce0e7ef96c9239928bfd9b3db04a57caa0bfc243ab31bbd383b51c
View file https://github.com/browserstack/browserstack-cypress-cli/blob/c96182740843426159039399f4870283977052c8/bin/accessibility-automation/constants.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/{{ revealButtonHref }}
bin/helpers/config.jshttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-897085e5322b0e10348313dfa9e4515c50981147821f2b6bfdb634ab7e29d5ed
View file https://github.com/browserstack/browserstack-cypress-cli/blob/c96182740843426159039399f4870283977052c8/bin/helpers/config.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/{{ revealButtonHref }}
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-897085e5322b0e10348313dfa9e4515c50981147821f2b6bfdb634ab7e29d5ed
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-897085e5322b0e10348313dfa9e4515c50981147821f2b6bfdb634ab7e29d5ed
bin/helpers/environmentUrl.jshttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-59868cc7e814fd2a69314fd36e97a61cbcf6bf14daf7daba02920b0a1c94a9d5
View file https://github.com/browserstack/browserstack-cypress-cli/blob/c96182740843426159039399f4870283977052c8/bin/helpers/environmentUrl.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/{{ revealButtonHref }}
https://github.com/browserstack/browserstack-cypress-cli/blob/master/CODEOWNERS#L10
bin/testObservability/helper/constants.jshttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-7c5d8208281c535bcc2cd4c56474ec54619e6d00f296f09312245011436a18dc
View file https://github.com/browserstack/browserstack-cypress-cli/blob/c96182740843426159039399f4870283977052c8/bin/testObservability/helper/constants.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/{{ revealButtonHref }}
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-7c5d8208281c535bcc2cd4c56474ec54619e6d00f296f09312245011436a18dc
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-7c5d8208281c535bcc2cd4c56474ec54619e6d00f296f09312245011436a18dc
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-7c5d8208281c535bcc2cd4c56474ec54619e6d00f296f09312245011436a18dc
https://github.com/browserstack/browserstack-cypress-cli/blob/master/CODEOWNERS#L10
bin/testObservability/helper/helper.jshttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-88327a4e0e4fd30fc5e51b0e5f91faaeacd56d8f1b8b86fbdab294b9a8d5c9a2
View file https://github.com/browserstack/browserstack-cypress-cli/blob/c96182740843426159039399f4870283977052c8/bin/testObservability/helper/helper.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/{{ revealButtonHref }}
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-88327a4e0e4fd30fc5e51b0e5f91faaeacd56d8f1b8b86fbdab294b9a8d5c9a2
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-88327a4e0e4fd30fc5e51b0e5f91faaeacd56d8f1b8b86fbdab294b9a8d5c9a2
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-88327a4e0e4fd30fc5e51b0e5f91faaeacd56d8f1b8b86fbdab294b9a8d5c9a2
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-88327a4e0e4fd30fc5e51b0e5f91faaeacd56d8f1b8b86fbdab294b9a8d5c9a2
test/unit/bin/helpers/environmentUrl.jshttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files#diff-bc510b67fb81eaea2fc14af5314c2b74f0641673839f58e269109926990de0c9
View file https://github.com/browserstack/browserstack-cypress-cli/blob/c96182740843426159039399f4870283977052c8/test/unit/bin/helpers/environmentUrl.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/browserstack/browserstack-cypress-cli/pull/1217/{{ revealButtonHref }}
Please reload this pagehttps://github.com/browserstack/browserstack-cypress-cli/pull/1217/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.