Skip to content

Feature/add expands fields relations to get user by id v2 - #148

Merged
smarcet merged 4 commits into
mainfrom
feature/add-expands-fields-relations-to-get-user-by-id-v2
Jul 22, 2026
Merged

Feature/add expands fields relations to get user by id v2#148
smarcet merged 4 commits into
mainfrom
feature/add-expands-fields-relations-to-get-user-by-id-v2

Conversation

@smarcet

@smarcet smarcet commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

smarcet added 2 commits July 21, 2026 19:44
Wires SerializerUtils::getExpand()/getFields()/getRelations() into both
by-ID user endpoints (matching the ParametrizedGetAll pattern already
used by list endpoints), and makes PrivateUserSerializer treat `groups`
as a gated relation (mirroring ApiScopeGroupSerializer) instead of
appending it unconditionally.

Unblocks ftn-docsnsklz PR #76 (SDS ftn-attendee-native-realtime-comms.md,
D38): attendee-networking-api's IDP user_updated consumer needs to fetch
exactly fields=public_profile_allow_chat_with_me,first_name,last_name,pic
without pulling the rest of the private profile.

v1 get() also migrated from manual try/catch to the shared
processRequest() wrapper for consistent error handling with getV2().

Also fixes an unrelated pre-existing bug in UserLoginTurnstileTest where
$testEmail/$testPassword being typed as non-nullable string caused a
TypeError before the test's own markTestSkipped() logic could run when
TEST_USER_EMAIL/TEST_USER_PASSWORD are unset.

9 new tests added to OAuth2UserApiTest; full suite green (180 tests,
0 failures, 7 legitimate skips).
@smarcet
smarcet requested review from Copilot and romanetar July 22, 2026 03:35

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@smarcet, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 43 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0ffa5f5b-e13e-4bea-b16a-155c3c1834ab

📥 Commits

Reviewing files that changed from the base of the PR and between 24c00ca and 6f1135d.

📒 Files selected for processing (4)
  • app/Http/Controllers/Api/OAuth2/OAuth2UserApiController.php
  • app/ModelSerializers/Auth/UserSerializer.php
  • tests/OAuth2UserApiTest.php
  • tests/UserLoginTurnstileTest.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/add-expands-fields-relations-to-get-user-by-id-v2

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

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/openstackid/openapi/pr-148/

This page is automatically updated on each push to this PR.

@github-actions

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/openstackid/openapi/pr-148/

This page is automatically updated on each push to this PR.

Address deep-review findings on PR #148:
- OA\Get annotation for GET /api/v1/users/{id} was missing the `expand`
  parameter even though get() already passed SerializerUtils::getExpand()
  into serialize() -- the capability was live but undocumented.
- v1 lacked a default-shape regression test symmetric with
  testGetUserByIdV2WithNoParamsReturnsSameShapeAsBefore, so the
  fields/relations passthrough's backward compatibility on v1 was only
  exercised incidentally.
@github-actions

Copy link
Copy Markdown

📘 OpenAPI / Swagger preview

➡️ https://OpenStackweb.github.io/openstackid/openapi/pr-148/

This page is automatically updated on each push to this PR.

@romanetar romanetar 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.

LGTM

@smarcet
smarcet merged commit 83eaa4a into main Jul 22, 2026
8 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