Refactor use store in server scheduler#6754
Draft
6543 wants to merge 14 commits into
Draft
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
Member
Author
|
I want the scheduler to be a pure state maschine that gets signals from extern e.g. api / agent-rpc and forwards them to forge / agent-rpc ... this is by no means the full refactor, it's a way in the right direction but i need more time to refine it. as for server-instance-cluster-wide locking stuff, a good candidate is atomic DB swaps etc.. and for signal distribution the pubsub/queue stuff ... it needs more thinkig ... |
The merge of the agent-rpc hardening (woodpecker-ci#6759) into the server-scheduler refactor dropped the lockAgentToWorkflow call site. The scheduler now hands out a workflow but never records the owning agent, so workflow.AgentID stays 0 and the ownership guard in sanitize.go rejects every follow-up agent RPC ("agent is not allowed to interact with workflow ... not already locked"). This left lockAgentToWorkflow unused (lint failure) and broke the e2e suite (pipelines stuck pending -> timeout). Re-lock the polled workflow to the agent after Poll returns, restoring the hardening under the new scheduler architecture. Refs woodpecker-ci#6759
server/status was extracted as its own package and badge.go imports it as pipelineStatus. importas runs with no-extra-aliases, so the alias must be declared in config or lint fails. Register it to match the existing usage.
Every importas alias in the project is snake_case; pipelineStatus was the sole camelCase outlier. Rename the alias to pipeline_status in the lint config and its only consumer (server/api/badge.go) to match convention.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6754 +/- ##
==========================================
- Coverage 46.95% 46.94% -0.02%
==========================================
Files 438 438
Lines 29431 29476 +45
==========================================
+ Hits 13820 13838 +18
- Misses 14448 14471 +23
- Partials 1163 1167 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
before queue had store inserted, now scheduler has it, so we can make more persistent things with it.
this does:
followup of #6753
step of #6317