diff --git a/bin/commands/runs.js b/bin/commands/runs.js index df02954a..025037ff 100644 --- a/bin/commands/runs.js +++ b/bin/commands/runs.js @@ -340,6 +340,11 @@ module.exports = function run(args, rawArgs) { utils.setProcessHooks(data.build_id, bsConfig, bs_local, args, buildReportData); if(isTestObservabilitySession) { utils.setO11yProcessHooks(data.build_id, bsConfig, bs_local, args, buildReportData); + // OB-10135: cache the automate build id so `stopBuildUpstream` + // can include it on the obs-api buildStop payload. Enables the + // synergy dashboard to call the railsApp resource-errors + // endpoint in the automate id-space directly. + process.env.BROWSERSTACK_AUTOMATION_BUILD_ID = data.build_id; } let message = `${data.message}! ${Constants.userMessages.BUILD_CREATED} with build id: ${data.build_id}`; let dashboardLink = `${Constants.userMessages.VISIT_DASHBOARD} ${data.dashboard_url}`; diff --git a/bin/testObservability/helper/helper.js b/bin/testObservability/helper/helper.js index 9bb2a579..3e213d77 100644 --- a/bin/testObservability/helper/helper.js +++ b/bin/testObservability/helper/helper.js @@ -684,7 +684,12 @@ exports.stopBuildUpstream = async () => { }; } else { const data = { - 'stop_time': (new Date()).toISOString() + 'stop_time': (new Date()).toISOString(), + // OB-10135: propagate the automate build hashed_id (cached at + // build-create time in runs.js) so obs-api can persist it and the + // synergy dashboard can call the railsApp resource-errors endpoint + // in the automate id-space directly. + 'automate_build_id': process.env.BROWSERSTACK_AUTOMATION_BUILD_ID }; const config = { headers: {