fix(SDK-4165): keep buildIdentifier when BROWSERSTACK_BUILD_NAME is set (v8 backport of #192) - #235
Open
harshit-browserstack wants to merge 2 commits into
Open
harshit-browserstack wants to merge 2 commits into
harshit-browserstack wants to merge 2 commits into
Conversation
_handleBuildIdentifier skipped buildIdentifier resolution whenever
BROWSERSTACK_BUILD_NAME was set, even though a buildName was available.
The skip also deleted buildIdentifier from the capabilities only — this
._buildIdentifier kept the unresolved '#${BUILD_NUMBER}' template, which
onPrepare forwards to TestHub as build_identifier.
Consequence: successive runs sharing a build name were never
disambiguated, so their sessions collapsed into a single build.
The guard now keys solely on the absence of a buildName, which is what
its own warning always claimed and what the binary's handleBuildIdentifier
already does (its BROWSERSTACK_BUILD_NAME skip is commented out). The
skip path additionally clears _buildIdentifier so the raw template is
never reported as a value.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
harshit-browserstack
requested review from
anish353 and
rounak610
and removed request for
a team
September 25, 2026 15:00
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited), Workspace UI (inherited) Review profile: ASSERTIVE Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
What is this about?
Backport of #192 to the v8 line. SDK-4165 is titled
[Framework- WDIO v8 v9], and the defect is present onv8atpackages/browserstack-service/src/launcher.ts:1069— the same line #192 fixed onmain.Launcher._handleBuildIdentifierskipped buildIdentifier resolution wheneverBROWSERSTACK_BUILD_NAMEwas set, even though abuildNamewas available. The skip was also partial: it removedbuildIdentifierfrom the capabilities but leftthis._buildIdentifierholding the unresolved#${BUILD_NUMBER}template, which is forwarded to TestHub asbuild_identifier. Successive runs sharing a build name therefore collapsed into one build instead ofname #1,name #2.The guard now keys only on a missing
buildName, and the skip path clears_buildIdentifier. This is a clean cherry-pick offddde2afrom #192 — no conflicts, identical change.Related Jira task/s
SDK-4165 —
[Framework- WDIO v8 v9] Builds are getting merged for GRR user for AA session in o11y dashboardv9 counterpart: #192
Release (mandatory for every PR — required for the
ready-for-reviewlabel)Version bump: (required — tick exactly one)
Release notes type: (optional)
Release notes (customer-facing): (optional but encouraged)
buildIdentifierbeing ignored when theBROWSERSTACK_BUILD_NAMEenvironment variable is set. Successive runs that share a build name are now reported as separate builds (my-build #1,my-build #2) instead of merging into one.Release notes (internal): (required — engineer-facing; what actually changed / why)
_handleBuildIdentifierno longer skips resolution becauseBROWSERSTACK_BUILD_NAMEis set; the guard keys only on a missingbuildName.this._buildIdentifier, so the unresolved#${BUILD_NUMBER}/${DATE_TIME}template is no longer sent to TestHub asbuild_identifier.Checklist
How this was tested
tests/launcher.test.ts— 115/115 pass (run from the package afternpm run generate, astest-isolated.mjsdoes).launcher.tsrestored and the new tests kept, the two new cases fail — "should still resolve buildIdentifier when buildName is in caps and BROWSERSTACK_BUILD_NAME is set" and "should not retain an unresolved buildIdentifier template when the identifier is skipped" — so they genuinely exercise the fix. (A third, pre-existing case also fails in that state only because the first failing test exits before deleting theBROWSERSTACK_BUILD_NAMEenv var it set; with the fix, all 115 pass.)tsc -p tsconfig.prod.json --noEmitclean.PR Validations
Run Tests: Comment RUN_TESTS to trigger sanity tests.
🤖 Generated with Claude Code