Skip to content

Refactor pipeline runtime code#6166

Merged
lafriks merged 52 commits into
woodpecker-ci:mainfrom
6543-forks:refactor-pipeline
Mar 30, 2026
Merged

Refactor pipeline runtime code#6166
lafriks merged 52 commits into
woodpecker-ci:mainfrom
6543-forks:refactor-pipeline

Conversation

@6543
Copy link
Copy Markdown
Member

@6543 6543 commented Feb 27, 2026

next step in making code more structured and maintainable

  • split pipeline exec into small functions
  • fix edge-cases
  • have less hidden code-flows
  • fix possible race condition
image

Test Coverage Update: pipeline/runtime

Overall: 80.5% → 98.3% (+17.8pp)

Function main refactor Δ
GetShutdownCtx 0.0% 100.0% +100.0
WithDescription 0.0% 100.0% +100.0
makeLogger 75.0% 100.0% +25.0
Run 74.2% 100.0% +25.8
traceStep 84.6% 100.0% +15.4
completeStep 100.0% ✱ new
executeStep 100.0% ✱ new
logStages 100.0% ✱ new
runBlockingStep 100.0% ✱ new
runDetachedStep 85.7% ✱ new
runStage 100.0% ✱ new
shouldSkipStep 100.0% ✱ new
startStep 100.0% ✱ new
traceWorkflowSetupError 100.0% ✱ new
validateConfig 85.7% ✱ new

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 96.26556% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 34.12%. Comparing base (4b4ef5e) to head (3739bcd).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
pipeline/runtime/step.go 96.12% 4 Missing and 2 partials ⚠️
pipeline/runtime/workflow.go 96.51% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6166      +/-   ##
==========================================
+ Coverage   33.84%   34.12%   +0.27%     
==========================================
  Files         422      423       +1     
  Lines       28427    28460      +33     
==========================================
+ Hits         9622     9712      +90     
+ Misses      17910    17862      -48     
+ Partials      895      886       -9     

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

Comment thread pipeline/runtime/step.go Outdated
Comment thread pipeline/runtime/step.go Outdated
Comment thread pipeline/runtime/workflow.go
@6543 6543 marked this pull request as ready for review March 19, 2026 15:47
@6543 6543 removed the wip label Mar 19, 2026
@6543 6543 changed the title WIP: refactor pipeline runtime code Refactor pipeline runtime code Mar 19, 2026
Comment thread agent/tracer.go Outdated
@6543 6543 added the enhancement improve existing features label Mar 19, 2026
@qwerty287
Copy link
Copy Markdown
Contributor

not sure if we wana save the flowchart somewhere? woodpecker_workflow_run_flowchart.svg

Doesn't hurt I think, maybe here? https://woodpecker-ci.org/docs/development/architecture#agent

@6543
Copy link
Copy Markdown
Member Author

6543 commented Mar 24, 2026

@qwerty287 done

@6543
Copy link
Copy Markdown
Member Author

6543 commented Mar 24, 2026

@anbraten all reviews addressed

@6543 6543 mentioned this pull request Mar 24, 2026
Comment thread pipeline/runtime/step.go Outdated
@6543 6543 requested a review from lafriks March 29, 2026 17:12
Comment thread pipeline/runtime/workflow.go Outdated
@lafriks lafriks merged commit fde1d91 into woodpecker-ci:main Mar 30, 2026
9 checks passed
@6543 6543 deleted the refactor-pipeline branch March 30, 2026 08:25
This was referenced Mar 30, 2026
@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

engine change how the pipeline engine works refactor delete or replace old code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants