Skip to content

fix(hub): support managed GitHub usernames in reviews - #324

Merged
weastler merged 6 commits into
build/hub/newfrom
weastler-hosted-preview-errors
Nov 20, 2026
Merged

weastler merged 6 commits into
build/hub/newfrom
weastler-hosted-preview-errors

Conversation

@weastler

@weastler weastler commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Why

GitHub Enterprise Managed User names contain an underscore, such as mona_enterprise. Hub rejected that character while checking review access, turning a valid account response into a review-comments 503. This failure path was reproduced locally; the reported deployed 503 still needs confirmation after deployment.

What changes

Accept managed usernames in review lookups, repository-permission checks, and mentions. Keep the full username when suggesting, selecting, counting, and highlighting a mention. Numeric account and repository identity checks, live collaborator permission, the ten-person mention limit, and visible provider failures remain unchanged.

Add two distinct Storybook states for managed-user suggestions and a saved review mention. Existing ordinary-account, empty, failure, and read-only stories remain applicable; none became obsolete. Preview hosting is a separate issue and is not changed here.

Storybook screenshots

Both added stories are shown in light and dark themes below. Each used a 1440 × 900 viewport, captured as a 600 × 240 component crop. These are isolated local Storybook fixtures, not production authentication or live GitHub responses. Browser interaction selected the full managed username, checked the mention limit, and inspected the saved highlight.

Components/Mention input/Managed User - light theme - 1440x900 viewport, 600x240 crop

Components/Mention input/Managed User - dark theme - 1440x900 viewport, 600x240 crop

Hub/Features/Review/Thread Message/Managed User Mention - light theme - 1440x900 viewport, 600x240 crop

Hub/Features/Review/Thread Message/Managed User Mention - dark theme - 1440x900 viewport, 600x240 crop

weastler and others added 4 commits November 19, 2026 22:03
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@weastler
weastler requested review from a team and nshki as code owners November 20, 2026 06:20
Copilot AI adaptive review requested due to automatic review settings November 20, 2026 06:20

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

No active review issues block the managed-user support changes.

No open issues 🎉

What changed in this PR

This PR adds GitHub Enterprise Managed User support to Hub’s review access and mentions, preserving usernames such as mona_enterprise throughout the review flow. The reported deployed 503 still needs confirmation after deployment.

Changes:

  • Accept underscores in account validation, permission checks, and mention searches.
  • Preserve full managed usernames when suggesting, selecting, counting, and highlighting mentions.
  • Add regression coverage, two Storybook states, and documentation while retaining identity and permission checks.
File Description
hub/​server/​routes/​api/​review-comments/​collaboration.db.test.ts Covers managed-user collaboration, access loss, and provider failures.
hub/​server/​routes/​api/​review-comments/​collaboration-handlers/​index.ts Accepts underscores in mention queries.
hub/​server/​integrations/​github/​read-repository-permission/​index.ts Allows managed usernames in permission checks.
hub/​server/​integrations/​github/​read-repository-permission/​index.test.ts Tests managed-account permissions and identity safeguards.
hub/​server/​integrations/​github/​create-review-directory/​index.ts Accepts managed usernames in GitHub profiles.
hub/​server/​integrations/​github/​create-review-directory/​index.test.ts Covers managed-account lookup, access denial, and provider failures.
hub/​server/​domains/​review-comments/​create-review-mention-directory/​index.ts Recognizes complete managed usernames in server-side mentions.
hub/​server/​domains/​review-comments/​create-review-mention-directory/​index.test.ts Tests mention deduplication and username length boundaries.
hub/​docs/​review-collaboration.md Documents managed-user support and numeric identity checks.
hub/​client/​utils/​get-mention-logins/​index.ts Counts full managed usernames as mentions.
hub/​client/​utils/​get-mention-logins/​index.test.ts Covers managed mention counting and overlong names.
hub/​client/​features/​review-thread-message/​stories.tsx Adds a saved managed-user mention story.
hub/​client/​components/​mention-text/​index.tsx Highlights complete managed usernames.
hub/​client/​components/​mention-text/​index.test.tsx Verifies highlighting excludes unverified prefixes.
hub/​client/​components/​mention-input/​stories.tsx Adds an interactive managed-user suggestion story.
hub/​client/​components/​mention-input/​index.tsx Keeps suggestions open while typing underscores.
hub/​client/​components/​mention-input/​index.test.tsx Tests managed-user filtering and full-name insertion.

Review effort: Balanced (adaptive)

weastler and others added 2 commits November 20, 2026 09:16
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Retain query-aware mention lookup and current repository authorization while preserving managed usernames. Regenerate the shared extension renderer from the resolved source.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@arniebradfo arniebradfo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

_

@weastler
weastler merged commit 76ddd81 into build/hub/new Nov 20, 2026
51 checks passed
@weastler
weastler deleted the weastler-hosted-preview-errors branch November 20, 2026 20:13
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