-
Notifications
You must be signed in to change notification settings - Fork 357
Add workload_run_attempt
to analysis upload
#1658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add workload_run_attempt
to analysis upload
#1658
Conversation
Previously we had duplicated the logic to check `GITHUB_RUN_ID`. We now call the `getWorkflowRunID()` method for the status report upload method, and move the logic for the run attempt to `getWorkflowRunAttempt()`
Because we already throw an error if the ID or attempt aren't numbers, we don't have to allow `undefined` values into the payload.
src/workflow.ts
Outdated
); | ||
if (Number.isNaN(workflowRunAttempt)) { | ||
throw new Error( | ||
"GITHUB_RUN_ATTEMPT must define a non NaN workflow run attempt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe include the original value here so we can see what the error was.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, (minor) maybe make sure that the value is > 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. It wasn't clear to me if GITHUB_RUN_ID
could possibly be 0, so I only checked for negative values π€ GITHUB_RUN_ATTEMPT
clearly states that the value should begin at 1: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
* Update changelog and version after v2.3.0 * Update checked-in dependencies * Throw full error for CLI bundle download (#1657) * Add `workload_run_attempt` to analysis upload (#1658) * Refactor status report upload logic Previously we had duplicated the logic to check `GITHUB_RUN_ID`. We now call the `getWorkflowRunID()` method for the status report upload method, and move the logic for the run attempt to `getWorkflowRunAttempt()` * Add `workflow_run_attempt` to analysis payload * Stop allowing `undefined` run IDs and attempts Because we already throw an error if the ID or attempt aren't numbers, we don't have to allow `undefined` values into the payload. * Update changelog for v2.3.1 --------- Co-authored-by: github-actions[bot] <[email protected]> Co-authored-by: Chuan-kai Lin <[email protected]> Co-authored-by: Angela P Wen <[email protected]>
Previously we began sending the
workflow_run_attempt
field to our status reports. We also want to send it to the analysis upload API πThis PR does a bit of refactoring so that
workflow_run_id
andworkflow_run_attempt
are populated the same across the status report and analysis payloads.Merge / deployment checklist