Skip to content

Fix status merging with skipped pipelines#6176

Merged
qwerty287 merged 14 commits into
woodpecker-ci:mainfrom
qwerty287:status-mrg-cancel
Mar 2, 2026
Merged

Fix status merging with skipped pipelines#6176
qwerty287 merged 14 commits into
woodpecker-ci:mainfrom
qwerty287:status-mrg-cancel

Conversation

@qwerty287

@qwerty287 qwerty287 commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Split the skipped status into skipped (skipped due to condition) and canceled (skipped due to cancellation but hasn't started).

Still needs testing.

@qwerty287 qwerty287 added the bug Something isn't working label Mar 1, 2026
@qwerty287 qwerty287 mentioned this pull request Mar 1, 2026
16 tasks
@qwerty287 qwerty287 marked this pull request as ready for review March 2, 2026 10:43
@qwerty287

Copy link
Copy Markdown
Contributor Author

Seems working:
successful:
grafik

canceled (with step skipped, but workflow and pipeline is correctly marked as canceled):
grafik

@qwerty287 qwerty287 requested a review from a team March 2, 2026 10:44
@xoxys

xoxys commented Mar 2, 2026

Copy link
Copy Markdown
Member

Needs frontend fix to get the failed icon in red again? Or is it intended to be gray in this case?

@qwerty287

qwerty287 commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

It is canceled, then it should be gray.

Before #6011 the canceled pipelines always had a failed state and thus were red, but this was the actual bug.

@6543 6543 mentioned this pull request Mar 2, 2026
@xoxys

xoxys commented Mar 2, 2026

Copy link
Copy Markdown
Member

OK then the handling is IMO still wrong. If a workflow fails and cancels other dependent workflows the entire pipeline should marked as failed, no?

@xoxys xoxys left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have questions 🙈

@qwerty287 qwerty287 force-pushed the status-mrg-cancel branch from 066edbb to bee7bfe Compare March 2, 2026 14:08
@qwerty287

qwerty287 commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

Not sure if I understand you correctly: If one workflow fails, all the other ones that haven't been started will get status skipped (in workflow_status.go, line 51). Then the final pipeline should be failed. The ones that already run will finish running, and the final status will get failed as well.

If you mean something different, it's also possible that I did a mistake. This full status system and how finishing workflows is handled is really complex and ununderstandable. Might need a big refactoring.

@xoxys

xoxys commented Mar 2, 2026

Copy link
Copy Markdown
Member

My initial issue I posted is that exactly this case you decribed: One workflow failed, some other workflows were cancelled due to the failed one -> the entire pipeline should marked as failed. However this does not work anymore but was working before

grafik

In the secreenshot you can see that security-scan failed and docs was cancelled due to this failure but the entire pipeline is now marked as skipped and should still be marked as failed.

grafik

The second screenshot shows the exact same pipeline a few weeks earlier (with an older wp version) where it is working correctly.

At least that what I tried to describe in chat and #6164 (comment)

@qwerty287

Copy link
Copy Markdown
Contributor Author

Yes, but isn't this what I fixed here?

Working as well for me (on-fail shouldn't run on fails… this was my first test with runs_on, thus the name):
grafik

@codecov

codecov Bot commented Mar 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.95%. Comparing base (05f55fb) to head (db44760).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
server/pipeline/cancel.go 0.00% 10 Missing ⚠️
server/pipeline/status.go 70.00% 2 Missing and 1 partial ⚠️
server/model/const.go 0.00% 1 Missing ⚠️
server/rpc/rpc.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6176      +/-   ##
==========================================
- Coverage   31.98%   31.95%   -0.04%     
==========================================
  Files         423      423              
  Lines       28568    28563       -5     
==========================================
- Hits         9138     9126      -12     
- Misses      18587    18595       +8     
+ Partials      843      842       -1     

☔ 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.

@xoxys

xoxys commented Mar 2, 2026

Copy link
Copy Markdown
Member

Ok nice. Then I just got confused by your screenshots :D

@xoxys xoxys left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for re-checking!

@qwerty287

qwerty287 commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, I actually haven't tested that before.

I thought your point was about runs_on: [failure]… But the fix is the same for both

@qwerty287 qwerty287 merged commit 480f673 into woodpecker-ci:main Mar 2, 2026
10 checks passed
@qwerty287 qwerty287 deleted the status-mrg-cancel branch March 2, 2026 14:35
@woodpecker-bot woodpecker-bot mentioned this pull request Mar 2, 2026
1 task
@woodpecker-bot woodpecker-bot mentioned this pull request Apr 1, 2026
1 task
@woodpecker-bot woodpecker-bot mentioned this pull request Apr 15, 2026
1 task
@woodpecker-bot woodpecker-bot mentioned this pull request Apr 27, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants