Skip to content

fix(observability): honour configured build_name over BROWSERSTACK_BUILD_NAME on new dashboard [SDK-6431]#1130

Open
harshit-browserstack wants to merge 1 commit into
masterfrom
ops/sdk-6431-buildname-precedence
Open

fix(observability): honour configured build_name over BROWSERSTACK_BUILD_NAME on new dashboard [SDK-6431]#1130
harshit-browserstack wants to merge 1 commit into
masterfrom
ops/sdk-6431-buildname-precedence

Conversation

@harshit-browserstack

@harshit-browserstack harshit-browserstack commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

What & why

SDK-6431 On CI (reported on Atlassian Bamboo), the new TestHub/TRA-backed dashboard showed a CI-derived build name (e.g. Bamboo-42) instead of the build_name: "sanity" configured in browserstack.json, while the old Automate dashboard correctly showed the configured value.

Root cause

getBuildDetails() (bin/helpers/helper.js) put process.env.BROWSERSTACK_BUILD_NAME at the top of its precedence chain, above explicit config:

BROWSERSTACK_BUILD_NAME (env) -> testObservabilityOptions.buildName -> run_settings.build_name -> cwd

The Automate capability path (capabilityHelper.js) uses only run_settings.build_name and never reads the env var. When the customer's CI exposes BROWSERSTACK_BUILD_NAME, the two dashboards disagree. The build name in the TRA build-creation request body (testhubHandler.js name: buildName) is built from getBuildDetails, so it carried the CI value.

Confirmed against the customer's reported TRA payload ({"request_body":{"name":"Bamboo-42",...}}) and SDK 1.36.8 (identical precedence).

Fix

Demote BROWSERSTACK_BUILD_NAME / BROWSERSTACK_PROJECT_NAME to a fallback so explicit config wins. New precedence:

testObservabilityOptions.buildName -> run_settings.build_name -> env var -> cwd

Makes the new dashboard consistent with Automate and preserves the env var for users who don't configure a build name (no regression).

Tests

  • 4 new unit tests in test/unit/bin/helpers/helper.js: config beats env, testObs.buildName beats env, env fallback when unconfigured, project_name precedence.
  • npx mocha test/unit/bin/helpers/helper.js -> 7 passing.

Note

Precedence/behaviour change (explicit config now beats BROWSERSTACK_BUILD_NAME on the new dashboard). Intentional for cross-dashboard consistency — flagging for reviewer awareness.

🤖 Generated with Claude Code

…ILD_NAME on new dashboard [SDK-6431]

getBuildDetails() prioritised process.env.BROWSERSTACK_BUILD_NAME above the
explicitly configured build name. On CI (e.g. Atlassian Bamboo) where that env
var carries a CI-derived value, the new (TestHub/TRA-backed) dashboard showed
the CI name while the Automate dashboard kept the configured run_settings.build_name
— a cross-dashboard discrepancy.

Demote BROWSERSTACK_BUILD_NAME / BROWSERSTACK_PROJECT_NAME to a fallback so
explicit config (testObservabilityOptions.buildName -> run_settings.build_name)
wins, matching the Automate capability path. The env var is still honoured when
no build name is configured (no regression for env-only users).

Adds 4 unit tests for getBuildDetails precedence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant