Skip to content

fix(ci-info): use GITHUB_RUN_ID for build_number on GitHub Actions [SDK-6279]#1123

Open
harshit-browserstack wants to merge 1 commit into
masterfrom
ops/sdk-6279-gha-ci-build-number
Open

fix(ci-info): use GITHUB_RUN_ID for build_number on GitHub Actions [SDK-6279]#1123
harshit-browserstack wants to merge 1 commit into
masterfrom
ops/sdk-6279-gha-ci-build-number

Conversation

@harshit-browserstack

Copy link
Copy Markdown
Collaborator

Problem

On GitHub Actions, getCiInfo() (bin/helpers/helper.js) populated build_number from GITHUB_RUN_NUMBER — the per-workflow sequential counter (e.g. 23) — while build_url is built from GITHUB_RUN_ID — the globally-unique run id (26976467840) that appears in the actions/runs/<id> URL.

So the ci_info the SDK ships to TestHub had build_url and build_number pointing at two different identifiers for the same run. Test Observability's dashboard Rerun keys its GitHub workflow_dispatch re-dispatch off build_number; 23 is not a valid run id, so GitHub returns 404, which obs-api translates to 400 "Invalid Params!", surfacing to the customer as an HTTP 500. (SDK-6279)

Fix

- build_number: env.GITHUB_RUN_NUMBER
+ build_number: env.GITHUB_RUN_ID

Aligns build_number with the run id build_url already uses on the line above.

Scope

GitHub Actions branch only. Every other CI provider (Jenkins, CircleCI, Travis, Bitbucket, Drone, Semaphore, GitLab, Buildkite, VSTS) has its own independent build_number line and is untouched — GitHub was the lone provider whose build_number source diverged from its own build_url source. Introduced in 354ddffd (INTG-2082).

Verification

getCiInfo() run under env-faithful GitHub Actions variables:

State build_number matches build_url runs/<id>?
Before "23"
After "26976467840"

🤖 Generated with Claude Code

…DK-6279]

The GitHub Actions branch of getCiInfo() set build_number from
GITHUB_RUN_NUMBER (the per-workflow sequential counter) while build_url
is built from GITHUB_RUN_ID (the globally-unique run id in the
actions/runs/<id> URL). The two referenced different identifiers for the
same run, so Observability's dashboard "Rerun" could not re-dispatch the
workflow (GitHub returned 404 -> obs-api "Invalid Params!" -> HTTP 500).

Align build_number with the run id already used by build_url. GitHub
Actions only; all other CI providers are unchanged.

Co-Authored-By: Claude Opus 4.8 <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