Skip to content

feat(reviewer): start in-app Shipwright queue#82

Open
dhamariT wants to merge 9 commits into
hackclub:platformfrom
dhamariT:feat/review-page-0-to-1
Open

feat(reviewer): start in-app Shipwright queue#82
dhamariT wants to merge 9 commits into
hackclub:platformfrom
dhamariT:feat/review-page-0-to-1

Conversation

@dhamariT
Copy link
Copy Markdown
Contributor

We're rewriting the review page and we're integrating it with AVD.

Comment thread app/models/project.rb

event :return_for_changes do
transitions from: :under_review, to: :submitted
end
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we sure about this

dhamariT added 2 commits May 13, 2026 11:21
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.
@dhamariT
Copy link
Copy Markdown
Contributor Author

dhamariT commented May 13, 2026

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.
@dhamariT
Copy link
Copy Markdown
Contributor Author

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.
@dhamariT dhamariT marked this pull request as ready for review May 13, 2026 16:34
@dhamariT dhamariT changed the base branch from main to platform May 13, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants