Skip to content

Fix approved gated pipeline scheduling#6627

Merged
6543 merged 8 commits into
woodpecker-ci:mainfrom
AkashKumar7902:codex/fix-gated-pipeline-scheduling
May 26, 2026
Merged

Fix approved gated pipeline scheduling#6627
6543 merged 8 commits into
woodpecker-ci:mainfrom
AkashKumar7902:codex/fix-gated-pipeline-scheduling

Conversation

@AkashKumar7902

Copy link
Copy Markdown
Contributor

What changed

Approved gated pipelines now rebuild a fresh pending workflow tree and atomically replace the old blocked workflow rows before queueing tasks.

This keeps the existing guard in the normal workflow creation path, while giving approval its own replace path so loaded blocked workflows do not prevent scheduling.

Why

After the workflow-save guard was added, approval loaded the blocked workflow tree and then reused the normal creation helper. That helper refused to save generated workflows when pipeline.Workflows was already populated, so the approval path could leave a pipeline accepted/pending without anything queued.

Closes #6619

Validation

  • go test -race -tags test ./server/pipeline -count=1
  • go test -race -tags test ./e2e/scenarios -run TestApprovedGatedPipelineRuns -count=1 -v
  • GOROOT=$(go env GOROOT) GOTOOLCHAIN=local PATH="$(go env GOROOT)/bin:$PATH" go test -race -cover -coverpkg=./... -coverprofile e2e-coverage.out -timeout 60s -tags test ./e2e/... -count=1
  • make build-ui
  • GOROOT=$(go env GOROOT) GOTOOLCHAIN=local PATH="$(go env GOROOT)/bin:$PATH" make test-server

Note: the explicit Go toolchain env avoids a local /usr/local/go tool mismatch in this workstation.

@6543 6543 added the regression fix a bug that was not released yet label May 25, 2026
@woodpecker-bot

woodpecker-bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Account with some automation detected 🤖🧑‍💻

@AkashKumar7902

We noticed a mix of typical human activity and some patterns often associated with automation or AI agents.

Human? 65% likely to be a human.

Signal Points Detail
Automated branch/PR workflow +35 21/26 branch creations followed by PRs within 71s

Have thoughts about this account? Let the community know.

🕵🏽 Analyzed 200 public events via AgentScan

@6543 6543 enabled auto-merge (squash) May 26, 2026 11:59
@6543 6543 merged commit 32a7bf9 into woodpecker-ci:main May 26, 2026
7 checks passed
@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.07042% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.65%. Comparing base (8363eff) to head (8100356).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
server/pipeline/items.go 60.46% 11 Missing and 6 partials ⚠️
server/pipeline/approve.go 25.00% 6 Missing and 3 partials ⚠️
server/pipeline/restart.go 10.00% 8 Missing and 1 partial ⚠️
server/pipeline/create.go 33.33% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6627      +/-   ##
==========================================
+ Coverage   41.60%   41.65%   +0.05%     
==========================================
  Files         432      432              
  Lines       28805    28874      +69     
==========================================
+ Hits        11983    12028      +45     
- Misses      15747    15759      +12     
- Partials     1075     1087      +12     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

regression fix a bug that was not released yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gated pipeline is not scheduled if accepted

3 participants