-
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: selfapprove flag for approving policies #4794
Conversation
@chenrui333 any chance that this can get more 👀 ? It would be much appreciated. |
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
Can you update the documentation for this feature? Also is there a change on the current behavior? If so, might be considered a breaking change. |
Will update the documentation. There is a slight change on the behavior where the policies would default to |
@chenrui333 @jamengual @GMartinez-Sisti updated the doc. Let me know what you guys think. Also, would it be possible for this to go out on the next release? |
this is a breaking change then, I don't think that Is a good option since the approved user (that happens to be the author ) can't approved it and it was added previously to the list of approvers. |
@jamengual So there is an option to self approve even if you are the author. But IMO, I feel like it's a best practice not to give the author the ability to approve their own PR, especially when it involves policies/guardrails. However, this option doesn't mean that the Owners cannot approve other policy checks on different PRs. That is totally feasible. I think the freedom to choose whether or not you can approve your own PR is good to have. |
@jamengual @GMartinez-Sisti @chenrui333 could we do something like this? Now, it's not a breaking change any more. I've inverted the flag so |
@jamengual @GMartinez-Sisti @chenrui333 Thank you for approving this ❤️. Any chance that this can go onto the next release? |
yes, we will add it to the next release |
Name string `yaml:"name" json:"name"` | ||
Owners PolicyOwners `yaml:"owners,omitempty" json:"owners,omitempty"` | ||
ApproveCount int `yaml:"approve_count,omitempty" json:"approve_count,omitempty"` | ||
PreventSelfApprove bool `yaml:"self_approve,omitempty" json:"prevent_self_approve,omitempty"` |
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.
PreventSelfApprove bool `yaml:"self_approve,omitempty" json:"prevent_self_approve,omitempty"`
Shouldn't both yaml and json defs here have prevent_self_approve
?
what
introducing
SelfApprove
flag to control if the author can approve.why
I think it makes sense to have the ability to control if the author can approve the policy checks.
tests
references
approve_policies
. #4813