feat(reviewer): start in-app Shipwright queue#82
Conversation
|
|
||
| event :return_for_changes do | ||
| transitions from: :under_review, to: :submitted | ||
| end |
Returns land in :needs_changes not :submitted so the user can tell what's going on and the queue doesn't immediately re-fill with the same row. submit_for_review accepts :needs_changes as a from: state and creates the pending ShipReview row so the queue actually fills. Shipwrights only have approve/reject — reject maps to ShipReview :returned and Project :needs_changes, so the user sees "Needs Changes." Project :rejected is fraud-only now, via admin force-state. Also drops the unused controller test and the Flipper gate on the reviewer route constraint.
|
on the Shipwright side the verdict button reads "Reject" - theres only two options, approve or reject. internally it maps to ShipReview status :returned, and the project lands in the new :needs_changes state, so the user sees "Needs Changes" on their project (not "Rejected"). Project :rejected is fraud-only now, set by an admin via the force-state modal (stolen repo, not their work, etc) — not something a Shipwright can do from the queue. |
Re-ships now probe demo_url + repo_url (Faraday GET, 5s timeout). Both reachable means auto-approve like before. Either fails means mark the pending ShipReview as returned with an automated failure feedback, sync hook flips the project to :needs_changes and DMs the owner. Shipwright approve also flips last_ship_event.certification_status to "approved" so voting/payout fires. Return leaves it alone so the user can re-ship without tripping the project_isnt_rejected requirement. Admin force-state syncs ship_event certification: :approved -> approved, :rejected -> rejected, anything else -> pending. Owner gets a Slack DM on approve and return verdicts.
|
so on a re-ship now we probe the demo + repo URLs and if either is dead we flip the project to needs changes and DM the owner with the reason. on a normal approve we also flip the ship event's certification_status so voting + payout actually fires, but on a return we leave it alone so the user can re-ship without getting blocked by the project_isnt_rejected check. admin force-state syncs the ship event the same way - approved/rejected pass through and anything else resets to pending. owner gets a slack DM on any terminal verdict. couldn't run tests locally bc pg_vector isn't installed on my pg, CI will. |
Shipwrights can't review ships on projects they're a member of - policy denies show/update/claim and scope filters them out. Same scope drops projects with deleted_at set so a deleted project mid-queue doesn't blow up the show view. Override available_for so next_eligible inherits the same filters, otherwise the next endpoint would still serve self-projects.
We're rewriting the review page and we're integrating it with AVD.