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 support for POST/DELETE policy_sets/:policy_set_id/relationships/projects #735

Merged
merged 10 commits into from
Jul 19, 2023

Conversation

Netra2104
Copy link
Contributor

@Netra2104 Netra2104 commented Jul 12, 2023

Description

User should be able to add/remove policy sets using POST/DELETE policy_sets/:policy_set_id/relationships/projects in the policy_set resource similar to AddWorkspace and RemoveWorkspace.

Testing plan

Integration test is added to complete the testing plan

External links

Related PR

Output from tests

Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.

$ envchain go-tfe go test -run TestPolicySetsRemoveWorkspaces -v ./...                                                
=== RUN   TestPolicySetsRemoveWorkspaces
=== RUN   TestPolicySetsRemoveWorkspaces/with_workspaces_provided
=== RUN   TestPolicySetsRemoveWorkspaces/without_workspaces_provided
=== RUN   TestPolicySetsRemoveWorkspaces/with_empty_workspaces_slice
=== RUN   TestPolicySetsRemoveWorkspaces/without_a_valid_ID
--- PASS: TestPolicySetsRemoveWorkspaces (4.10s)
    --- PASS: TestPolicySetsRemoveWorkspaces/with_workspaces_provided (0.30s)
    --- PASS: TestPolicySetsRemoveWorkspaces/without_workspaces_provided (0.00s)
    --- PASS: TestPolicySetsRemoveWorkspaces/with_empty_workspaces_slice (0.00s)
    --- PASS: TestPolicySetsRemoveWorkspaces/without_a_valid_ID (0.00s)
PASS
ok      github.com/hashicorp/go-tfe     5.069s
?       github.com/hashicorp/go-tfe/examples/configuration_versions     [no test files]
?       github.com/hashicorp/go-tfe/examples/organizations      [no test files]
?       github.com/hashicorp/go-tfe/examples/registry_modules   [no test files]
?       github.com/hashicorp/go-tfe/examples/state_versions     [no test files]
?       github.com/hashicorp/go-tfe/examples/users      [no test files]
?       github.com/hashicorp/go-tfe/examples/workspaces [no test files]
?       github.com/hashicorp/go-tfe/mocks       [no test files]

envchain go-tfe go test -run TestPolicySetsAddWorkspaces -v ./...
=== RUN   TestPolicySetsAddWorkspaces
=== RUN   TestPolicySetsAddWorkspaces/with_workspaces_provided
=== RUN   TestPolicySetsAddWorkspaces/without_workspaces_provided
=== RUN   TestPolicySetsAddWorkspaces/with_empty_workspaces_slice
=== RUN   TestPolicySetsAddWorkspaces/without_a_valid_ID
--- PASS: TestPolicySetsAddWorkspaces (3.07s)
    --- PASS: TestPolicySetsAddWorkspaces/with_workspaces_provided (0.24s)
    --- PASS: TestPolicySetsAddWorkspaces/without_workspaces_provided (0.00s)
    --- PASS: TestPolicySetsAddWorkspaces/with_empty_workspaces_slice (0.00s)
    --- PASS: TestPolicySetsAddWorkspaces/without_a_valid_ID (0.00s)
PASS
ok      github.com/hashicorp/go-tfe     3.303s
?       github.com/hashicorp/go-tfe/examples/configuration_versions     [no test files]
?       github.com/hashicorp/go-tfe/examples/organizations      [no test files]
?       github.com/hashicorp/go-tfe/examples/registry_modules   [no test files]
?       github.com/hashicorp/go-tfe/examples/state_versions     [no test files]
?       github.com/hashicorp/go-tfe/examples/users      [no test files]
?       github.com/hashicorp/go-tfe/examples/workspaces [no test files]
?       github.com/hashicorp/go-tfe/mocks       [no test files]

@Netra2104 Netra2104 requested a review from a team as a code owner July 12, 2023 14:44
@hashicorp-cla
Copy link

hashicorp-cla commented Jul 12, 2023

CLA assistant check
All committers have signed the CLA.

@Netra2104 Netra2104 marked this pull request as draft July 12, 2023 14:48
@Netra2104 Netra2104 force-pushed the Netra2104/TF-6270-post-delete-projects-to-policy-set branch from 516a333 to 5c2da47 Compare July 14, 2023 17:17
@Netra2104 Netra2104 marked this pull request as ready for review July 17, 2023 13:04
@Netra2104 Netra2104 force-pushed the Netra2104/TF-6270-post-delete-projects-to-policy-set branch from 4fbcc67 to f0a9f86 Compare July 17, 2023 13:06
CHANGELOG.md Outdated Show resolved Hide resolved
generate_mocks.sh Outdated Show resolved Hide resolved
@Netra2104 Netra2104 force-pushed the Netra2104/TF-6270-post-delete-projects-to-policy-set branch from 9c53ca3 to 1b970aa Compare July 19, 2023 15:28
brandonc
brandonc previously approved these changes Jul 19, 2023
Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

Nonblocking feedback only. Looks great!

generate_mocks.sh Outdated Show resolved Hide resolved
Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

Great!

@Netra2104 Netra2104 merged commit 77c3e57 into main Jul 19, 2023
9 checks passed
@Netra2104 Netra2104 deleted the Netra2104/TF-6270-post-delete-projects-to-policy-set branch July 19, 2023 16:02
@github-actions
Copy link

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

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.

5 participants