Skip to content

OB-10135: propagate automate build id on observability buildStop#1145

Open
darshan3881 wants to merge 3 commits into
masterfrom
OB-10135-cypress-error
Open

OB-10135: propagate automate build id on observability buildStop#1145
darshan3881 wants to merge 3 commits into
masterfrom
OB-10135-cypress-error

Conversation

@darshan3881

@darshan3881 darshan3881 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stamp the automate build id onto the observability buildStop payload so the pipeline can persist it and the synergy dashboard can address the automate resource-errors endpoint directly (OB-10135). Producer-side change only — two lines, no new endpoint.

What lands here

File Change
bin/commands/runs.js On automate build-create success (o11y session), cache the id: process.env.BROWSERSTACK_AUTOMATION_BUILD_ID = data.build_id;
bin/testObservability/helper/helper.js Include automate_build_id: process.env.BROWSERSTACK_AUTOMATION_BUILD_ID in the PUT /api/v1/builds/:id/stop payload

The env var mirrors the existing BS_TESTOPS_BUILD_HASHED_ID pattern. The automate build is created after the observability buildStart (post zip-upload), so buildStop is the first lifecycle event where the id exists — hence it's stamped there, not at start.

Why

OB-9830 traced the Cypress resource-errors 404 to an id-space mismatch on the synergy dashboard. The clean end-state: the SDK sends the automate build id → pipeline persists it in the build metadata → obs-api serves it → FE calls the automate resource-errors endpoint with the correct id. This PR is the producer half.

Related PRs

  • Pipeline (persistence): browserstack/observability-pipeline#7343
  • Frontend (consumer): browserstack/frontend#48305

Test plan

  • Real Cypress smoke via the patched CLI against preprod — the buildStop payload carries automate_build_id, and the value surfaces on the observability build's metaData and rides the BUILD_FINISHED pusher event (confirmed on the synergy dashboard).

Notes

  • Backward compatible: the field is nullable; older/other-framework runs are unaffected.
  • No detection gating — the id is stamped whenever the automate build id is present.

darshan3881 and others added 3 commits July 6, 2026 17:48
Cache the automate build hashed_id at build-create time and include it
as `automate_build_id` on the observability-api buildStop payload
(`PUT /api/v1/builds/:id/stop`). Lets obs-api persist the mapping so
the synergy dashboard can call the railsApp resource-errors endpoint
in the automate id-space directly (removing the OB-9830 reverse-lookup
shim once end-to-end coverage is verified).

Only fires when `isTestObservabilitySession` is true, so non-o11y runs
are unaffected. Payload change is additive; obs-api ingest accepts the
new field via a typed `automate_build_id` on `BuildStopParams`.

Spec: https://browserstack.atlassian.net/wiki/spaces/ENG/pages/6322258049/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@darshan3881 darshan3881 marked this pull request as ready for review July 14, 2026 11:37
@darshan3881 darshan3881 requested a review from a team as a code owner July 14, 2026 11:37
@darshan3881 darshan3881 requested review from osho-20 and rounak610 July 14, 2026 11:37
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