Skip to content

fix(runs): report cancelled runs to GitHub correctly and stop the shell process - #149

Open
KrisPowers wants to merge 5 commits into
mainfrom
fix/workflow-status-and-avatar
Open

fix(runs): report cancelled runs to GitHub correctly and stop the shell process#149
KrisPowers wants to merge 5 commits into
mainfrom
fix/workflow-status-and-avatar

Conversation

@KrisPowers

Copy link
Copy Markdown
Owner

Summary

  • Cancelling a run never actually stopped the shell subprocess driving it, so it kept running against sandboxes/containers that cancellation had already torn down, and its eventual exit reported a cancelled run to GitHub as a plain "failure" commit status.
  • cancel() now kills the local shell's whole process tree before tearing down its containers/shards.
  • The commit status API has no native cancelled state, so cancelled runs are now reported as error (with a "Workflow run was cancelled" description) instead of failure, both from the immediate cancel path and from report_run_outcome's three-way status match.

Test plan

  • cargo test -p atk-github status:: passes, including a new test asserting mark_cancelled posts error state.
  • cargo check -p atk-github -p actions-toolkit-backend is clean.
  • Manually cancel a running local workflow and confirm the commit status on GitHub updates to a distinct "error/cancelled" state instead of staying pending or showing failure.

The commit status API has no native cancelled state, only
error/failure/pending/success. Mapping cancelled runs to error keeps
them distinguishable from an actual failure on GitHub's side.
report_run_outcome collapsed every non-succeeded status to a failure
commit status, so a cancelled run showed up on GitHub looking like it
had actually failed instead of being cancelled.
Cancelling a run tore down its Docker containers and bucket shards
but never touched the shell subprocess actually driving the job DAG,
so it kept running against sandboxes that had already been pulled out
from under it. Its supervisor only reports the run's outcome back to
GitHub once that process exits, so a cancelled run's commit status
could stay stuck on pending indefinitely instead of ever updating.
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