Skip to content

fix: use usernames and remove email approvers - #147

Merged
Qi Zhang (Zhangqi910) merged 1 commit into
mainfrom
fix/4157-remove-github-email-approvers
Oct 10, 2026
Merged

Qi Zhang (Zhangqi910) merged 1 commit into
mainfrom
fix/4157-remove-github-email-approvers

Conversation

@Omansh5

@Omansh5 Omansh5 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR fixes Bug #4157(Azure/Azure-Landing-Zones#4157) by removing email address support for GitHub approvers in the Terraform bootstrap module.

The current GitHub approver implementation supports resolving approvers using either a GitHub username or an email address. The email-based approach has been causing intermittent issues during GitHub bootstrap.

As requested in the issue discussion, this change removes the email-based approver lookup and makes GitHub username the supported approver identifier.

Changes

GitHub approver validation

  • Removed email-based approver detection and lookup from modules/github/team.tf.
  • Removed the dependency on user.email when resolving GitHub approvers.
  • Retained GitHub username-based approver lookup.
  • Updated invalid approver validation to validate against GitHub usernames only.
  • Updated the validation error message to clearly indicate that a valid GitHub username is required.
  • Retained the existing GitHub team creation and team membership behavior.
  • No changes were made to Azure DevOps approver handling.

Approver configuration behavior

GitHub approvers are now expected to be provided using their GitHub usernames.

For example:

apply_approvers = ["ayush-ms"]

Email addresses are no longer supported as GitHub approver identifiers.

Tests and validation

Terraform validation

The following checks were completed successfully:

  • terraform fmt -check -recursive
  • terraform validate
  • git diff --check

Approver regression testing

The updated approver resolution and validation logic was tested with the following scenarios:

  • Single valid GitHub username — passed.
  • Multiple valid GitHub usernames — passed.
  • Invalid GitHub username — correctly rejected.
  • Email address supplied as an approver — correctly rejected.
  • Mixed valid and invalid usernames — correctly identifies the invalid approver.
  • Empty approver list — passed.

The test data included a GitHub user represented as:

github_users = [
  {
    login = "ayush-ms"
    email = ""
  }
]

The email value was intentionally left empty to verify that the updated approver resolution relies on the GitHub username and does not use the email field.

The change is limited to modules/github/team.tf.

Screenshot 2026-09-10 142615 Screenshot 2026-09-11 162600 Screenshot 2026-09-14 120132 Screenshot 2026-09-14 121100 Screenshot 2026-09-14 122443 Screenshot 2026-09-14 163421 Screenshot 2026-09-14 163545 Screenshot 2026-09-14 163833

@Zhangqi910
Qi Zhang (Zhangqi910) merged commit e038163 into main Oct 10, 2026
9 checks passed
@Zhangqi910
Qi Zhang (Zhangqi910) deleted the fix/4157-remove-github-email-approvers branch October 10, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants