Skip to content

Conversation

@jasonyuezhang
Copy link
Owner

Github usernames are case-insensitive and users currently can configure their usernames with any captialization they see fit.

To correctly attribute usernames to users, we need to do a case-insensitive search when looking for ExternalActor and send Github a case-insensitive username back as well. The second point is probably not needed but good to do.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.


Copied from getsentry#101984
Original PR: getsentry#101984

@propel-test-bot propel-test-bot bot changed the title 🐛 fix(github): make inbound/outbound assignment sync case-insensitive Fix case sensitivity in GitHub inbound and outbound assignee sync Oct 23, 2025
@propel-test-bot
Copy link

Case-Insensitive GitHub Assignee Sync (Inbound & Outbound)

Makes user-mapping logic between Sentry and GitHub insensitive to username capitalization in both inbound and outbound assignment flows. Production code now lower-cases GitHub usernames before API calls and uses a case-insensitive lookup when resolving ExternalActor records. New tests cover inbound, outbound, and multi-group scenarios to verify the change.

Key Changes

• Updated sync_group_assignee_inbound_by_external_actor() in src/sentry/integrations/utils/sync.py to query ExternalActor.external_name with __iexact (case-insensitive)
• Enhanced GitHubIntegration.sync_assignee_outbound() in src/sentry/integrations/github/integration.py to lower() the stripped GitHub username before PATCHing the issue
• Added test test_assignment_with_external_actor_case_insensitive in tests/sentry/integrations/utils/test_sync.py
• Added test test_sync_assignee_outbound_case_insensitive in tests/sentry/integrations/github/test_integration.py

Affected Areas

src/sentry/integrations/utils/sync.py
src/sentry/integrations/github/integration.py
• Assignee sync test suites

This summary was automatically generated by @propel-code-bot

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