#1667

docs: summarize the remaining guild, organization, user and starred endpoints

Draftjubianchiwants to merge intofrom

WARNING

Depends on #1646 (and the PRs below it), still open. Until they merge, this diff also shows their changes; this pull request's own changes.

Summary

Seven endpoints still had no summary in the API docs: one in Guilds, two in Organizations, three in Users and one in Me. Each was a single docblock away, so this fills them in one go, after #1666 did the headlines.

Changes

  1. Summaries. Docblocks on the controller methods, which Scramble turns into the summaries of the spec and the docs:

    EndpointSays
    GET /guilds24 a page, most members first, ?q= over handle, name and description; a 404 while guilds aren't open to the account
    POST /organizations/{handle}/followfollowing again changes nothing; a 404 for an organization without a page
    DELETE /organizations/{handle}/followunfollowing one you don't follow changes nothing; a 404 for an organization without a page
    POST /users/{handle}/follownotified once, unless they mute the follower; a 403 for yourself or across a block
    DELETE /users/{handle}/followunfollowing someone you don't follow changes nothing
    DELETE /users/{handle}/muteanswers with the user and is_muting: false, like the mute does with true
    GET /starredlast starred first, 20 a page, without the commits the user can no longer see
  2. Spec. resources/api/openapi.json is generated again; only these seven summaries change. A dataset test checks each of them.

No code changes: what the API answers stays the same.

Validation

CheckResult
pest --parallel --coverage --exactly=100.0 (full suite)6667 passed, 100.0%
pest --type-coverage --min=100100.0%
pint --test, rector --dry-run, phpstanclean
scramble:exportsame spec as committed

Visual evidence

Playwright (Chromium) against a local dev server, each page opened on an endpoint of this PR. Before is #1646, after is this branch.

Before, 1440 lightAfter, 1440 lightAfter, 1440 dark
Before, 390 lightAfter, 390 light

Device verification

Emulation only (390×844, DPR 2, touch): no hardware or simulator. No interaction changes.

Independent review

A fresh read-only reviewer, given the guidelines, the diff, the validation results and the captures, checked each summary against the requests, actions and queries behind it. On base 3c4a4838 (#1646), head 6834e85b: CODE: PASS, VISUAL: PASS. Applied in e530ed51:

  • unfollowing an organization without a page is a 404 too;
  • following notifies only the first time, and not someone who mutes the follower;
  • a refused follow is a 403;
  • starred commits the user can no longer see are left out.

Limitations

  • As in #1646, Scramble reads denyAsNotFound() as a 403: the error list of GET /guilds and of following an organization shows a 403 where the API answers 404. The summaries say 404.
  • Commits and Remotes still have endpoints without a summary; they come next, each in its own PR.

Activity

7
coderabbitai[bot]9d ago

IMPORTANT

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

This pull request is a draft

Merging is unavailable until it is marked ready for review.