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

TF-9268 Add support for POST/DELETE oauth_client/:id/relationships/projects #806

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

Netra2104
Copy link
Contributor

@Netra2104 Netra2104 commented Nov 3, 2023

Description

Users should be able to add/remove projects using POST/DELETE oauth_clients/:id/relationships/projects in the oauth_client resource.

Testing plan

Integration test is added to complete the testing plan. The tests are currently set to beta but can be tested locally by removing the beta flag and running the tests.

External links

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.

=== RUN   TestOAuthClientsReadWithOptions
--- PASS: TestOAuthClientsReadWithOptions (9.20s)
=== RUN   TestOAuthClientsReadWithOptions/when_the_OAuth_client_exists
    --- PASS: TestOAuthClientsReadWithOptions/when_the_OAuth_client_exists (0.21s)
PASS

=== RUN   TestOAuthClientsAddProjects
--- PASS: TestOAuthClientsAddProjects (5.97s)
=== RUN   TestOAuthClientsAddProjects/with_projects_provided
    --- PASS: TestOAuthClientsAddProjects/with_projects_provided (0.49s)
=== RUN   TestOAuthClientsAddProjects/without_projects_provided
    --- PASS: TestOAuthClientsAddProjects/without_projects_provided (0.00s)
=== RUN   TestOAuthClientsAddProjects/with_empty_projects_slice
    --- PASS: TestOAuthClientsAddProjects/with_empty_projects_slice (0.00s)
=== RUN   TestOAuthClientsAddProjects/without_a_valid_ID
    --- PASS: TestOAuthClientsAddProjects/without_a_valid_ID (0.00s)
PASS

=== RUN   TestOAuthClientsRemoveProjects
--- PASS: TestOAuthClientsRemoveProjects (5.65s)
=== RUN   TestOAuthClientsRemoveProjects/with_projects_provided
    --- PASS: TestOAuthClientsRemoveProjects/with_projects_provided (0.49s)
=== RUN   TestOAuthClientsRemoveProjects/without_projects_provided
    --- PASS: TestOAuthClientsRemoveProjects/without_projects_provided (0.00s)
=== RUN   TestOAuthClientsRemoveProjects/with_empty_projects_slice
    --- PASS: TestOAuthClientsRemoveProjects/with_empty_projects_slice (0.00s)
=== RUN   TestOAuthClientsRemoveProjects/without_a_valid_ID
    --- PASS: TestOAuthClientsRemoveProjects/without_a_valid_ID (0.00s)
PASS


@Netra2104 Netra2104 requested a review from a team as a code owner November 3, 2023 15:48
@Netra2104 Netra2104 added wip Work in progress DO NOT MERGE labels Nov 3, 2023
@Netra2104 Netra2104 force-pushed the Netra2104/TF-9268-post-delete-oauth-api branch from d047a02 to 87f5a92 Compare November 3, 2023 16:17
@Netra2104 Netra2104 requested a review from a team November 8, 2023 15:25
@Netra2104 Netra2104 force-pushed the Netra2104/TF-9268-post-delete-oauth-api branch 2 times, most recently from 0084885 to b6ecdc9 Compare November 14, 2023 18:37
@Netra2104 Netra2104 removed wip Work in progress DO NOT MERGE labels Nov 15, 2023
brandonc
brandonc previously approved these changes Nov 15, 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.

Minor suggestion but it's nonblocking because I'm not sure when your atlas changes were merged. I ran the tests locally!

@@ -384,6 +427,140 @@ func TestOAuthClientsCreateOptionsValid(t *testing.T) {
})
}

func TestOAuthClientsAddProjects(t *testing.T) {
skipUnlessBeta(t)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it should be possible to remove skipUnlessBeta calls from your new tests because these endpoints are not behind a feature flag and the tests can be run.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Netra2104 It seems like my suggestion was a bad one. It usually takes a day for the test infrastructure to catch up with the platform nightly release. I take it that the 'Remove' endpoint was added today?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ohhhhh sorry about that; I didn't notice.

added the project relationship and the post/delete support

removed include

changelog

read with options

generate mocks

readWithOptions test

Update CHANGELOG.md

rename
@Netra2104 Netra2104 force-pushed the Netra2104/TF-9268-post-delete-oauth-api branch from a9064fa to c5faa19 Compare November 15, 2023 21:22
@hashicorp hashicorp deleted a comment from Netra2104 Nov 15, 2023
@Netra2104 Netra2104 merged commit 976b812 into main Nov 16, 2023
9 checks passed
@Netra2104 Netra2104 deleted the Netra2104/TF-9268-post-delete-oauth-api branch November 16, 2023 14:53
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.

3 participants