integrations / integrations/terraform-provider-github

[BUG]: Support suspended EMU users

Open
#3,392 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

r/team_members Type: Bug
Dominant language
Go
Stars
1.2k
Forks
1k
Avg merge
1d 14h
Merged PRs (30d)
8

Description

Expected Behavior

Able to remove a suspended GitHub EMU user from a team or repository.

Actual Behavior

The user cannot be found because when a user is suspend its username goes from {normalized_idp_username}_{enterprise_shortcode} to an obfuscated hash: {username_hash}_{enterprise_shortcode}

See https://docs.github.com/en/enterprise-cloud@latest/admin/managing-iam/provisioning-user-accounts-with-scim/deprovisioning-and-reinstating-users#effects-of-soft-deprovisioning

All username based operations will fail on suspended users or silently fail.

Terraform Version

v6.12.1

It was happening for a long time any way

Affected Resource(s)
  • resource_github_team_members
  • but also all other resources referencing a user by username
Terraform Configuration Files

Steps to Reproduce

Get a EMU account
Create a team and add the EMU user as a member
Suspend the user and wait for the username change
Try to remove the user

Debug Output

Panic Output

Code of Conduct
  • I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the resource_github_team_members entry point and trace how username-based operations identify users through the GitHub API. Compare behavior before and after an EMU user is suspended, then check other resources that reference users by username. Done means suspended EMU users can be removed and username-based operations no longer fail or silently do nothing.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, go, terraform
Domain
api, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.