The queue's API: dispatch at the top, last or after a queued run, move, and read the queues #197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/3760-s2-the-queue-s-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracker: #3760
Step 2 of #3672's planspec: agents and the web order, read and size a flow queue through the API.
What it delivers
POST /api/tasks/:id/flow-runstakesat: "top" | "last"(defaultlast) orafter: <flow run id>, and answers 201 with the flow run,queuedor in whatever state its begin reached. Theenqueuedevent recordsatorafterand the position.POST /api/flow-runs/:id/movetakes{at}or{after}, places the queued run again, recordsmovedwith its position and answers the flow run.POST /api/flow-runs/:id/stopstops a queued run, taking it out of its queue (from step 1, documented with the queue).GET /api/queuesanswers every queue with a queued run or a holder;GET /api/projects/:id/queuesanswers the project's base-branch queue, then each other base of it with a queued run, a holder or set slots. A queue is{project_id, base, slots, going, queued, done_today}:goingits holders in the order they began,queuedits queued runs in order,done_todaythe runs it began that ended, done or stopped, since the start of the UTC day. A run begun outside the slots is in no queue's lists.PUT /api/projects/:id/queuesanswers the same queue shape.from_queueandstarted_at; a queued one answersqueue: {position, of, next, waits_on: [{task_id, project_id, title, kind}]},nexttrue on the run its queue begins when a slot frees; a holder answersbehind, the runs queued in its queue.not_queuedandother_queue.atandaftertogetherinvalidafternames no flow runafternames a run of another queueother_queueafternames the run itselfinvalidaftera run that is not queuednot_queuedTests
tests/flow_queue.sx pins each acceptance case over HTTP: a dispatch
at: "top"goes first and oneaftera queued run goes right behind it; moves to the top, behind a later run and to the last reorder the queue; the queue reads answergoing,queuedanddone_today(a run that ended before the start of the UTC day drops out, and a run begun outside the slots is in no list); a FlowRun answers itsqueuewithnextandwaits_on(followsandblocked_by) orbehind; and one case per refusal in the table.Fail-before: the same tests/flow_queue.sx built against master's
srcprints 29FAILlines (every new check) and endsFLOW QUEUE FAIL (29 checks); at this head it endsFLOW QUEUE OK.No web change: the step adds and changes no
web/e2egolden.Gates
sak-gate full, gate run 2 atbc2b2810: passed (72 sx tests, step9_release, deploy contract, 777 e2e passed with 1 skipped, 10 runner e2e).The queue's API: dispatch at the top, last or after a queued run, move, stop and read the queuesto The queue's API: dispatch at the top, last or after a queued run, move, and read the queues