Repository navigation
Conversation
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
GitHub logins are case-insensitive and the API returns the canonical casing. When the configured username differs only in case from what the provider reads back, the two members blocks land on different set keys, so the username DiffSuppressFunc never gets a chance to run and every plan removes and re-adds the member. An apply that is interrupted between the two calls leaves the user removed from the team. Hash the members set on the lowercased username (and role) so both blocks share a key and the existing case-insensitive diff suppression applies. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
goakshit
force-pushed
the
fix/team-members-username-case
branch
from
October 8, 2026 09:03
c69b0bb to
7464223
Compare
goakshit
marked this pull request as ready for review
October 8, 2026 09:05
Collaborator
|
Duplicate of #3539 Please add to the discussion there instead of creating a new one |
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.
Resolves #3533
Refs #1968 (the same bug seen from the other side, closed as stale) and #3539 (earlier attempt; as currently pushed it adds a duplicate check and lowercases the remove path but does not change the set key, so the diff still appears).
Before the change?
members.usernamehas a case-insensitiveDiffSuppressFunc, butmembersis aTypeSetand the default hash includes the raw username. A configured login whose case differs from whatgetTeamMembersreturns lands on a different set key, so the suppress function never runs and every plan shows the member removed and re-added.github_membership.usernamewas created with non-canonical casing and referenced fromgithub_team_members([BUG]: Discrepency between github_membership and github_team_members casing #1968). Since 6.13.0 reads lowercase every login, it bites every mixed-case username ([BUG]: v6.13.0 lower cases all team members #3533).After the change?
membersgets aSetfunction that hashes the lowercased username plus role, so the configured and the read block share a key and the existingDiffSuppressFuncapplies. No state migration: the state content is unchanged, only the set keys are derived differently.Test_hashTeamMembercovers the hash.TestAccGithubTeamMembers/members_are_case_insensitiveapplies withtestOrgUser1, then runs aPlanOnlystep with the case flipped and expects an empty plan.Testing
make testpasses,golangci-lint run --new-from-merge-base mainis clean.I have not run the acceptance tests locally, I do not have a test org set up. If a maintainer can trigger them, or if you prefer I set one up first, say so.
Manual test against a real organisation with
dev_overrides, planning twogithub_team_membersresources that hold three mixed-case logins (names replaced below). Unpatchedmain:This branch:
No changes. Your infrastructure matches the configuration.Pull request checklist
Does this introduce a breaking change?
Disclosure per CONTRIBUTING: the change was written with AI assistance (Claude Code). I have read it, the unit and lint runs above are mine, and the manual before/after plan was run against a real organisation.
🤖 Generated with Claude Code