-
Notifications
You must be signed in to change notification settings - Fork 103
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
Added Team Project Access API #599
Conversation
a0d6234
to
0a7d64c
Compare
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.
Yay, permissions!
195854e
to
58c0687
Compare
58c0687
to
d51eb04
Compare
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.
I did not run the tests or smoke test in some other way, but the code looks very conventional with a small exception for pointer types on the Add method.
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.
I ran tests locally and things look good:
go-tfe[hs26gill/add-team-project-permissions*] % envchain tfe-local go test -run TestTeamProjectAccess -v ./... -tags=integration
=== RUN TestTeamProjectAccessesList
Connecting to https://tfcdev-f0bcf9e5.ngrok.io/api/v2/=== RUN TestTeamProjectAccessesList/with_valid_options
=== RUN TestTeamProjectAccessesList/with_list_options
=== RUN TestTeamProjectAccessesList/without_TeamProjectAccessListOptions
=== RUN TestTeamProjectAccessesList/without_projectID_options
=== RUN TestTeamProjectAccessesList/without_a_valid_projectID
--- PASS: TestTeamProjectAccessesList (11.08s)
--- PASS: TestTeamProjectAccessesList/with_valid_options (0.31s)
--- PASS: TestTeamProjectAccessesList/with_list_options (0.31s)
--- PASS: TestTeamProjectAccessesList/without_TeamProjectAccessListOptions (0.00s)
--- PASS: TestTeamProjectAccessesList/without_projectID_options (0.00s)
--- PASS: TestTeamProjectAccessesList/without_a_valid_projectID (0.00s)
=== RUN TestTeamProjectAccessesRead
Connecting to https://tfcdev-f0bcf9e5.ngrok.io/api/v2/=== RUN TestTeamProjectAccessesRead/when_the_team_access_exists
=== RUN TestTeamProjectAccessesRead/when_the_team_access_exists/team_relationship_is_decoded
=== RUN TestTeamProjectAccessesRead/when_the_team_access_exists/project_relationship_is_decoded
=== RUN TestTeamProjectAccessesRead/when_the_team_access_does_not_exist
=== RUN TestTeamProjectAccessesRead/without_a_valid_team_access_ID
--- PASS: TestTeamProjectAccessesRead (3.01s)
--- PASS: TestTeamProjectAccessesRead/when_the_team_access_exists (0.24s)
--- PASS: TestTeamProjectAccessesRead/when_the_team_access_exists/team_relationship_is_decoded (0.00s)
--- PASS: TestTeamProjectAccessesRead/when_the_team_access_exists/project_relationship_is_decoded (0.00s)
--- PASS: TestTeamProjectAccessesRead/when_the_team_access_does_not_exist (0.32s)
--- PASS: TestTeamProjectAccessesRead/without_a_valid_team_access_ID (0.00s)
=== RUN TestTeamProjectAccessesAdd
Connecting to https://tfcdev-f0bcf9e5.ngrok.io/api/v2/=== RUN TestTeamProjectAccessesAdd/with_valid_options
=== RUN TestTeamProjectAccessesAdd/when_the_team_already_has_access_to_the_project
=== RUN TestTeamProjectAccessesAdd/when_options_is_missing_access
=== RUN TestTeamProjectAccessesAdd/when_options_is_missing_team
=== RUN TestTeamProjectAccessesAdd/when_options_is_missing_project
--- PASS: TestTeamProjectAccessesAdd (4.20s)
--- PASS: TestTeamProjectAccessesAdd/with_valid_options (0.74s)
--- PASS: TestTeamProjectAccessesAdd/when_the_team_already_has_access_to_the_project (1.45s)
--- PASS: TestTeamProjectAccessesAdd/when_options_is_missing_access (0.00s)
--- PASS: TestTeamProjectAccessesAdd/when_options_is_missing_team (0.00s)
--- PASS: TestTeamProjectAccessesAdd/when_options_is_missing_project (0.00s)
=== RUN TestTeamProjectAccessesUpdate
Connecting to https://tfcdev-f0bcf9e5.ngrok.io/api/v2/=== RUN TestTeamProjectAccessesUpdate/with_valid_attributes
--- PASS: TestTeamProjectAccessesUpdate (2.71s)
--- PASS: TestTeamProjectAccessesUpdate/with_valid_attributes (0.27s)
=== RUN TestTeamProjectAccessesRemove
Connecting to https://tfcdev-f0bcf9e5.ngrok.io/api/v2/=== RUN TestTeamProjectAccessesRemove/with_valid_options
=== RUN TestTeamProjectAccessesRemove/when_the_team_access_does_not_exist
=== RUN TestTeamProjectAccessesRemove/when_the_team_access_ID_is_invalid
--- PASS: TestTeamProjectAccessesRemove (3.05s)
--- PASS: TestTeamProjectAccessesRemove/with_valid_options (0.46s)
--- PASS: TestTeamProjectAccessesRemove/when_the_team_access_does_not_exist (0.18s)
--- PASS: TestTeamProjectAccessesRemove/when_the_team_access_ID_is_invalid (0.00s)
PASS
ok github.com/hashicorp/go-tfe 24.236s
? github.com/hashicorp/go-tfe/examples/organizations [no test files]
? github.com/hashicorp/go-tfe/examples/workspaces [no test files]
? github.com/hashicorp/go-tfe/mocks [no test files]
Approved once the other suggestions have been made ✨
996ded7
to
c61a6e5
Compare
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.
Looks really good. I smoke tested adding/deleting/listing and found everything working as advertised.
c61a6e5
to
e1256f5
Compare
e1256f5
to
8c24c5c
Compare
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.
🏆
Co-authored-by: Brandon Croft <[email protected]>
Co-authored-by: Brandon Croft <[email protected]>
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. |
Description
A new
Team Project Access
API is added to allow users to associate team permissions on a project. Projects Team Access API docs are here (wip branch: https://github.com/hashicorp/terraform-docs-common/blob/54874464fc887ba6c3c2cae7839db9779351733d/website/docs/cloud-docs/api-docs/project-team-access.mdx)Testing plan
To run the integration test: