-
Notifications
You must be signed in to change notification settings - Fork 427
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
fix: SHOW USERS
output with insufficient privileges
#2815
Conversation
cc @sfc-gh-asawicki @sfc-gh-jmichalak for review |
Hey @candiduslynx. Thanks for the contribution! First, please consult https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CONTRIBUTING.md#making-a-contribution. There are a few pointers on how to make it easier for us to review and accept the change. What I lack the most here is:
We will be shortly redoing user resource as part of https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/ROADMAP.md#preparing-essential-ga-objects-for-the-provider-v1, we may just address this issue then. Let me know if you want to proceed or if you prefer to wait for our changes (in such a case, please create an issue with the exact problem description following https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CREATING_ISSUES.md). |
Hi @sfc-gh-asawicki! Thanks for pointing to the missing points for this PR.
Could you share ETA for the fix in
For now I'll create the issue & try to make the PR more approachable. |
If nothing unexpected happens, I'd say we will redo user resource within a month.
We do not have guidelines on how to write them, but you can check other tests to get the idea. We have instructions on how to set them up locally, though. You can check the instructions here: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/CONTRIBUTING.md#running-the-tests-locally. Also, because the guidelines have been recently refreshed, they may lack some points, so we would greatly appreciate feedback on what else should be included. |
@sfc-gh-asawicki I've opened #2817 I'll be looking for the tests in the meantime. |
@sfc-gh-asawicki I've retested the code manually & found that the original issue isn't solvable by |
Hey @candiduslynx. I am not sure if this is a bad upstream behavior. We are handling it this way in multiple places in the project (e.g. |
Thanks @sfc-gh-asawicki for pointing me to the functions you already have here.
I skimmed through them & the I hope that'll be enough to be merged & released. If not, please advise what should be added to the PR. |
Hey @candiduslynx. The PR is still missing the acceptance/integration tests pointed out in #2815 (comment). We won't merge/release it without them. |
I've added the integration test in 526e9f6. |
The rules for writing the acceptance tests that we follow for any other bugfix are:
In this case, we should:
Sometimes, we tend to show that the setup fails for the given provider version and succeeds for the newest one explicitly (like in As you see The integration test you have added does not show that other fields are not filled for the role without sufficient privileges but are filled when using the privileged one; let's be explicit about this. Also, it makes hidden assumptions about the secondary client setup - it should be clear from the test, why we expect the given outcome (for now comment in code explaining why and linking the issue would be enough). I still only see two paths that are acceptable from our side:
|
OK, @sfc-gh-asawicki I don't think I have too much time adding the acceptance tests for this, so I'll be closing this PR & waiting for the #2817 to be addressed by your team then, |
Okay @candiduslynx. Thanks for understanding. We will let you know in #2817 when we have it ready. |
Fixes #2817
Test Plan
OWNERSHIP
&MANAGE GRANTS
privilege (as required for full output in docsReferences
We have an internal issue when scanning
Users.Show
output: