Skip to content

v8: establish the standalone @wdio/browserstack-service v8 maintenance line - #42

Open
AakashHotchandani wants to merge 165 commits into
mainfrom
v8
Open

AakashHotchandani wants to merge 165 commits into
mainfrom
v8

Conversation

@AakashHotchandani

Copy link
Copy Markdown
Collaborator

Parallels the v9 conversion (#37) for the v8 line. The v8 branch is the long-lived v8 maintenance line, published to the npm v8 dist-tag via publishConfig.tag.

⚠️ Review/CI vehicle — not to be merged into main. v8 is a separate line from main (v9); it stays as the v8 branch. This PR mirrors how #37 tracks the v9 line. The mergeable release vehicle is the auto-opened "Version Packages" PR (→ 8.49.0).

Contents

Release

Manual/OIDC: push opens the "Version Packages" PR; Run workflow → publish does changeset publish --tag v8 with provenance. Gate the first v8 publish behind the v9 first-publish + freeze.

Regression

SDKWdioRegressionSharded: RUN_V8=true, WDIO_V8_BRANCH_NAME=v8, INSTALL_MODE=build-package.

🤖 Generated with Claude Code

AakashHotchandani and others added 15 commits June 13, 2026 16:10
…ide the gRPC core

Adds the WebdriverIO service (@wdio/browserstack-service) as packages/browserstack-service
and moves the existing gRPC/protobuf core (@browserstack/wdio-browserstack-service) into
packages/core (git history preserved), so both ship from this repo.

- npm workspace: root build builds core then service; tests scoped to the service.
- service: esbuild bundle (deps external) + tsc declarations; strict files allowlist
  (build + README + LICENSE + ambient d.ts); peerDeps for webdriverio/@wdio/* so the
  consumer keeps a single shared copy.
- release: Changesets + npm OIDC trusted publishing via .github/workflows/release.yml
  (main -> latest, v8 -> v8 dist-tag); the gRPC core is ignored by Changesets and stays
  on the SDK team's manual publish flow.
- fix(tests): the @wdio/reporter mock no longer imports the real module from within its
  own mock (a top-level vi.importActual + static import deadlocked vitest and hung
  reporter.test.ts); stub the stats classes instead. Full suite: 39 files / 980 tests
  pass and the run exits cleanly.
- repo metadata -> browserstack/wdio-browserstack-service; an added changeset bumps the
  first release to 9.29.0 (current npm latest is 9.28.0).

Verified locally: npm ci + build + test green; clean 80-file / ~590kB tarball; a real
BrowserStack session passed with webdriverio deduped to one copy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The committed lockfile was stale (carried entries from the pre-conversion layout), so CI's `npm ci` failed the sync check (EUSAGE: lockfile's @types/node@12.20.55 vs @types/node@25.9.3, missing undici-types). Regenerated against the current npm-workspace package.json set (760 -> 592 packages). `npm ci --dry-run` now passes; toolchain (typescript, vitest, esbuild, ts-proto, @bufbuild/buf + 7 platform optionalDeps) and workspace links (core <-> service) preserved.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The previous lockfile commit was produced by `npm install --package-lock-only` against a stale node_modules, so npm shortcut it ('up to date, audited ... in 2s') and only pruned the old tree instead of fully resolving. CI's `npm ci` then rebuilt the ideal tree from package.json and found mismatches (Invalid @types/node@12.20.55 vs 25.9.3, Missing esbuild@0.28.1, etc.).

Regenerated with both package-lock.json and node_modules absent so the resolution is computed purely from package.json (598 packages). Verified locally with npm@10.9.8 (CI's npm): `npm ci` installs cleanly, `npm run build` (core buf+tsc / service esbuild+tsc) succeeds, and `npm test` passes 980/980.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…-install)

The service declares non-optional peerDependencies (@wdio/cli, @wdio/logger, @wdio/reporter, @wdio/types, webdriverio). npm 7+ auto-installs peers by default, so CI's `npm ci` requires their full closure in the lock (@wdio/cli@9.28.0 -> create-wdio, tsx, inquirer, ejs, execa, esbuild@0.28.1, @vitest/snapshot@2.1.9, ...).

Prior lock commits were generated with a local ~/.npmrc legacy-peer-deps=true (left over from unrelated work), which suppressed peer auto-install and produced a lock missing that closure -> CI EUSAGE 'Missing @wdio/cli@9.28.0 from lock file' etc.

Regenerated with --no-legacy-peer-deps to match CI's default (598 -> 720 packages). Verified CI-exact: `npm ci --no-legacy-peer-deps` installs cleanly, build succeeds, 980/980 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ake timers

CI's Node 18.20 job (supported per engines: node >=18.20.0; wdio v9 supports 18.20) surfaced three Node-18-only failures that Node 20/22 tolerate:

1. PerformanceTester.start/end/measure called performance.mark/measure directly. Under vitest's full fake timers (7 test files) performance.now() goes negative, and Node 18's perf_hooks rejects negative timestamps (ERR_PERFORMANCE_INVALID_TIMESTAMP), throwing out of callers' before() hooks. Routed all mark/measure through safeMark/safeMeasure wrappers — instrumentation must never throw into business logic (no-op on the happy path; transparent on Node 20+).

2. uploadLogs used fs.openAsBlob (Node >=20 only). Added a Node-18 fallback to new Blob([readFileSync]) for the small log archive.

3. util.test.ts faked  via bare useFakeTimers(); scoped to toFake:['Date'] (it never advances timers), matching reporter.test.ts.

Verified locally on Node 18.20.5 AND Node 22: npm ci + build + 980/980 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nternal docs

Addresses automated PR review findings on #37:

- [SECURITY] release.yml: pin changesets/action, actions/checkout, actions/setup-node to full commit SHAs (with version comments) since this workflow holds id-token:write + publish. ci.yml left on tags (contents:read only).
- [DOCS] packages/core/package.json: description now describes the gRPC/protobuf core (not the service); dropped the 'webdriverio' keyword — corrects the public npm listing.
- [SECURITY] removed the five docs/ strategy/migration files from the public repo (kept internally). Their only cross-references were among themselves.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tadata

These two review fixes were edited but accidentally left unstaged when f935a52 (docs removal) was committed, so they never landed. Committing them now:

- release.yml: pin changesets/action, actions/checkout, actions/setup-node to full commit SHAs (with version comments).
- packages/core/package.json: description now describes the gRPC/protobuf core; dropped the 'webdriverio' keyword.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
setup-node's `registry-url` writes `//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}` into .npmrc; with no NODE_AUTH_TOKEN that empty token line can shadow npm OIDC Trusted Publishing at publish time. npm defaults to registry.npmjs.org and publishConfig.access=public already covers the scoped publish, so the line is unnecessary. Splitting the changesets publish into its own top-level step is noted as a further OIDC-hardening follow-up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- v8 service (8.48.0) swapped into packages/browserstack-service; metadata repointed
  to browserstack/wdio-browserstack-service; core dep ^2.0.2; files += README/LICENSE-MIT.
- ported safeMark/safeMeasure (Node-18 perf_hooks) into performance-tester.
- changeset baseBranch=v8.
- regenerated package-lock.json with DEFAULT npm (no --legacy-peer-deps): npm ci is in
  sync, so v8 does NOT need the flag (resolves reviewer concern).
- build green (core buf+tsc; service tsc); per-file tests pass.

KNOWN-OUTSTANDING: full-suite 'vitest --run' hangs in teardown (open PerformanceObserver
handles + vitest 1.x not force-exiting). Toolchain decision pending (vitest 1.x->3).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Per-file tests all pass and exit cleanly; whole-suite vitest --run still hangs in
teardown under vitest 1.x (open handle survives pool/teardown cleanup). Standalone
teardown remains the outstanding follow-up. setupFiles wires the per-file cleanup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…flake, per-file runner

Root causes of the standalone 'teardown hang' (upstream only runs these inside the
full monorepo suite, never standalone):
- __mocks__/@wdio/reporter.ts imported the stats classes from '@wdio/reporter' — the
  module it mocks — deadlocking mock resolution at collection (file hung, no output).
  Stats are type-only in the service, so replaced with stub classes. THIS was what
  wedged the whole-suite run.
- util.test.ts logPatcher spied process.emit at describe scope without resetting it, so
  a stray emit made the count flaky (7 vs 6). Clear the spy in the test.
- reporter.test.ts: scope fake timers to ['Date'] (mirrors v9).
- vitest.setup.ts: restore real timers + disconnect the PerformanceTester observer per
  file (dynamic import to avoid a circular-decorator init failure).
- test script now runs each file in its own process (scripts/test-isolated.mjs), judging
  by test result not clean exit, so any residual post-test open-handle lingering can't
  wedge CI. Result: 41/41 files pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Generate the gRPC/protobuf client inside @wdio/browserstack-service at
build time (buf generate -> src/grpc/generated) instead of depending on the
separately-published @browserstack/wdio-browserstack-service core.

- move buf.yaml / buf.gen.yaml + src/proto/** + the barrel (-> src/grpc/index.ts)
  from packages/core into packages/browserstack-service
- rewire all imports from '@browserstack/wdio-browserstack-service' to the
  local './grpc/index.js' barrel
- deps: drop the core, add @grpc/grpc-js + @bufbuild/protobuf;
  devDeps: add @bufbuild/buf + ts-proto
- build/clean/prepack run `buf generate` before tsc; src/proto ships in the
  tarball, src/grpc/generated stays gitignored
- delete packages/core; collapse root build script; changeset ignore: []

The published @browserstack/wdio-browserstack-service@2.0.x stays on npm
as-is (historical); nothing publishes a separate core going forward.

Verified on Node 22 + npm 10: build green (buf generate -> tsc), 41/41
test files pass, npm pack ships build/grpc + src/proto and no core dep.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Parity with the v9 fix (7c949da). CI runs plain `npm ci`
(legacy-peer-deps=false default), which requires the auto-installed
`@wdio/cli` peerDependency closure to be present in the lockfile. The
prior lockfile was generated with legacy-peer-deps=true and omitted that
closure, so npm ci failed "out of sync".

Regenerating with the peer tree exposed the same @types/node hoist
non-determinism as v9 (protobufjs/ts-proto pulls @types/node@25,
@manypkg/find-root pins ^12.7.1, and the v8 stack wants ^22), fixed with:

- overrides @types/node ^22.2.0 — collapses the 3-way spread to a single
  22.x (matches the service's declared ^22.2.0; types-only, no runtime
  impact), so npm install and npm ci agree.

Unlike v9, NO estree-walker workaround is needed: v8 uses vitest ^1.6.0,
which predates @vitest/mocker, so the deeply-nested-transitive drop that
affected v9 doesn't occur here.

Verified: `npm ci --legacy-peer-deps=false` passes, build passes, 0
runtime holes, full @wdio/cli peer tree present, cross-platform complete,
per-file tests green (service.test.ts 97/97). The aggregate
`npm test` (test-isolated.mjs) still hits the pre-existing all-at-once
teardown follow-up, unrelated to the lockfile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ow (upstream #15330)

Ports webdriverio/webdriverio#15330 (merged into monorepo v8 after the 2026-06-16 extract):
in the CLI/binary v8 flow, forward screenshot-on-failure to the binary over gRPC as a
TEST_SCREENSHOT log (uploaded via the binary's authorized testhub session) instead of the
direct-HTTP onScreenshot path (which 401s under the worker's binary-issued JWT); register the
command/result listeners in CLI mode so the screenshot command result is captured; and honor the
incoming log kind in the mocha CLI framework. Keeps the standalone v8 line at parity with the
monorepo. Src-only change (matches upstream — no test changes); builds clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…elease.yml

- Move @wdio/logger|reporter|types from peerDependencies to dependencies (pinned 8.x),
  mirroring the v9 line so the published package carries them.
- Switch release.yml to the manual/hybrid model (parity with the v9 branch): push opens the
  "Version Packages" PR only; publishing is a manual workflow_dispatch (publish=true) →
  v8 dist-tag via publishConfig.tag, over OIDC. The existing take-over-publishing changeset
  (minor) computes the first standalone v8 release as 8.49.0 (> npm v8 8.48.3).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/ci.yml Fixed
Comment thread .github/workflows/ci.yml Fixed
Comment thread packages/browserstack-service/.github/workflows/ci.yml Fixed
Comment thread packages/browserstack-service/.github/workflows/ci.yml Fixed
Comment thread packages/browserstack-service/.github/workflows/release.yml Fixed
Comment thread packages/browserstack-service/.github/workflows/release.yml Fixed
Comment thread packages/browserstack-service/.github/workflows/release.yml Fixed
Comment thread packages/browserstack-service/src/insights-handler.ts Fixed
Comment thread packages/browserstack-service/src/util.ts Fixed
const sessionId = browser.sessionId

// a utility function to escape single and double quotes
const escapeString = (str: string) => str.replace(/'/g, "\\'").replace(/"/g, '\\"')
const sessionId = browser.sessionId

// a utility function to escape single and double quotes
const escapeString = (str: string) => str.replace(/'/g, "\\'").replace(/"/g, '\\"')
Comment thread packages/browserstack-service/src/util.ts Fixed
…lour) + SHA-pin ci.yml actions

- test-isolated.mjs: under CI=true vitest forces ANSI colour even when piped, so the summary
  regexes (`Tests \d+ passed`) failed to match (colour codes between "Tests" and the count) and
  every passing file was mis-flagged "no test summary" → CI red. Strip ANSI in classify() and set
  NO_COLOR/FORCE_COLOR=0 on the spawned vitest. Verified: `CI=true npm test` → 41/41 files pass.
- ci.yml: pin actions/checkout + actions/setup-node to full commit SHAs (resolves the semgrep
  github-actions-mutable-action-tag findings, parity with the v9 line).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
function classify(output) {
// CI (CI=true) makes vitest force ANSI colour even when piped, which would break the
// summary regexes below (colour codes sit between "Tests" and the count). Strip them first.
const clean = output.replace(new RegExp(String.fromCharCode(27) + '\[[0-9;]*m', 'g'), '')
AakashHotchandani and others added 8 commits July 11, 2026 21:13
…ith/slice + drop vestigial nested workflows

- getHierarchy (insights-handler.ts + util.ts): replace `new RegExp(' ' + test.description + '$')`
  with an endsWith/slice suffix strip — avoids ReDoS and regex-metacharacter mismatches when the
  Jasmine description contains regex specials. Behaviour-preserving; mirrors the v9 fix (65d7c33).
- Remove packages/browserstack-service/.github/workflows/{ci,release}.yml — vestigial duplicates
  from the extraction (GitHub only runs root-level workflows; these never executed) that carried
  unpinned action tags. Root workflows are already SHA-pinned.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… peer (v8)

Same parity fix as v9: the extraction moved webdriverio from dependencies into
peerDependencies. The v8 package published from the WebdriverIO monorepo
(@wdio/browserstack-service@8.48.3) keeps webdriverio in dependencies (8.46.0) and
peers only @wdio/cli. Move it back to dependencies to restore install parity and
avoid npm ERESOLVE against deps peering a non-overlapping webdriverio range.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix(v8): declare webdriverio as a dependency, not a peer (install parity)
Port of webdriverio/webdriverio#15374 (v8 backport of #15373) to the
standalone repo.

With skipAppOverride: true the service classifies the session as App
Automate even when no app option is set, skips the app upload, and does
not inject an appium:app capability — the user supplies the app
reference themselves. Conflicting app option is warned about and
ignored; skipAppOverride: false with no app fails fast before any
session starts. The option is stripped from bstack:options and never
forwarded to the hub.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…exit-signal/log-redaction

Ports 4 upstream webdriverio/webdriverio v8 commits to the standalone v8 line:
- #15231 test management (testPlanId) support + CLI-only caps stripping + build-start errors
- #15217 raise gRPC send/receive message size limit to 20 MB
- #15146 terminate CLI process with SIGINT (not SIGKILL) on Unix
- #15200 redact credentials from CLI log output

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…LI flow

v8 port of the v9 fix, plus the hook-routing backport v8 never received:

- beforeHook/afterHook CLI branches: route hook lifecycle to the binary via
  the TestFramework tracker (gRPC). Without this the v8 CLI flow emits no
  HookRunStarted/HookRunFinished at all (the legacy Listener -> api/v1/batch
  path is not functional in the CLI pipeline).
- cli/skipReporter (new): reports tests that never reach beforeTest/afterTest
  (static it.skip, this.skip() in before/beforeEach hooks, suites aborted by a
  failed before hook) through the tracker using the same INIT_TEST -> TEST PRE
  -> LOG_REPORT POST -> TEST POST sequence afterTest uses, serialized (wdio
  does not await reporter hooks) and deduped against started tests.
- reporter.onTestSkip CLI branch + service.afterHook skip cascade (port of the
  legacy insights-handler skip propagation).
- Hook results: reading `testResult.status` (nonexistent on TestResult) left
  hook_result at 'pending', coerced downstream to 'passed' — failed
  before-hooks produced green builds while CI exited 1. Map from the actual
  passed/skipped fields.

Without these, such tests are invisible on the dashboard and their Automate
sessions are never linked to the build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dalwin-Barnard and others added 21 commits September 29, 2026 19:08
…-uuid-fallback

Merge LCAM-1282-fix-test-metadata-uuid-fallback
…er-precedence-v8

Fix/sdk 4748 build identifier precedence v8
Release drop for fix/SDK-4748-build-identifier-precedence-v8 and LCAM-1282-fix-test-metadata-uuid-fallback
- util: treat *.bsstag.com as BrowserStack only on a named staging env
  (BROWSERSTACK_STAGING_ENV bare token, trimmed; or BROWSERSTACK_ENV
  staging/stag/preprod/pre-prod), exact suffix match, case-insensitive.
  Replaces the unconditional `includes('bsstag')` match.
- cli: BROWSERSTACK_BINARY_URL fallback also covers a 2xx update_cli reply
  with no url and no cached binary; a failed fallback download uses the
  cached binary when present; the update_cli error is logged; the perf span
  closes on every path.
- service: _printSessionURL logs a failed or empty session lookup at debug
  instead of throwing (v8 uses got, which throws on 404/401).
- tests: bsstag gating, fallback download failures, 2xx-without-url,
  _printSessionURL 404 / missing automation_session.

Addresses review comments 4256353854 and 4256353859.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…K-6948)

With *.bsstag.com sessions now recognised on named staging envs, _update
PUTs/PATCHes the session REST host there. got rejects on a non-2xx reply, so
a 401/404 surfaced as a beforeSuite/beforeTest/beforeFeature hook error (via
_setSessionName) and skipped the rest of after(). main/v9 uses fetch, which
resolves on HTTP errors; match that: log HTTP-status errors at debug and keep
rejecting on network errors.

Tests: PUT 401 and TurboScale PATCH 404 resolve with a debug log; a network
error still rejects.

Addresses review comment 4256713959.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… TurboScale debug log (SDK-6948)

- Changeset: session marking and TRA linking on named staging envs work in
  the CLI flow, where the binary supplies the staging session REST host
  (APIUtils.updateURLSForGRR). The classic non-CLI flow on a named staging
  env is documented as unsupported (same as main/v9 #275); its session
  update is skipped at debug.
- service.test.ts: the TurboScale _update test now asserts the
  'Could not update Browserstack session (404)' debug log.

Addresses review comments 4256880250 and 4256880265.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The service read projectName/buildName only from the config file, so an
exported BROWSERSTACK_PROJECT_NAME / BROWSERSTACK_BUILD_NAME never reached
the session and the build was created under the config-file name.

Every other SDK already maps these (node-agent capsMapping.js, python
constants.py, javaagent SeleniumPatchUtils.java, csharp utils.cs) and so
does the binary's own env->config map (core/config/env.js). The binary
resolves them correctly here too, but the service consumes only hubUrl,
apis, credentials, accessibilityOptions and testContextOptions from that
resolved config, so the values were dropped before reaching the caps.

Write them into the capability at both shapes, mirroring the existing
localIdentifier handling, so the session carries the env value.

Verified against a wdio_cucumber sample in binary flow (SDK_CLI_BIN_PATH
pinned, cold cache). Session capabilities, config file vs env differing:

  before  platforms[0].projectName = 'repro_project'
          platforms[0].buildName   = 'repro_build'
  after   platforms[0].projectName = 'repro_project_env_vars'
          platforms[0].buildName   = 'repro_build_env_vars'

Refs SDK-7075 — unblocks the app_automate env_vars tests, whose fixture
looks the build up by project AND build name and so failed with
"Project with name '<name>_env_vars' not found" before reaching its
BROWSERSTACK_LOCAL assertions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…7075)

Adds three constructor tests: the env vars win over the caps for both the
array and the multiremote capability shapes, and the caps values survive
when the env vars are unset. The two "prefer env" tests fail without the
launcher change.

Folding BROWSERSTACK_BUILD_NAME into the caps also means a buildName is
now present whenever that var is exported, so _handleBuildIdentifier no
longer treats it as missing and keeps the identifier instead of dropping
it. Updates that test to the corrected contract and refreshes the SDK-4748
comments that asserted this service never reads the var as a buildName
source. "buildName absent" now means absent from both the caps and the
environment, which the BUILD_RUN_IDENTIFIER test already covers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…-7757)

getBinConfig rebuilt testManagementOptions with testPlanId only, so issues,
issueTracker and any other key set in the service options never reached the
binary, which now sends the merged object as test_management_options at build
start. Pass the object through as configured, still trimming testPlanId and
dropping it when blank. Type issues and issueTracker and allow other keys.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…(SDK-7075)

The env override only ran when the caps already carried bstack:options.
Caps the service builds bstack:options for (extension caps such as
goog:chromeOptions) and legacy caps (top-level build/project keys) still
ignored BROWSERSTACK_PROJECT_NAME / BROWSERSTACK_BUILD_NAME, so the build
start payload and _handleBuildIdentifier kept seeing the config name.

Fold the override into one _applyEnvBuildNames helper called from all four
capability arms: it writes into bstack:options when present, into the
top-level project/build keys of legacy caps on a BrowserStack session, and
never touches the caps of a non-BrowserStack session. Blank env values are
ignored. The tests now clean the env vars in afterEach and cover the
service-created, legacy, multiremote and non-BrowserStack shapes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…orting (SDK-7075)

- Align top-level project/build keys that sit next to bstack:options, so a
  capability never carries two different names. (Live probe: the hub prefers
  bstack:options, so this is defensive, not a behaviour change.)
- Return no names for a non-BrowserStack session: its caps are left untouched,
  so the Test Reporting fields keep the caps values instead of disagreeing with
  the session.
- Tests: restore the isBStackSession spy in finally; cover padded env values,
  a build-only env override and the mixed bstack:options + top-level shape.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…plies (SDK-7075)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ognition

fix(util): recognize *.bsstag.com hosts as BrowserStack (v8, SDK-6948)
// a utility function to check if the hostname is browserstack

const isBrowserstack = (str: string ): boolean => {
return str.includes('browserstack.com') || isStagingEnvBsstagHost(str)
github-actions Bot and others added 8 commits October 15, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.