You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: link the profiles bios mention in the API's follower lists - #1538
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.
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.
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.
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.
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
dev-null-sh/dev-null.sh#1328: This PR established the signed follower and following endpoints that this change extends.
dev-null-sh/dev-null.sh#1266: This PR introduced bio-mention profile lookup, which this change extends to connection lists.
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: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GET api/v1/users/{handle}returnsbio_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_profileson 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 oneProfilequery, and with no query when no bio on the page mentions anyone.UserConnectionCollectionadds the result to eachUserResource. It doesn't set it on the models, per the guideline against attaching response values to models.UserResourceitself is unchanged, so other endpoints return the same fields as before.Summary by CodeRabbit