Skip to content

Refactor server/pubsub into interface#6318

Merged
6543 merged 20 commits into
woodpecker-ci:mainfrom
6543-forks:server/move-pubsub-into-interface
Mar 30, 2026
Merged

Refactor server/pubsub into interface#6318
6543 merged 20 commits into
woodpecker-ci:mainfrom
6543-forks:server/move-pubsub-into-interface

Conversation

@6543

@6543 6543 commented Mar 24, 2026

Copy link
Copy Markdown
Member

refactor our pubsub into an interface and now publish and listen to topics instead of label filtering.

we also now have the key const and key genaration of repo topics in the pubsub package.

also we switch from repo name to repo id for pubsub topic -> this fixes an multi-forge bug :)

part of #6317

@6543 6543 added server refactor delete or replace old code labels Mar 24, 2026
@woodpecker-bot

woodpecker-bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Surge PR preview deployment was removed

@codecov

codecov Bot commented Mar 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 39.53488% with 52 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.36%. Comparing base (7a29f49) to head (66f5648).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
server/rpc/rpc.go 0.00% 16 Missing ⚠️
server/pipeline/topic.go 0.00% 12 Missing ⚠️
server/api/stream.go 0.00% 8 Missing ⚠️
server/pipeline/cancel.go 0.00% 3 Missing ⚠️
server/pipeline/decline.go 0.00% 3 Missing ⚠️
server/pipeline/start.go 0.00% 3 Missing ⚠️
server/pubsub/memory/pub.go 91.89% 2 Missing and 1 partial ⚠️
server/pubsub/pubsub.go 0.00% 2 Missing ⚠️
cmd/server/setup.go 0.00% 1 Missing ⚠️
server/rpc/server.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6318      +/-   ##
==========================================
+ Coverage   33.30%   33.36%   +0.06%     
==========================================
  Files         420      421       +1     
  Lines       28347    28342       -5     
==========================================
+ Hits         9440     9456      +16     
+ Misses      18029    18007      -22     
- Partials      878      879       +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.

Comment thread server/pubsub/pubsub.go Outdated
Comment thread server/pubsub/memory/pub.go Outdated
Comment thread server/pipeline/topic.go
6543 and others added 4 commits March 24, 2026 19:39
@6543 6543 requested a review from anbraten March 24, 2026 19:17
Comment thread server/pubsub/memory/pub.go
Comment thread cmd/server/setup.go Outdated
@6543

6543 commented Mar 25, 2026

Copy link
Copy Markdown
Member Author
go.woodpecker-ci.org/woodpecker/v3/server/pubsub/memory/pub.go:35:	New		100.0%
go.woodpecker-ci.org/woodpecker/v3/server/pubsub/memory/pub.go:41:	Publish		84.6%
go.woodpecker-ci.org/woodpecker/v3/server/pubsub/memory/pub.go:67:	Subscribe	100.0%
go.woodpecker-ci.org/woodpecker/v3/server/pubsub/pubsub.go:52:		GetRepoTopic	0.0%
total:									(statements)	89.7%

this is the coverage of just running new added TestPubSub !

@anbraten it also explizite covers the duplication test and is written in a way to just pass in new adapters asap we have them

@6543 6543 requested a review from qwerty287 March 28, 2026 16:40
Comment thread server/pubsub/memory/pub.go Outdated
6543 and others added 2 commits March 30, 2026 15:28
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Comment thread server/pubsub/memory/pub.go Outdated
Comment thread server/pubsub/memory/pub.go Outdated

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

also untested

@6543

6543 commented Mar 30, 2026

Copy link
Copy Markdown
Member Author

sorry last commit did belong to other pull and was reverted right away 😅

@6543 6543 merged commit 6625756 into woodpecker-ci:main Mar 30, 2026
6 of 7 checks passed
@6543 6543 deleted the server/move-pubsub-into-interface branch March 30, 2026 17:32
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

refactor delete or replace old code server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants