Skip to content

local backend: fix steps having logs form other steps#5582

Merged
6543 merged 36 commits into
woodpecker-ci:mainfrom
6543-forks:enhance-local-backend
Oct 1, 2025
Merged

local backend: fix steps having logs form other steps#5582
6543 merged 36 commits into
woodpecker-ci:mainfrom
6543-forks:enhance-local-backend

Conversation

@6543

@6543 6543 commented Sep 30, 2025

Copy link
Copy Markdown
Member

problem

if steps where started concurrent, the stdout pipeline reader war overwritten and you randomly got the wrong command stream
from a step.

change

where we have possible race conditions, we now use thread save types
e.g. store the command struct and the output reader in sync.Map

also a lot of tests where added

coverage

before: 14.9%
now: 59.2%

go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/clone.go:34:		checkGitCloneCap				0.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/clone.go:40:		loadClone					75.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/clone.go:50:		setupClone					0.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/clone.go:65:		execClone					0.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/clone.go:121:		writeNetRC					0.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/clone.go:140:		downloadLatestGitPluginBinary	0.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/command.go:35:	execCommands				75.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/command.go:75:	checkShellExistence			100.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/command.go:80:	genCmdByShell				91.4%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/command.go:143:	probeShellIsPosix				100.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/const.go:38:		genNetRC					100.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/errors.go:39:		Error						100.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/errors.go:44:		Unwrap						0.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/errors.go:49:		Is							100.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:56:		New						100.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:63:		Name						0.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:67:		IsAvailable					60.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:77:		Flags						0.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:81:		Load						100.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:94:		SetupWorkflow				72.7%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:121:		StartStep						87.5%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:155:		WaitStep						83.3%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:183:		TailStep						66.7%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:193:		DestroyStep					90.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:211:		DestroyWorkflow				88.2%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:241:		getWorkflowState				85.7%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/local.go:255:		getStepState					80.0%
go.woodpecker-ci.org/woodpecker/v3/pipeline/backend/local/plugin.go:26:		execPlugin					83.3%

@6543 6543 added bug Something isn't working backend/local labels Sep 30, 2025
@6543 6543 changed the title local backend: fix steps having logs form other steps [BLOCKED] local backend: fix steps having logs form other steps Sep 30, 2025
@qwerty287 qwerty287 marked this pull request as draft October 1, 2025 06:21
@6543 6543 changed the title [BLOCKED] local backend: fix steps having logs form other steps local backend: fix steps having logs form other steps Oct 1, 2025
@6543 6543 marked this pull request as ready for review October 1, 2025 10:40
@6543 6543 requested a review from a team October 1, 2025 10:43

@qwerty287 qwerty287 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems fine, but not tested from my side.

@6543 6543 enabled auto-merge (squash) October 1, 2025 14:50
@6543 6543 merged commit 44c8921 into woodpecker-ci:main Oct 1, 2025
7 checks passed
@codecov

codecov Bot commented Oct 1, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.33058% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.18%. Comparing base (e11f110) to head (b7c05ae).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pipeline/backend/local/local.go 66.66% 12 Missing and 7 partials ⚠️
pipeline/backend/local/command.go 57.57% 10 Missing and 4 partials ⚠️
pipeline/backend/local/clone.go 0.00% 9 Missing ⚠️
pipeline/backend/local/plugin.go 72.72% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5582      +/-   ##
==========================================
+ Coverage   19.79%   20.18%   +0.39%     
==========================================
  Files         419      421       +2     
  Lines       39796    39874      +78     
==========================================
+ Hits         7878     8049     +171     
+ Misses      31210    31095     -115     
- Partials      708      730      +22     

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

@6543 6543 deleted the enhance-local-backend branch October 1, 2025 14:59
This was referenced Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend/local bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants