Skip to content

fix: cancel outdated queued pipelines, not only running - #15

Merged
gytsto merged 1 commit into
mainfrom
cancel-pending-pipelines
Jul 2, 2026
Merged

fix: cancel outdated queued pipelines, not only running#15
gytsto merged 1 commit into
mainfrom
cancel-pending-pipelines

Conversation

@gytsto

@gytsto gytsto commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Problem

cancel-outdated-pipelines fetches only status=running pipelines. Under runner congestion, superseded pipelines sit in the queue as pending/created and never get cancelled — cancellation is dead exactly when it matters. Each new push then stacks another full pipeline behind the stale ones.

Solution

Fetch created, waiting_for_resource, pending and running pipelines (one request per status — the pipelines API takes a single status value) before the same GITHUB_REF filtering and cancellation as today.

Only running pipelines were fetched for cancellation, so during runner
congestion outdated pipelines sat in the queue as pending/created and
were never cancelled - exactly when cancellation matters most.
@asledzinskiy

Copy link
Copy Markdown
Contributor

+1

@olekoliinyk

Copy link
Copy Markdown
Contributor

+1.0

@gytsto
gytsto merged commit 1e47022 into main Jul 2, 2026
1 check passed
@gytsto
gytsto deleted the cancel-pending-pipelines branch July 2, 2026 10:58
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.

3 participants