Skip to content

feat: let API clients pin commits to a guild board - #1629

Merged
paulinevos merged 2 commits into
dev-null-sh:productionfrom
WendellAdriel:feat/api-guild-pin
Nov 23, 2026
Merged

paulinevos merged 2 commits into
dev-null-sh:productionfrom
WendellAdriel:feat/api-guild-pin

Conversation

@WendellAdriel

@WendellAdriel WendellAdriel commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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.

PUT and DELETE guilds/{handle}/commits/{commit}/pin pin 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 gets timed_out.

Depends on #1622, #1621, #1618, #1616 and #1614, so their commits show here until they merge.

Summary by CodeRabbit

  • New Features
    • Added signed API support for pinning and unpinning commits on guild boards moderated by the user.
    • Pinning a commit replaces the board’s existing pin. A commit can still be unpinned after it is no longer shown on the board.
    • Requests are restricted to eligible root commits, and timed-out moderators cannot pin or unpin commits.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The signed API adds endpoints to pin and unpin commits on guild boards. Requests check guild ownership, commit eligibility, feature availability, and timeout status. Feature tests cover successful changes, authorization outcomes, and unavailable commits.

Changes: Guild commit pins

Layer / File(s) Summary
Pin request authorization
app/Http/Requests/UpdateApiGuildCommitPinRequest.php, app/Http/Requests/DeleteApiGuildCommitPinRequest.php
Pin requests require an eligible root commit shown on the guild board. Unpin requests also allow the currently pinned commit when it is no longer shown. Both requests check for a timeout after the other authorization conditions pass.
Pin routes and action handling
routes/api.php, app/Http/Controllers/Api/GuildCommitPinController.php, tests/Feature/Controllers/Api/GuildCommitPinControllerTest.php, KNOWLEDGE_BASE.md
Authenticated PUT and DELETE routes call the controller, which invokes the pin action and handles moderator removal and unavailable commits. Tests cover pin state, access checks, timeouts, and commit availability. The Signed API feature list documents pinning and unpinning.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant APIClient
  participant ApiRoutes
  participant UpdateApiGuildCommitPinRequest
  participant GuildCommitPinController
  participant UpdateGuildCommitPin
  APIClient->>ApiRoutes: Send authenticated PUT or DELETE request
  ApiRoutes->>UpdateApiGuildCommitPinRequest: Check request authorization
  ApiRoutes->>GuildCommitPinController: Dispatch authorized request
  GuildCommitPinController->>UpdateGuildCommitPin: Set or clear guild commit pin
  GuildCommitPinController-->>APIClient: Return no content on success
Loading

Possibly related PRs

  • dev-null-sh/dev-null.sh#1610: Adds web pin controls and the guild pin storage and eligibility rules referenced by these API endpoints.
  • dev-null-sh/dev-null.sh#1614: Adds the guild lookup response with pinned commit and moderator status, which is a related data contract for the pin API.

Suggested reviewers: paulinevos, simonhamp

Merge Risk: Minimal · up to bdd07

This adds API endpoints to pin and unpin guild commits, restricted to the board moderator, with 404 for ineligible users and timed_out for a moderator in timeout. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat: let API clients pin commits to a guild board" matches the main change. The changeset adds PUT and DELETE endpoints (GuildCommitPinController, update/delete request classes, routes, te…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat: let API clients pin commits to a guild board" matches the main change. The changeset adds PUT and DELETE endpoints (GuildCommitPinController, update/delete request classes, routes, tests, and a KNOWLEDGE_BASE.md entry) that let signed API clients pin and unpin a commit on a guild board. The title is short, specific, and uses a conventional commit prefix. It does not mention the moderator-only rule or the timeout behavior, which is acceptable because a title need not cover every detail.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a246a363-1cc0-4be3-90ee-abd0a9fd68d3
Commits

Reviewing files that changed from the base of the PR and between ece1a86 and bdd07e6.

Files selected for processing: 2

  • KNOWLEDGE_BASE.md
  • routes/api.php

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Copilot AI left a comment

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.

🟢 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 PUT and DELETE pin 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

@paulinevos
paulinevos merged commit 86378e6 into dev-null-sh:production Nov 23, 2026
11 of 12 checks passed
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.

3 participants