Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 17, 2025

Addresses feedback from #2 about type consistency in conditional for_each expressions.

Changes

  • Updated data.github_user.referenced_users and data.github_app.bypass_apps to use toset([]) instead of [] in the false branch of ternary operators
  • Ensures both branches return consistent set types for for_each, which expects set or map
# Before
for_each = length(var.github_user_ids) == 0 ? toset(local.all_user_logins) : []

# After
for_each = length(var.github_user_ids) == 0 ? toset(local.all_user_logins) : toset([])

While Terraform coerces empty lists in practice, explicit type matching improves clarity and avoids potential edge cases.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update user ID resolution in governance module Fix type consistency in for_each empty set handling Nov 17, 2025
Copilot AI requested a review from vmvarela November 17, 2025 08:00
@vmvarela vmvarela marked this pull request as ready for review November 17, 2025 08:01
@vmvarela vmvarela merged commit bc4c9be into vmvarela/do-not-get-ids-on-repository Nov 17, 2025
@vmvarela vmvarela deleted the copilot/sub-pr-2 branch November 17, 2025 08:01
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.

2 participants