Fix/sdk 4748 build identifier precedence v8 - #252
Merged
Dalwin-Barnard merged 5 commits intoSep 29, 2026
Merged
Conversation
…ifier
v8 port of the same fix on main. _handleBuildIdentifier is byte-identical
across the two branches apart from the capabilities type
(Capabilities.RemoteCapabilities here, Capabilities.TestrunnerCapabilities
on main), so the change is the same.
- Skip the identifier only when there is no buildName at all, instead of
also whenever BROWSERSTACK_BUILD_NAME happens to be exported.
- Resolve BROWSERSTACK_BUILD_IDENTIFIER, then BROWSERSTACK_BUILD_RUN_IDENTIFIER,
ahead of the service options / capabilities value.
- Sweep any remaining ${ENV_VAR} placeholder against process.env after the
${DATE_TIME} / ${BUILD_NUMBER} substitutions, leaving unset variables literal.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…d tokens
Critical: the !buildName branch stripped buildIdentifier from capabilities but
left this._buildIdentifier set. launchTestSession reads that field for the
build-start payload's build_identifier, so an env-sourced value was reported to
O11y while never being applied to any capability. Pre-existing as a shape, but
the new env tier makes it reachable with zero user configuration, since CI
commonly injects BROWSERSTACK_BUILD_RUN_IDENTIFIER globally. Both the field and
browserStackConfig.buildIdentifier are now cleared alongside the caps update.
Warning: the generic ${ENV_VAR} sweep reprocessed ${BUILD_NUMBER}. When neither
getCiInfo() nor _getLocalBuildNumber() could resolve it the token was left
literal by design, and the sweep then substituted a raw process.env.BUILD_NUMBER
- without the 'CI ' prefix every other path applies. getCiInfo() recognises a
fixed vendor list that excludes GitHub Actions, and TeamCity exports a bare
BUILD_NUMBER, so this was reachable in practice. DATE_TIME and BUILD_NUMBER are
now excluded from the sweep.
Suggestion: `?? match` guarded only nullish, so an exported-but-empty variable
blanked that part of the identifier - contradicting the adjacent comment and
inconsistent with the tier-1 check, which treats whitespace-only as absent.
Empty and whitespace-only values now leave the literal placeholder.
Tests: the "buildName absent" case asserted only the caps side-effect, which the
pre-PR code would also have satisfied; it now asserts _buildIdentifier too. Added
regression tests for the reserved-token and empty-env cases. afterEach now clears
BUILD_NUMBER, so the pre-existing "stays literal" assertions no longer depend on
the ambient environment.
_handleBuildIdentifier block 17 -> 19 tests. Full suite 1347 passed (3 errors
pre-existing in uploadLogsArchive.test.ts, unchanged on a clean tree).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review feedback on #237: condense the explanatory comments added by this PR. Five blocks in launcher.ts and four in launcher.test.ts, each down to 2-4 lines. The rationale is kept in each - why DATE_TIME/BUILD_NUMBER are excluded from the sweep, and why the in-memory field is cleared alongside the capability - since those are what stop the defects being reintroduced. Only the background narration is dropped. No code change; 45/46 test files pass, the one failure being the pre-existing crash-reporter.test.ts build dependency. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Dalwin-Barnard
requested review from
07souravkunda and
pri-gadhiya
and removed request for
a team
September 29, 2026 14:06
|
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 |
4 of 7 tasks
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?
Related Jira task/s
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)
Release notes (internal): (required — engineer-facing; what actually changed / why)
Checklist
PR Validations
Run Tests: Comment RUN_TESTS to trigger sanity tests.