Forward the guest curator election - #106
Conversation
One new write, application-vote, carrying the applicant, the vote and an optional note. The account being voted on travels as `applicant` for the same reason a decision does: `username` carries the caller this gateway validated and Build() refuses a client's version of it, so a reviewer naming themselves would only ever vote on their own row. The window write gains `quorum` and `term_days`, and roster-set gains `term_days`. All three are optional and all three are checked when PRESENT, null included: CopyIfPresent forwards a null through the allowlist, and upstream reads a null as absent, so a `"quorum": null` would quietly do nothing while this fence claimed it had checked a number in range. That is the hole roster `rules` had. `term_days` accepts 0 on roster-set and refuses it on the window. They are different questions: on a seat, 0 is the one way to say "stop expiring", while a zero-day round would be a window nobody can be elected in. `trial` leaves ApplicationRoles. A guest seat is trailed and bounded by its term, so the backend no longer offers an untrailed one.
An objection could only be lifted by endorsing, which made somebody who merely stopped objecting add a vote toward the quorum they were doubting. The backend gained a third value; the fence has to allow it or the button would be refused at the edge.
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
PR Summary by QodoForward guest curator election voting and term controls
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1. Default promotions now fail
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedNext included review available in 43 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe gateway adds the ChangesCuration desk write expansion
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Client
participant Routes
participant PrivateApi
participant ServeDeskWrite
Client->>Routes: POST application-vote
Routes->>PrivateApi: CurationDeskApplicationVote
PrivateApi->>ServeDeskWrite: Validate and forward ApplicationVote
ServeDeskWrite-->>Client: Write result
Merge Risk: ⚪ Minimal · up to The gateway adds the election writes and validation coverage without a remaining merge-blocking issue. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks each vote with care Comment |
A term only expires a seat that may carry one, so `term_days` above 0 on a mod or an admin is a value the backend would only reject. This gateway's job is to refuse those here rather than spend an authenticated round trip finding out. 0 stays legal on any role: it says no term, which is what a permanent role already is. Also restores the comment label the vote handler took from the window one.
Closes #105. Pairs with ecency/esync-py#79, which ships first.
One new write,
application-vote, carryingapplicant,voteand an optionalnote. The account being voted on travels asapplicantfor the same reason a decision does:usernamecarries the caller this gateway validated, andBuild()refuses to copy a client's version of it, so a reviewer naming themselves would only ever vote on their own row.application-windowgainsquorumandterm_days;roster-setgainsterm_days.What the fence actually checks
All three are optional and all three are validated when present, null included.
CopyIfPresentforwards a null through the allowlist and upstream reads a null as absent, so a"quorum": nullwould quietly do nothing while this fence claimed it had checked a number in range. That is the hole rosterruleshad.term_daysaccepts0onroster-setand refuses it on the window. They are different questions: on a seat, 0 is the one way to say "stop expiring", while a zero-day round would be a window nobody can be elected in.trialleavesApplicationRoles. A guest seat is trailed and bounded by its term, so the backend no longer offers an untrailed one.Verification
application-voteadded to the parity driver's route list.Summary by CodeRabbit
New Features
Validation
Changes
trialapplication role is no longer accepted.