feat: make the work commands clients of the work list API - #228
Merged
Merged
Conversation
Replaces the file-based work command requirements with the work list API client requirements now that the implementation has landed.
work list joined its columns with raw tabs, so an id longer than one terminal tab stop (8 columns) threw every column after it out of line. Compute each column's width from the list and pad with spaces instead.
The work list API now serves clients over the network (the CLI, CI actions), so a refusal or a fault needs to show up in the orchestrator's own log, not just in the caller's reply. Every call is logged with its method, path, status and duration once answered, graded by status: a refusal is a warning, a fault an error, an ordinary answer debug.
Aligned columns without a heading still left the reader to already know the column order. The table opens with a heading row naming each column, dimmed the way the state colour draws only on a terminal.
"work list api call" read as if it named the work list subcommand rather than a call to the API — renamed to "api call". Also drop the add handler's own "item added" line: WorkList.Add already logs it, so every accepted add was logged twice.
…ent has stopped Abort detached the item's inflight entry and record before its agent had actually exited, so a pass landing in that window saw the item as free backlog and launched a second agent into the same directory while the first was still shutting down. The first agent then had nothing tracking it: not in inflight, so nothing waited for it, killed it, or folded its outcome into the record. Abort now holds the id out of admission until the agent it is stopping has actually ended.
…fleet-orchestrator specs Adds the heading row / column alignment scenario to work-commands' listing requirement, and the call-logging paragraph and scenario to fleet-orchestrator's work list API requirement, matching what the change actually implemented.
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.
Make
spinloop worka client of the orchestrator's work list API, so an orchestrator running on another machine is reachable from the shell and from clients such as a GitHub action.Summary
spinloop work add,list,abortandremoveno longer work the items file and the state beside it directly; they call the work list API the orchestrator serves.--url, the API's base address, and presents the API's token as a bearer —--api-token, else--api-token-file, elseSPINLOOP_API_TOKEN, resolved through the samedaemonTokenhelper the daemon uses; two token flags at once is a refusal. The--itemsflag is removed: the file the API works belongs to the run.cmd/spinloopcoverage holds at 92.1%.docs/commands/work.mdrewritten for the API; the cross-references indocs/work-items.md,docs/commands/orchestrator.mdanddocs/README.mdnow describe the commands as the API's client.Implementation details
work-commands-apirides in this branch: its delta removes the file-working requirements of thework-commandsspec and adds the work list client requirements; the change is archived after the merge.internal/orchestratoris unchanged: it still serves the API and works the file. Only the CLI that calls it changes.--items <file>becomes--url <the address the run prints>plus the API's token, where the run serves one.