Repository navigation
fix(hub): support managed GitHub usernames in reviews - #324
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
🟢 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)
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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.