Add worker group filters - #139
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 27524d7. Configure here.
| None | ||
| } else { | ||
| self.jobs.get(canonical_name) | ||
| } |
There was a problem hiding this comment.
Filtered workers still lose jobs
High Severity
Group filters mark workers disabled, and factories_for then treats those job names as unregistered. The runtime still polls every registered queue, and coordinators permanently kill jobs they cannot build. A process that registers a shared registry and calls only_groups will destroy jobs meant for other processes.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 27524d7. Configure here.
| return Err(OxanaError::ConfigError( | ||
| "no workers are enabled for this runtime".to_string(), | ||
| )); | ||
| } |
There was a problem hiding this comment.
Drain ignores group filters
Medium Severity
only_groups and exclude_groups accumulate on the builder, but drain never applies them. Draining therefore processes every registered worker, including ones the same runtime would disable in run.
Reviewed by Cursor Bugbot for commit 27524d7. Configure here.
|
meh, i actually dont like it |


Summary
WorkerGroupunit-struct derives and repeatable worker group annotationsTesting
cargo fmt --all -- --checkcargo clippy --all-features --workspace(passes with the existing removed-lint warning forclippy::from_iter_instead_of_collect)Note
Medium Risk
Changes which workers a process registers and runs at startup; misconfigured filters can leave jobs unprocessed or fail startup, though the empty-worker guard limits silent no-op runtimes.
Overview
Adds typed worker groups so different Oxana processes can run subsets of the same component registry. Groups are unit structs via
#[derive(oxana::WorkerGroup)]; workers declare membership with repeatable#[oxana(group = MyGroup)], and theWorkerderive emitsgroups()from those attributes.Runtime filtering is configured on
RuntimeBuilderwith accumulatingonly_groupsandexclude_groups(single groups or tuples). Filters are applied atrun():only_groupskeeps workers in at least one listed group and drops ungrouped workers;exclude_groupsdrops workers in any listed group and leaves ungrouped workers on. Combined filters apply both rules. Disabled workers are hidden from the registry (including legacy aliases, cron schedules, and on-demand entries), and startup fails with a config error if nothing remains enabled.Docs, macro compile-fail validation (non–unit struct groups), and unit/macro tests cover the semantics.
Reviewed by Cursor Bugbot for commit 27524d7. Bugbot is set up for automated code reviews on this repo. Configure here.