Skip to content
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 datasource for policy_set #592

Merged
merged 5 commits into from
Aug 19, 2022
Merged

add datasource for policy_set #592

merged 5 commits into from
Aug 19, 2022

Conversation

Uk1288
Copy link
Contributor

@Uk1288 Uk1288 commented Aug 9, 2022

Description

Add datasource for policy set. This PR is in relation to the tfe_workspace_policy_set work here #591

Remember to:

Testing plan

Note: Policy set is a paid plan.

  1. Create a policy set and then use datasource like:
data "tfe_policy_set" "readable_policy_set" {
  name = "my-policy-set"
  organization = "awesome-org"
}

External links

Include any links here that might be helpful for people reviewing your PR. If there are none, feel free to delete this section.

Output from acceptance tests

Please run applicable acceptance tests locally and include the output here. See TESTS.md to learn how to run acceptance tests.

If you are an external contributor, your contribution(s) will first be reviewed before running them against the project's CI pipeline.

$ TESTARGS="-run TestAccTFEWorkspace" make testacc

...

Screen Shot 2022-08-18 at 10 56 35 AM

Screen Shot 2022-08-18 at 10 56 46 AM

@Uk1288 Uk1288 requested a review from a team as a code owner August 9, 2022 12:09
Copy link
Contributor

@laurenolivia laurenolivia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Uk1288, I was able to successfully reproduce this! ✅

I would recommend expanding your testing plan. Like in this case, a tester will not be able to successfully replicate the behavior without the following: a, b, c. And then add those to your testing plan. 😸

Copy link
Contributor

@sebasslash sebasslash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🚀

)

func TestAccTFEPolicySetDataSource_basic(t *testing.T) {
skipIfFreeOnly(t)
Copy link
Contributor

@sebasslash sebasslash Aug 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you rebase once #602 is merged 👍 Disregard, I'll rebase your changes in #602

}

func TestAccTFEPolicySetDataSource_notFound(t *testing.T) {
skipIfFreeOnly(t)
Copy link
Contributor

@sebasslash sebasslash Aug 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this since the API returns a 404 if the policy set is not found or the user is not authorized.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per discussed, this will be added on next PR.

@Uk1288
Copy link
Contributor Author

Uk1288 commented Aug 19, 2022

I have updated the test plan to indicate that policy sets is a paid plan. I am not sure what the comment: to successfully replicate the behavior without the following: a, b, c means. Let's discuss.

@Uk1288 Uk1288 merged commit ca44122 into main Aug 19, 2022
@Uk1288 Uk1288 deleted the uk1288-policy-set-datasource branch August 19, 2022 14:37
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.

3 participants