A review reaction that landed while a remediate run owned the task failed the pr_open guard, was acked and dropped, and the poll cursor advanced past it. Runs against one task are serialised, so the unit is appended to tasks.pending_reviews instead; the transition that returns the task to pr_open promotes the oldest waiting review back to queued. A re-delivered unit is absorbed by payload equality, never queued twice.
16 lines
666 B
SQL
16 lines
666 B
SQL
-- tasks.pending_reviews holds the review units that arrive while a
|
|
-- remediation already owns the task. Remediation runs for one task are
|
|
-- serialised (docs/prds/pr-review-remediation.md decision 5), so a distinct
|
|
-- review is appended here instead of dropped, and the oldest is promoted into
|
|
-- review_payload when the run that owned the task returns it to pr_open.
|
|
-- review_payload stays the active unit and is written by the run's own
|
|
-- Update; only this column carries the ones waiting behind it.
|
|
|
|
-- +goose Up
|
|
|
|
ALTER TABLE tasks ADD COLUMN pending_reviews jsonb NOT NULL DEFAULT '[]'::jsonb;
|
|
|
|
-- +goose Down
|
|
|
|
ALTER TABLE tasks DROP COLUMN pending_reviews;
|