feat: implement user social graph (followers, following, stars, watches) #8

Open
opened 2026-06-02 06:56:57 +00:00 by a-limasov · 0 comments
Owner

Context

The social graph of a Gitea instance — who follows whom, which repos are starred or
watched — is useful for discovery, notifications, and building dashboards. These
endpoints expose the full social layer of the authenticated user and any public user.

Endpoints to implement

Method Path Tool name Description
GET /user/followers list_my_followers List followers of authenticated user
GET /user/following list_my_following List users the authenticated user follows
PUT /user/following/{username} follow_user Follow a user
DELETE /user/following/{username} unfollow_user Unfollow a user
GET /users/{username}/followers list_user_followers List followers of any user
GET /users/{username}/following list_user_following List who any user follows
GET /user/starred list_my_starred_repos List repos starred by authenticated user
PUT /user/starred/{owner}/{repo} star_repo Star a repository
DELETE /user/starred/{owner}/{repo} unstar_repo Unstar a repository
GET /user/subscriptions list_my_watched_repos List repos watched by authenticated user
PUT /repos/{owner}/{repo}/subscription watch_repo Watch a repository
DELETE /repos/{owner}/{repo}/subscription unwatch_repo Unwatch a repository

Acceptance Criteria

  • All list_* tools support limit and page pagination params
  • follow_user / unfollow_user return {"success": true} on 204
  • star_repo / unstar_repo return {"success": true} on 204
  • watch_repo / unwatch_repo return {"success": true} on 204
  • Public endpoints (list_user_followers, list_user_following) work without auth for public users

Technical Notes

  • PUT /user/following/{username} and PUT /user/starred/{owner}/{repo} have no request body
  • PUT /repos/{owner}/{repo}/subscription body: {"subscribed": true, "ignored": false}
  • Star/follow operations are idempotent — calling twice returns 204 both times
## Context The social graph of a Gitea instance — who follows whom, which repos are starred or watched — is useful for discovery, notifications, and building dashboards. These endpoints expose the full social layer of the authenticated user and any public user. ## Endpoints to implement | Method | Path | Tool name | Description | |--------|------|-----------|-------------| | GET | `/user/followers` | `list_my_followers` | List followers of authenticated user | | GET | `/user/following` | `list_my_following` | List users the authenticated user follows | | PUT | `/user/following/{username}` | `follow_user` | Follow a user | | DELETE | `/user/following/{username}` | `unfollow_user` | Unfollow a user | | GET | `/users/{username}/followers` | `list_user_followers` | List followers of any user | | GET | `/users/{username}/following` | `list_user_following` | List who any user follows | | GET | `/user/starred` | `list_my_starred_repos` | List repos starred by authenticated user | | PUT | `/user/starred/{owner}/{repo}` | `star_repo` | Star a repository | | DELETE | `/user/starred/{owner}/{repo}` | `unstar_repo` | Unstar a repository | | GET | `/user/subscriptions` | `list_my_watched_repos` | List repos watched by authenticated user | | PUT | `/repos/{owner}/{repo}/subscription` | `watch_repo` | Watch a repository | | DELETE | `/repos/{owner}/{repo}/subscription` | `unwatch_repo` | Unwatch a repository | ## Acceptance Criteria - [ ] All `list_*` tools support `limit` and `page` pagination params - [ ] `follow_user` / `unfollow_user` return `{"success": true}` on 204 - [ ] `star_repo` / `unstar_repo` return `{"success": true}` on 204 - [ ] `watch_repo` / `unwatch_repo` return `{"success": true}` on 204 - [ ] Public endpoints (`list_user_followers`, `list_user_following`) work without auth for public users ## Technical Notes - `PUT /user/following/{username}` and `PUT /user/starred/{owner}/{repo}` have no request body - `PUT /repos/{owner}/{repo}/subscription` body: `{"subscribed": true, "ignored": false}` - Star/follow operations are idempotent — calling twice returns 204 both times
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: a-limasov/gitea-platform-mcp#8