-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add all_users_data_source.go and tests #513
add all_users_data_source.go and tests #513
Conversation
Added Documentation for the datasource.
Hi @Threpio, thanks for this PR! Quoting your comment on the issue (#512 (comment)):
I do think this would be better implemented in the existing |
@manicminer Thanks for the input. I will endeavour to implement it as that flag instead. Would you like me to abandon this PR and branch or implement it here? |
Keeping it in the same PR is better, don't worry too much about your commit history as we can squash that at merge time :) |
- Added show_all_users flag - Implemented cross flag logic - fetched all users logic and append to list
- Added basic test for showAllUsers flag - Started second test to check for error but couldn't get it to work.
@manicminer - Changes have been pushed and I believe this works. I cannot work out how to test for if an error is thrown. Do you have any examples/documentation for what I could do to test that an error is thrown? (more specifically with this framework for the showAllusers and ignoreMissing flags both being set to true. |
@manicminer - Sorry for the ping. I have attempted to fix the formatting and pass the linting stage but are still failing. Any chance you could take a quick look and point out where I have mucked up? I have run the different fmt'ing commands with no changes. Feel free to push to the branch. |
@Threpio No problem at all, it looks like the linter is complaining about line 222 of users_data_source_test.go - it looks like there's a tab indenting this line however Terraform configs should be indented by 2 spaces. I'm going to queue this for v2.1.0 since we're currently working on some outstanding bugs and getting v2.0.0 ready for release. As it's possible the same files could change in the meantime, once 2.0.0 is out I'll circle back and give a proper review. |
@manicminer I have fixed the merge conflicts - Apologies for the delay. |
…y-time validation, rename `show_all_user` to `return_all_users`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Threpio, this is looking good. I pushed some small changes:
- I renamed
show_all_users
toreturn_all
- We can use
ConflictsWith
betweenignore_missing
andreturn_all
, and move the block that makes the API call to the if-else block, and then there's no need to do any apply-time validation :)
Many thanks for the contribution!
This functionality has been released in v2.1.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
For issue: #512
This datasource is to be used to retrieve all users within the AAD (not restricted to groups) and so is a catchall.
The datasource does not currently return the
mail_nicknames
like some of the other generalised data_sources.The tests are minimal and I understand if other tests need to be put into place but I am not sure of the scenarios that could be explored. Without more input params or config I do not believe that there is more to tests.
Please let me know if anything needs to be changed/refactored as this is my first PR against this repo.