Repository navigation
feat: let API clients pin commits to a guild board - #1629
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
5eee1ac to
ece1a86
Compare
ece1a86 to
5593f85
Compare
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the guild commit pinning API changes.
No open issues 🎉
What changed in this PR
Extends the guild API so moderators can pin and unpin board commits without switching to the browser, reusing the web’s existing pin action and rules.
Changes:
- Adds rate-limited
PUTandDELETEpin endpoints returning HTTP 204. - Enforces moderator, board-visibility, and timeout checks while allowing unavailable pins to be cleared.
- Documents the capability and adds tests for authorization, pin replacement, stale pins, and changes during requests.
| File | Description |
|---|---|
tests/Feature/Controllers/Api/GuildCommitPinControllerTest.php |
Tests pin operations, access restrictions, timeouts, and concurrent state changes. |
routes/api.php |
Registers rate-limited pin and unpin routes with soft-deleted commit binding. |
KNOWLEDGE_BASE.md |
Documents guild board pinning through the API. |
app/Http/Requests/UpdateApiGuildCommitPinRequest.php |
Authorizes pinning eligible board commits and checks moderator timeouts. |
app/Http/Requests/DeleteApiGuildCommitPinRequest.php |
Authorizes unpinning, including pins no longer shown on the board. |
app/Http/Controllers/Api/GuildCommitPinController.php |
Calls the shared action and maps failures to API responses. |
Review effort: Balanced
5593f85 to
2ef8e7c
Compare
2ef8e7c to
bdd07e6
Compare
API clients can see a guild board's pinned commit and whether you moderate it, but a moderator can't pin or unpin from the app.
PUTandDELETE guilds/{handle}/commits/{commit}/pinpin and unpin with a 204, using the web's action and rules: only the moderator can pin, and only a top-level commit the board shows. A pin the board no longer shows can still be cleared. Anyone else gets a 404, also while in timeout, and a moderator in timeout getstimed_out.Depends on #1622, #1621, #1618, #1616 and #1614, so their commits show here until they merge.
Summary by CodeRabbit