Skip to content

Release drop for fix/SDK-4748-build-identifier-precedence-v8 and LCAM-1282-fix-test-metadata-uuid-fallback - #256

Merged
rahulpsq merged 11 commits into
v8from
sdk_v8_pre_prod
Sep 30, 2026
Merged

rahulpsq merged 11 commits into
v8from
sdk_v8_pre_prod

Conversation

@rahulpsq

Copy link
Copy Markdown
Contributor

What is this about?

Related Jira task/s

Release (mandatory for every PR — required for the ready-for-review label)

Version bump: (required — tick exactly one)

  • minor (backwards-compatible feature)
  • patch (bug fix or other small change)

Release notes type: (optional)

  • New Feature
  • Bug Fix
  • Other Improvement

Release notes (customer-facing): (optional but encouraged)

Release notes (internal): (required — engineer-facing; what actually changed / why)

Checklist

  • Ready to review
  • Has it been tested locally?

PR Validations

Run Tests: Comment RUN_TESTS to trigger sanity tests.

shivamku-BS and others added 11 commits September 27, 2026 14:51
…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>
…CAM-1282)

setTestMetadata() is called before the test-run uuid is assigned, so only
fallbackMetadata gets populated and metadataByTestRunUuid stays empty.
testHubModule reads it back with TestMetadata.get(uuid), which has returned
{} since the fallback was removed — so app_lcnc was dropped from the
outgoing TestRun event and App LCA test runs never got linked to TestHub.

A per-uuid lookup now falls back to the current-run metadata only when no
per-uuid metadata has been recorded at all. Once per-uuid tracking is
active, an unknown uuid still returns {}, so one test run's metadata can
never leak into another.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Replaces the guarded variant with the exact restore of the clause removed
in aa8898f:

    metadataByTestRunUuid[testRunUuid] || fallbackMetadata || {}

testHubModule calls TestMetadata.reset() after each test completes, and
that is what bounds reuse across runs, so the plain restore is sufficient
and keeps get(uuid) consistent with the no-arg get().

Tests updated to assert the restored semantics, plus a new case covering
that reset() between tests prevents a previous run's metadata being served.

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

The failure this PR fixes was silent end to end: setTestMetadata stored
only the fallback, get(uuid) returned {}, and app_lcnc was omitted from
the event with nothing logged anywhere.

Adds two debug lines, both after the app_lcnc gate so they stay silent
for every other SDK consumer:

  setTestMetadata: identifier=... storedUnderUuid=... store=[...]
  TestMetadata.get: uuid=... identifier=... store=[...]

storedUnderUuid=undefined with store=[] identifies the ordering directly,
and identifier=undefined on the get line is the failure signature.

Also warns when setTestMetadata is called by a non-app_lcnc central user,
which previously returned silently.

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>
…-uuid-fallback

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

Fix/sdk 4748 build identifier precedence v8
@rahulpsq
rahulpsq requested a review from a team as a code owner September 30, 2026 09:40
@rahulpsq
rahulpsq requested review from kamal-kaur04 and pri-gadhiya and removed request for a team September 30, 2026 09:40
@coderabbitai

coderabbitai Bot commented Sep 30, 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: Enterprise

Run ID: 24323a83-9294-4779-84b3-52c891f05e2b

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

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

@rahulpsq
rahulpsq merged commit f26ea4c into v8 Sep 30, 2026
5 checks passed
@bsautomation
bsautomation deleted the sdk_v8_pre_prod branch September 30, 2026 12:55
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.

5 participants