Skip to content

Merge fix/SDK-7075-honour-project-name-env - #291

Merged
bsautomation merged 6 commits into
sdk_v8_pre_prodfrom
fix/SDK-7075-honour-project-name-env
Oct 15, 2026
Merged

bsautomation merged 6 commits into
sdk_v8_pre_prodfrom
fix/SDK-7075-honour-project-name-env

Conversation

@bsautomation

Copy link
Copy Markdown
Contributor

Merge into sdk_v8_pre_prod :by automationbs

shivamku-BS and others added 6 commits October 13, 2026 15:33
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>
…(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>
@bsautomation
bsautomation requested a review from a team as a code owner October 15, 2026 13:07
@bsautomation
bsautomation requested review from AakashHotchandani and yashdsaraf and removed request for a team October 15, 2026 13:07
@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Central YAML (base), Organization UI (inherited), Workspace UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: f90ca53e-be25-4771-a5b0-c3bf8d515c2d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@bsautomation
bsautomation merged commit 0bfb566 into sdk_v8_pre_prod Oct 15, 2026
14 of 15 checks passed
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.

2 participants