OB-10135: propagate automate build id on observability buildStop#1145
Draft
darshan3881 wants to merge 1 commit into
Draft
OB-10135: propagate automate build id on observability buildStop#1145darshan3881 wants to merge 1 commit into
darshan3881 wants to merge 1 commit into
Conversation
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>
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.
Summary
Cache the automate build hashed_id at build-create time and include it as
automate_build_idon 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-errorsendpoint 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_idas an optional typed field onBuildStopParams. 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
isTestObservabilitySessionis true (bin/commands/runs.js:341), and the payload change is only instopBuildUpstreamwhich is already o11y-gated. Non-o11y runs (customers with observability disabled) are unaffected.Related
Test plan
node -csyntax check on both modified filesbuildstable has the new column populated after buildStopFiles changed
bin/commands/runs.js(+5) — cachedata.build_idintoprocess.env.BROWSERSTACK_AUTOMATION_BUILD_IDinside theisTestObservabilitySessionblockbin/testObservability/helper/helper.js(+6/-1) — includeautomate_build_idin thestopBuildUpstreampayloadTotal: 2 files, +11/-1.