Skip to content

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

Draft
darshan3881 wants to merge 1 commit into
masterfrom
OB-10135-cypress-error
Draft

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

Conversation

@darshan3881

@darshan3881 darshan3881 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

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 (new) dashboard can call the railsApp /api/v1/cypress-builds/:id/resource-errors endpoint in the correct id-space directly, removing the OB-9830 reverse-lookup shim once end-to-end coverage is verified.

Payload change

Before:
```js
{ "stop_time": "..." }
```

After:
```js
{
"stop_time": "...",
"automate_build_id": ""
}
```

Purely additive — obs-api ingest declares automate_build_id as an optional typed field on BuildStopParams. Older ingest servers ignore unknown JSON keys (Jackson default), so this CLI change is safe to ship even before obs-api deploys.

Guarded by observability-session check

The new env var is only cached when isTestObservabilitySession is true (bin/commands/runs.js:341), and the payload change is only in stopBuildUpstream which is already o11y-gated. Non-o11y runs (customers with observability disabled) are unaffected.

Related

Test plan

  • node -c syntax check on both modified files
  • Local run against staging obs-api once ingest DTO accepts the field
  • End-to-end verification: run a real Cypress build → check obs-api's builds table has the new column populated after buildStop

Files changed

  • bin/commands/runs.js (+5) — cache data.build_id into process.env.BROWSERSTACK_AUTOMATION_BUILD_ID inside the isTestObservabilitySession block
  • bin/testObservability/helper/helper.js (+6/-1) — include automate_build_id in the stopBuildUpstream payload

Total: 2 files, +11/-1.

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>
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