Skip to content

feat: link the profiles bios mention in the API's follower lists - #1538

Open
WendellAdriel wants to merge 2 commits into
dev-null-sh:productionfrom
WendellAdriel:feat/api-list-bio-profiles
Open

WendellAdriel wants to merge 2 commits into
dev-null-sh:productionfrom
WendellAdriel:feat/api-list-bio-profiles

Conversation

@WendellAdriel

@WendellAdriel WendellAdriel commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

GET api/v1/users/{handle} returns bio_profiles, which says which handles in a bio or company are people or organizations on dev/null, so a client can link them as the web profile does. The followers and following lists return the same users without it. A client that wants to link bios in those lists would need one profile request per row.

Both lists now return bio_profiles on each user, in the same {lowercase handle: handle} shape as the profile. It's {} when a bio mentions no one.

BioProfilesQuery::getMany() reads the handles for the whole page and looks them up with one Profile query, and with no query when no bio on the page mentions anyone. UserConnectionCollection adds the result to each UserResource. It doesn't set it on the models, per the guideline against attaching response values to models. UserResource itself is unchanged, so other endpoints return the same fields as before.

Summary by CodeRabbit

  • New Features
    • Signed API responses for followers and followed people now include profiles mentioned in each person’s bio, with an empty mapping when there are no mentions.
    • Updated the API documentation to describe the profile information included in these responses.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The follower and following API endpoints now return each connection’s bio-mentioned profiles in a bio_profiles field. The lookup batches profile queries across the paginated users.

Changes: Bio profiles in connection endpoints

Layer / File(s) Summary
Batch bio-profile lookup
app/Queries/BioProfilesQuery.php, tests/Unit/Queries/BioProfilesQueryTest.php
BioProfilesQuery extracts mentions from bio and company fields. Its multi-user lookup deduplicates handles, queries matching profiles, and returns results keyed by user ID. Unit tests cover matching and empty results, including query counts.
Connection endpoint responses
app/Http/Controllers/Api/UserFollowersController.php, app/Http/Controllers/Api/UserFollowingController.php, app/Http/Resources/UserConnectionCollection.php, tests/Feature/Controllers/Api/UserFollowersControllerTest.php, tests/Feature/Controllers/Api/UserFollowingControllerTest.php, KNOWLEDGE_BASE.md
Both endpoints pass the paginated users and their fetched profiles to UserConnectionCollection. The collection adds a bio_profiles object to each user resource. Feature tests check populated and empty objects; the knowledge base lists this endpoint capability.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant UserFollowingController
  participant BioProfilesQuery
  participant UserConnectionCollection
  UserFollowingController->>BioProfilesQuery: fetch profiles for paginated users
  BioProfilesQuery-->>UserFollowingController: profiles keyed by user ID
  UserFollowingController->>UserConnectionCollection: pass page and profiles
  UserConnectionCollection-->>UserFollowingController: user resources with bio_profiles
Loading

Possibly related PRs

Suggested reviewers: mnapoli, simonhamp

Merge Risk: Minimal · up to f0cb7

The follower and following endpoints add a bio_profiles field with a batched lookup. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately describes linking bio-mentioned profiles in follower lists, which is part of the changeset. It omits the following lists but remains specific and related.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 7 files. (1 skipped: 1 unsupported.)

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: b2913012-54e7-40fa-b7c4-7094cc6c1728
Commits

Reviewing files that changed from the base of the PR and between f8b3dae and f0cb7a5.

Files selected for processing: 8

  • KNOWLEDGE_BASE.md
  • app/Http/Controllers/Api/UserFollowersController.php
  • app/Http/Controllers/Api/UserFollowingController.php
  • app/Http/Resources/UserConnectionCollection.php
  • app/Queries/BioProfilesQuery.php
  • tests/Feature/Controllers/Api/UserFollowersControllerTest.php
  • tests/Feature/Controllers/Api/UserFollowingControllerTest.php
  • tests/Unit/Queries/BioProfilesQueryTest.php

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

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.

1 participant