microsoft / terraform-provider-azuredevops

Terraform Azure DevOps provider
https://www.terraform.io/docs/providers/azuredevops/
MIT License
387 stars 279 forks source link

Bug fix `azuredevops_users` - Fix user not found #1110

Closed xuzhang3 closed 4 months ago

xuzhang3 commented 4 months ago

All Submissions:

What about the current behavior has changed?

Issue Number: #936 Return error if user not found.

=== RUN   TestAccUsers_DataSource
=== PAUSE TestAccUsers_DataSource
=== RUN   TestAccUsers_DataSource_AllSvc
=== PAUSE TestAccUsers_DataSource_AllSvc
=== RUN   TestAccUsers_DataSource_All_WithFeatures
=== PAUSE TestAccUsers_DataSource_All_WithFeatures
=== CONT  TestAccUsers_DataSource
=== CONT  TestAccUsers_DataSource_All_WithFeatures
=== CONT  TestAccUsers_DataSource_AllSvc
--- PASS: TestAccUsers_DataSource_AllSvc (33.25s)
--- PASS: TestAccUsers_DataSource (42.58s)
--- PASS: TestAccUsers_DataSource_All_WithFeatures (1592.93s)
PASS
ok      github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/acceptancetests        1593.456s

Does this introduce a change to go.mod, go.sum or vendor/?

Does this introduce a breaking change?

Any relevant logs, error output, etc?

(If it’s long, please paste to https://ghostbin.com/ and insert the link here.)

Other information

drdamour commented 4 months ago

@xuzhang3 this broke some behaviour we were depending on...where if a user wasn't known to azdo it didn't fail. we look for all members of groups and add them to teams and now it fails and we have to manually add em. seems like a mistake to force this behaviour

other providers have added an ignore_missing default false to make it work..is that possible here?

xuzhang3 commented 4 months ago

@drdamour This resource is empty if specified principal_name or origin_id not found. It should be safe to delete these resources or add the users to ADO

drdamour commented 4 months ago

@xuzhang3 aware...but i AM specifying a name because i want to see if the user exists in azdo and add them to a team if they do.

Adding the user to AzDO isn't something i can do with terraform and requires a manual step so the terraform automation breaks with this "fix"

xuzhang3 commented 4 months ago

@drdamour I see, letting the user decide the next step instead of a pop-up error message seems to be a better choice

xuzhang3 commented 3 months ago

@drdamour Change has been revert in #1116