Skip to content

github-authentication: skip education.github.com check for EMU accounts - #336608

Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
microsoft:mainfrom
brignano:claude/quirky-mendel-1k0s43
Sep 20, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 1 commit into
microsoft:mainfrom
brignano:claude/quirky-mendel-1k0s43

Conversation

@brignano

@brignano anthony (brignano) commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #327377

Reopens #327379, which GitHub auto-closed when its head fork was deleted — the head repository no longer resolves, so that PR can't be reopened. Same commit, rebased onto current main.

Enterprise Managed User (EMU) accounts can't access https://education.github.com/api/user, so checkUserDetails always fails that fetch for them and falls through to edu = 'unknown' after a wasted network round trip and a log line on every sign-in.

The EMU signal was already computed in this method — session.account.label.includes('_'), used for the isManaged telemetry property. This hoists it above the fetch and skips the request entirely for managed accounts, setting edu = 'none', then reuses the same value for telemetry instead of recomputing it.

Telemetry schema is unchanged: isEdu and isManaged are still reported with the same values for non-managed accounts.

How to test

  • Sign in with a regular github.com account — EDU status still resolves as before (student / faculty / none, or unknown when the endpoint errors).
  • Sign in with an EMU account (login shaped <idp-username>_<shortcode>) — no request to education.github.com, log shows Skipping optional EDU details check for a managed account., telemetry reports isEdu: none, isManaged: true.

Managed (EMU) accounts can't access the education.github.com endpoint, so
evaluate the EMU heuristic up front and skip the fetch entirely for them,
setting edu to 'none'. Telemetry schema is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings September 17, 2026 19:23
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

TylerLeonhardt

Matched files:

  • extensions/github-authentication/src/githubServer.ts

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.

🟢 Approval recommended

The focused change correctly avoids the unsupported request without affecting the regular-account path.

Pull request overview

Skips the unavailable GitHub Education lookup for EMU accounts while preserving telemetry behavior for regular accounts.

Changes:

  • Detects managed accounts from their login.
  • Avoids the EDU request for managed accounts and reuses the detection result for telemetry.
File summaries
File Description
extensions/github-authentication/src/githubServer.ts Adds the managed-account EDU lookup short circuit.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced (auto)

Note

Copilot is running an experiment and ran this review at Balanced.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@TylerLeonhardt TylerLeonhardt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for contributing!

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit ac717e6 into microsoft:main Sep 20, 2026
33 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.139.0 milestone Sep 20, 2026
@brignano
anthony (brignano) deleted the claude/quirky-mendel-1k0s43 branch September 20, 2026 14:05
Abdon Morales (abdonmorales) pushed a commit to abdonmorales/vscode-utcs that referenced this pull request Sep 23, 2026
…ts (microsoft#336608)

Managed (EMU) accounts can't access the education.github.com endpoint, so
evaluate the EMU heuristic up front and skip the fetch entirely for them,
setting edu to 'none'. Telemetry schema is unchanged.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit ac717e6)
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.

github-authentication: education.github.com telemetry call fires on every window launch and is unnecessary for EMU accounts

5 participants