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

RFD 26 - Custom Approval Conditions #5071

Merged
merged 2 commits into from
Apr 13, 2021

Conversation

fspmarshall
Copy link
Contributor

@fspmarshall fspmarshall commented Dec 8, 2020

Copy link
Contributor

@klizhentas klizhentas left a comment

Choose a reason for hiding this comment

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

I like the idea of proposals as a vote log and then delayed evaluation of proposals, because
client users can build their own evaluators of proposals.

I think we need more work on the proposal evaluator, how do we express the following:

  • Alice can only approve requests for her team
  • Bob needs at least two approvers from his team, but can nominate more as a reviewer
  • Bob can approve but not override the roles proposed by Carol
  • Request will suggest Alice and bob

Also, how do we query:

  • Who can approve requests for this requests?

Building on your idea of access_request generators, we can define a predicate that gets evaluated on every state transition.

Default predicate (for backwards compatibility) will approve the request if there is any proposal moving it to the approved state.

We can define other predicates that take the list of proposals and define true or false - saying whether the request is approved. They can take the access request and say things liks:

; default predicate approves if there is any proposal moving it to approved state
approve_if: any(req.proposals, 'approved')

At least two people have approved:

approve_if: min_approvers(2)

At least two reviewers from my team has approved my request:

approve_if: ge(has_labels(req.proposals, user.traits.team), 2)

Nop request that lets clients implement their own logic and with it state machine will do nothing, never approving any request

approve_if: nop()

This borrows the same idea from predicates, we'd need to define predicates that work out of the box.

@fspmarshall fspmarshall force-pushed the fspmarshall/rfd-custom-approval-conditions branch from c33d459 to bc7e9ae Compare December 10, 2020 01:13
Copy link
Contributor

@a-palchikov a-palchikov left a comment

Choose a reason for hiding this comment

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

so far, a couple of typos.

rfd/0014-custom-approval-conditions.md Outdated Show resolved Hide resolved
rfd/0014-custom-approval-conditions.md Outdated Show resolved Hide resolved
rfd/0014-custom-approval-conditions.md Outdated Show resolved Hide resolved
rfd/0014-custom-approval-conditions.md Outdated Show resolved Hide resolved
rfd/0014-custom-approval-conditions.md Outdated Show resolved Hide resolved
rfd/0014-custom-approval-conditions.md Outdated Show resolved Hide resolved
@awly
Copy link
Contributor

awly commented Apr 5, 2021

Can this be merged, since the implementation is merged already?

@fspmarshall fspmarshall changed the title RFD 14 - Custom Approval Conditions RFD 26 - Custom Approval Conditions Apr 12, 2021
@fspmarshall fspmarshall force-pushed the fspmarshall/rfd-custom-approval-conditions branch from 9d574de to 97e80e3 Compare April 12, 2021 18:36
@fspmarshall fspmarshall marked this pull request as ready for review April 12, 2021 18:37
@klizhentas klizhentas enabled auto-merge (squash) April 13, 2021 18:33
@klizhentas klizhentas merged commit 63a6955 into master Apr 13, 2021
@klizhentas klizhentas deleted the fspmarshall/rfd-custom-approval-conditions branch April 13, 2021 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfd Request for Discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants