Skip to content

feat: Support graceful job step cancellation#2714

Merged
mergify[bot] merged 5 commits intomasterfrom
christopherhx/graceful-job-cancellation
Mar 29, 2025
Merged

feat: Support graceful job step cancellation#2714
mergify[bot] merged 5 commits intomasterfrom
christopherhx/graceful-job-cancellation

Conversation

@ChristopherHX
Copy link
Contributor

@ChristopherHX ChristopherHX commented Mar 26, 2025

  • for gh-act-runner
  • act-cli support as well
  • respecting always() and cancelled() of steps

You can try this out by running

name: Sleep Workflow

on: [push]

jobs:
  sleep_job:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Sleep for 30 seconds
        run: sleep 30
        if: always()

and pressing ctrl+c once.

If you use sigterm or ctrl+c a second time

maybe needs a deeper look at cancelling jobs, pre&post steps, pulling containers

* for gh-act-runner
* act-cli support as well
* respecting always() and cancelled() of steps
@github-actions
Copy link
Contributor

github-actions bot commented Mar 26, 2025

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 8 0 0.03s
✅ REPOSITORY gitleaks yes no 2.69s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY grype yes no 10.36s
✅ REPOSITORY secretlint yes no 1.27s
✅ REPOSITORY trivy-sbom yes no 0.39s
✅ REPOSITORY trufflehog yes no 3.89s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov
Copy link

codecov bot commented Mar 26, 2025

Codecov Report

Attention: Patch coverage is 69.14894% with 29 lines in your changes missing coverage. Please review.

Project coverage is 74.66%. Comparing base (5a80a04) to head (2d9e0e1).
Report is 194 commits behind head on master.

Files with missing lines Patch % Lines
pkg/runner/step.go 45.45% 11 Missing and 1 partial ⚠️
pkg/common/job_error.go 57.14% 8 Missing and 1 partial ⚠️
cmd/root.go 50.00% 4 Missing ⚠️
pkg/runner/run_context.go 72.72% 1 Missing and 2 partials ⚠️
pkg/common/context.go 96.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2714       +/-   ##
===========================================
+ Coverage   61.56%   74.66%   +13.10%     
===========================================
  Files          53       73       +20     
  Lines        9002    11139     +2137     
===========================================
+ Hits         5542     8317     +2775     
+ Misses       3020     2186      -834     
- Partials      440      636      +196     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ChristopherHX ChristopherHX marked this pull request as draft March 26, 2025 19:16
@ChristopherHX
Copy link
Contributor Author

ChristopherHX commented Mar 26, 2025

Moved to draft to investigate cancelling

  • jobs (with cancelled() or always())
  • pulling containers
  • watch

EDIT Done and merged in my custom version of act, this PR is for slowing down the drift between the codebases.

@ChristopherHX ChristopherHX marked this pull request as ready for review March 29, 2025 16:03
@mergify mergify bot merged commit bea04dd into master Mar 29, 2025
12 checks passed
@mergify mergify bot deleted the christopherhx/graceful-job-cancellation branch March 29, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants