feat: Uniform collection responses and label-based worker routing#140
Merged
feat: Uniform collection responses and label-based worker routing#140
Conversation
All API endpoints now return a consistent collection shape:
{"results": [{"hostname": "...", ...fields...}]}. Single-host
responses wrap 1 item; broadcast (_all) returns N items. This
eliminates the inconsistency between single-host and broadcast
response formats and ensures every response includes worker
hostname attribution.
- Update OpenAPI specs with collection wrapper schemas
- Thread worker hostname through job client return values
- Fix WriteJobResponse to serialize hostname in response body
- Update all handlers to return collection types
- Update CLI to parse collections with HOSTNAME column
- Update CLI docs with accurate output examples
- Add backlog tasks for 100% coverage and label-based routing
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add label-based targeting so admins can route jobs to groups of servers using hierarchical dot-separated labels (e.g., --target group:web.dev). Workers subscribe to every prefix level of their label values via pure NATS subject routing — no application-layer filtering needed. Key changes: - Add Labels field to worker config and WorkerInfo discovery response - Add ParseTarget, BuildSubjectFromTarget, IsBroadcastTarget, ValidateLabel, and BuildLabelSubjects to subject routing layer - Update all 5 API handlers to route label targets to broadcast path - Update CLI flag descriptions, OpenAPI specs, and CLI usage docs - Refactor publishAndCollect to share timeout return path and make BroadcastQuietPeriod configurable - Achieve 100% test coverage on job, job/client, job/worker, api/system, and api/network packages - Replace ASCII box diagrams in architecture docs with clean markdown 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Thank you for contributing to this project! 😊🕹️ |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #140 +/- ##
===========================================
+ Coverage 99.79% 100.00% +0.20%
===========================================
Files 99 99
Lines 2384 2540 +156
===========================================
+ Hits 2379 2540 +161
+ Misses 4 0 -4
+ Partials 1 0 -1
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
retr0h
added a commit
that referenced
this pull request
Feb 18, 2026
100% test coverage achieved across all hand-written packages in #140. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
retr0h
added a commit
that referenced
this pull request
Feb 18, 2026
100% test coverage achieved across all hand-written packages in #140. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
ensuring every response includes worker hostname attribution
to every prefix level of their dot-separated label values via pure NATS subject routing