Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign workflows to agents with the best label matches #4201

Merged
merged 14 commits into from
Oct 8, 2024

Conversation

6543
Copy link
Member

@6543 6543 commented Oct 6, 2024

This make sure if there are org and global agents, that workflows get fetched by the org agent they are in first and only if not available will the global one fetch it.

This also let you control agent priority etc ...

before the selection of an agent was kinda at random ...

@6543 6543 added server enhancement improve existing features labels Oct 6, 2024
@6543
Copy link
Member Author

6543 commented Oct 6, 2024

or is it a feature?

@6543 6543 mentioned this pull request Oct 6, 2024
4 tasks
@qwerty287 qwerty287 changed the title Assign workflows to agents witch match the most by labels Assign workflows to agents that match the most by labels Oct 6, 2024
Copy link

codecov bot commented Oct 6, 2024

Codecov Report

Attention: Patch coverage is 78.66667% with 16 lines in your changes missing coverage. Please review.

Project coverage is 26.48%. Comparing base (2543105) to head (6dc68e6).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
server/queue/fifo.go 75.00% 14 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4201      +/-   ##
==========================================
+ Coverage   26.46%   26.48%   +0.02%     
==========================================
  Files         376      376              
  Lines       27455    27465      +10     
==========================================
+ Hits         7265     7275      +10     
  Misses      19525    19525              
  Partials      665      665              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@6543
Copy link
Member Author

6543 commented Oct 6, 2024

https://app.codecov.io/gh/woodpecker-ci/woodpecker/pull/4201/blob/server/grpc/filter.go

100% test coverage :D

@6543 6543 requested a review from anbraten October 7, 2024 09:47
@anbraten anbraten changed the title Assign workflows to agents that match the most by labels Assign workflows to agents with the best label matches Oct 7, 2024
server/grpc/filter.go Outdated Show resolved Hide resolved
server/grpc/filter_test.go Outdated Show resolved Hide resolved
server/grpc/filter_test.go Outdated Show resolved Hide resolved
server/grpc/filter_test.go Outdated Show resolved Hide resolved
server/grpc/filter_test.go Outdated Show resolved Hide resolved
server/grpc/filter_test.go Outdated Show resolved Hide resolved
server/queue/fifo.go Outdated Show resolved Hide resolved
server/queue/fifo_test.go Outdated Show resolved Hide resolved
server/queue/fifo_test.go Outdated Show resolved Hide resolved
@6543 6543 requested a review from anbraten October 8, 2024 18:41
@6543 6543 merged commit ddd55ee into woodpecker-ci:main Oct 8, 2024
9 checks passed
@6543 6543 deleted the priorized-queue branch October 8, 2024 21:07
@woodpecker-bot
Copy link
Collaborator

@woodpecker-bot woodpecker-bot mentioned this pull request Oct 8, 2024
1 task
@woodpecker-bot woodpecker-bot mentioned this pull request Dec 14, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve existing features server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants