Repository navigation
Add task-queue:retirement and task-queue:retire (server#519) - #172
Merged
Merged
Conversation
Native Server 3.14.0 inventories what still depends on a worker build or a task queue and retires it only when nothing does (durable-workflow/server#519, #1241). Expose it in the shipped Rust dw: - task-queue:retirement <task-queue> [--build-id=X | --unversioned]: one GET of /deployments/{namespace}/{queue}@{build}/retirement, or of /task-queues/{queue}/retirement for every cohort. Human output shows whether it is retirable and why not, the inventory status, revision and observation time, the count of every dependency, and each blocker with its details, recovery action and sample identities. A retirable result prints the matching retire command bound to its inventory revision. - task-queue:retire <task-queue> [--build-id=X | --unversioned] [--expected-revision=R]: one guarded POST to the matching /retire, never resent ({"expected_inventory_revision": R} or {}). Success reports retired_at/by and the inventory. A 409 refusal changed nothing: stderr shows the reason, the blockers with recovery and samples, and the Server's expected_resolution as the next step, and dw exits 2; --json keeps the error envelope with the full body in server_response. Both check cluster info (the existing preflight) for capabilities.worker_build_retirement and otherwise refuse with exit 8 before any request. Each path part is one encoded segment. A build id containing "@" or equal to "unversioned" would address another cohort, so it is refused as a usage error before any request. Like the other native-only commands they are Rust-only catalog additions. Docs: cli-reference, rust/README. Tests: 7 loopback-Server integration tests. Also run by hand against the published Server 3.28.0 image (SQLite): unknown queue, selected build, live run, stale revision and a successful bound retire. Co-Authored-By: Claude Opus 5.5 <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.



Part of durable-workflow/server#519. Native Server 3.14.0 and later serve a read-only retirement inventory and a guarded retire action for worker builds and task queues. These commands expose both in the shipped Rust
dw.Commands
dw task-queue:retirement <task-queue> [--build-id=X | --unversioned]sends one GET to/deployments/{namespace}/{queue}@{build}/retirement. With neither option it reads/task-queues/{queue}/retirement, which covers every cohort on the queue. The output shows:When the target is retirable, the output prints the matching
task-queue:retire ... --expected-revision=...command.dw task-queue:retire <task-queue> [--build-id=X | --unversioned] [--expected-revision=R]sends one guarded POST and never resends it.retired_at/retired_byand the inventory.expected_resolutionas the next step. The command exits 2.--json, a refusal returns the usual error envelope, with the full body inserver_response.Both commands require
capabilities.worker_build_retirement. Without it they exit 8 before sending any request. Each path part is sent as one encoded segment. A build id containing@, or equal tounversioned, would address a different cohort, sodwrejects it as a usage error before any request.Like the other native-only commands, these are Rust-only catalog additions (parity skips them). The PHP 2.x implementation is unchanged. The docs updates are in
docs/cli-reference.mdandrust/README.md.Testing
rust/tests/queues_workers.rscover paths, bodies, human and JSON output, the 409 refusal (exit 2, envelope), the missing capability (exit 8, no request), target usage errors and a lost response that is not resent.cargo fmt,cargo clippy -D warnings, the fullcargo testand the parity unit tests pass locally (Docker, rust:1.99).ghcr.io/durable-workflow/server:3.28.0image (SQLite). It covered:unknown_task_queue);selected_for_new_starts);live_dependencies, JSON);inventory_changed);--unversioned(unknown_deployment).A CLI release is needed before this ships.
🤖 Generated with Claude Code