-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: Support team owners for conftest policies #2953
Conversation
107e58e
to
872afff
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.
The current implementation looks good to me 👍 (please add the more test)
teams := []string{} | ||
|
||
// Only query the users team membership if any teams have been configured as owners. | ||
if prjCmds[0].PolicySets.HasTeamOwners() { |
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.
nice check 👍
📝 if teams
setting is empty, not call api. so no breaking changes even if existed github-app doesn't have members:read
permission.
If possible, please add
Once you edit this file and add into this PR, you can see preview from the github-action |
872afff
to
05216f2
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.
- Added tests based on feat(tests): Add ApprovePoliciesCommandRunner owner tests #2955
- Updated docs
- Re-tested
@@ -57,6 +57,8 @@ GitHub App needs these permissions. These are automatically set when a GitHub ap | |||
|
|||
::: tip NOTE | |||
Since v0.19.7, a new permission for `Administration` has been added. If you have already created a GitHub app, updating Atlantis to v0.19.7 will not automatically add this permission, so you will need to set it manually. | |||
|
|||
Since v0.22.3, a new permission for `Members` has been added, which is required for features that apply permissions to an organizations team members rather than individual users. Like the `Administration` permission above, updating Atlantis will not automatically add this permission, so if you wish to features that rely on checking team membership you will need to add this manually. |
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.
v0.22.3
This is the next patch release number, not sure if this will end up being the correct version.
05216f2
to
40fe231
Compare
40fe231
to
9e9392b
Compare
9e9392b
to
23318fb
Compare
@nitrocode is this still |
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.
LGTM
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.
thank you for your nice patch!
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 good. Thank you for the contribution and thank you all for helping in reviews!
sorry if this is a dumb question but this works for teams under an org right? like i can do "owners": { |
what
In addition to a list of usernames, support checking team membership when validating a particular user can approve policy violations. The new code path is only executed if team membership is configured, so it's a low impact change for existing installations.
This also documents a missing GitHub app permission -
GetTeamNamesForUser
was added in #1694 and requires themembers:read
scope, I had to add that to my GitHub app to test this feature.I need to make some doc updates for this, but wanted to get some feedback on the code first.docs updatedwhy
Maintaining a list of users by hand is a lot of toil for larger orgs.
tests
references