Skip to content

fix(controlplane): populate userEmail in whoAmI response#2774

Merged
thisisnithin merged 2 commits intomainfrom
nithin/eng-9393-studio-whoami-response-missing-useremail-field
Apr 17, 2026
Merged

fix(controlplane): populate userEmail in whoAmI response#2774
thisisnithin merged 2 commits intomainfrom
nithin/eng-9393-studio-whoami-response-missing-useremail-field

Conversation

@thisisnithin
Copy link
Copy Markdown
Member

@thisisnithin thisisnithin commented Apr 17, 2026

Summary by CodeRabbit

  • New Features
    • User identity endpoints now include the user's email address in successful responses.

Populates the userEmail field in the whoAmI response using the authenticated user's display name (which is the email). The proto schema already declared this as an optional field, but the handler was never setting it, so clients had no way to read the current user's email from this endpoint.

Closes ENG-9393.

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/docs-website.
  • I have read the Contributors Guide.

Open Source AI Manifesto

This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.

The whoAmI response schema includes an optional userEmail field,
but the handler never populated it. Set it from the authenticated
user's display name (which is the email) so clients can surface
the current user's email without a separate lookup.

ENG-9393
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

Walkthrough

The whoAmI endpoint handler adds a userEmail field to its successful response payload, sourced from authContext.userDisplayName. The modification affects only the success response path without altering request handling or error paths.

Changes

Cohort / File(s) Summary
Organization Service Handler
controlplane/src/core/bufservices/organization/whoAmI.ts
Added userEmail field to the successful response, populated from authContext.userDisplayName.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding the userEmail field to the whoAmI response handler in the controlplane.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@controlplane/src/core/bufservices/organization/whoAmI.ts`:
- Line 41: The response currently populates the userEmail field from
authContext.userDisplayName; change this to source the actual email
claim/property (e.g., authContext.userEmail or authContext.claims.email) when
building the whoAmI response and do not fall back to userDisplayName; if no
email claim exists, omit or set userEmail to undefined/null instead of using the
display name. Locate the assignment for userEmail in whoAmI.ts (the line that
currently uses authContext.userDisplayName) and replace it with a check that
reads the explicit email claim/property and only sets userEmail when that claim
is present.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 395d0b77-a9b6-4e78-90b7-cde28c16d404

📥 Commits

Reviewing files that changed from the base of the PR and between c7beb72 and a199d88.

📒 Files selected for processing (1)
  • controlplane/src/core/bufservices/organization/whoAmI.ts

Comment thread controlplane/src/core/bufservices/organization/whoAmI.ts
@thisisnithin thisisnithin enabled auto-merge (squash) April 17, 2026 14:15
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 64.45%. Comparing base (c7beb72) to head (3963f4f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...lplane/src/core/bufservices/organization/whoAmI.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2774       +/-   ##
===========================================
+ Coverage   35.50%   64.45%   +28.94%     
===========================================
  Files         129      311      +182     
  Lines       11789    44295    +32506     
  Branches      467     4764     +4297     
===========================================
+ Hits         4186    28551    +24365     
- Misses       7601    15721     +8120     
- Partials        2       23       +21     
Files with missing lines Coverage Δ
...lplane/src/core/bufservices/organization/whoAmI.ts 5.88% <0.00%> (ø)

... and 439 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thisisnithin thisisnithin disabled auto-merge April 17, 2026 14:20
@thisisnithin thisisnithin enabled auto-merge (squash) April 17, 2026 14:20
@thisisnithin thisisnithin merged commit 13a70dc into main Apr 17, 2026
10 checks passed
@thisisnithin thisisnithin deleted the nithin/eng-9393-studio-whoami-response-missing-useremail-field branch April 17, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants