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

Introduce more sophisticated approval rights #93

Closed
bkchr opened this issue Nov 16, 2023 · 10 comments · Fixed by #168
Closed

Introduce more sophisticated approval rights #93

bkchr opened this issue Nov 16, 2023 · 10 comments · Fixed by #168

Comments

@bkchr
Copy link
Contributor

bkchr commented Nov 16, 2023

Currently the approval rights allow to only specify a minimum rank and the number of approvals required to approve a pull request. While this is working, it is not "very inviting" as lower ranks are not incentivized to even review/approve. However on the other side it is sometimes hard to "cat herd" to get everyone together for reviewing/approval. Thus, we should improve the approval bot to have some sort of "voting power". This voting power should be similar to how on chain voting is done. Every rank gets a certain voting power and we will then require X amount of voting power to approve a pull request. Thus, we could for example have that 3 rank II members together have the same voting power as one rank III member.

CC @Bullrich

@bkchr
Copy link
Contributor Author

bkchr commented Nov 16, 2023

The best would be if the bot would support to declare some kind of lambda function. So, that we can implement the logic here in the repo.

@Bullrich
Copy link
Contributor

Hi Basti!

We have been discussing on how to appropriately handle this case.

Instead of a lambda function (which can be a security risk), we were thinking about an array that claims the voting power of each dan.

E.g.:

dan1: 1
dan2: 2
dan3: 5
dan4: 7
dan5: 10
dan6: 15

and each rule has a requirement level of approval.

For example, CI files would have a requirement of 14 points, which could be fulfilled by one approval of dan6 or a different combination.

This voting power would be in the review-bot.yml, allowing users to adjust such values to your liking.

Let me know what you think!

@mordamax
Copy link
Contributor

@bkchr could you provide a feedback or may be ping other people who could also comment on this?
Thanks

@bkchr
Copy link
Contributor Author

bkchr commented Jan 8, 2024

Sounds good, but it should also include the possibility to require that at least X from rank Y have approved.

@Bullrich
Copy link
Contributor

Hi @bkchr!

I have been thinking on how to approach the given request.

I have the following proposal:

Let's use my idea from before and say we have a field where we define the value of all the ranks, and then we set up the minimum amount of approvals of a given rank, and the minimum "score" it must have for it to pass.

For example:

score:
  dan1: 1
  dan2: 2
  dan3: 5
  dan4: 9
  dan5: 10
  dan6: 15
rules:
  - name: CI Files
    condition:
      include:
        - ^\.github/.*
    type: fellows
    minRank: 3
    minApprovals: 1
    minScore: 18

This would work in the following way:

CI Files would require at least one approval from someone who is dan 3 or greater. And the combined value of all the approvals, defined in minScore, must get to 18.

So, in this case, your vote, as a dan 6, would count 15 points. And we would still need 3 more points. Could either be from:

  • 3 dan 1.
  • 1 dan2 and 1 dan1.
  • 2 dan2.

Of course you can define the value of each dan as you see fit.

Let me know if you think this will fulfill the requirement you have with enough flexibility so I can get started on it.

@bkchr
Copy link
Contributor Author

bkchr commented Jan 20, 2024

Sounds good! :)

@Bullrich
Copy link
Contributor

Perfect.

I have created a related issue to keep track of the development: paritytech/review-bot#110

Once it is ready, I'll update the version in this repo 🙂

@Bullrich
Copy link
Contributor

PR #168 has been opened which resolves this issue.

fellowship-merge-bot bot pushed a commit that referenced this issue Feb 14, 2024
Updated Review Bot to version 2.4.0 which contains
paritytech/review-bot#110 (solved in paritytech/review-bot#113)

This resolves #93 

Updated review bot to latest version which brings new changes to the
fellow object:

Added new optional field to the config named `scores` that has the score
of each fellow per dan (added up to dan IX).

When the rule of type `fellows` has the optional field of
`minTotalScore` it will check that the score of the fellows who approved
the PR sums up to that number. If it doesn't sum to that number it will
fail with a custom error listing the score of each fellow for reference
(and saying how many points are missing).

Find a complete explanation of the new configuration here: [Fellows
Rule](/~https://github.com/paritytech/review-bot/blob/v2.4.0/README.md#fellows-rule)

- [x] Does not require a CHANGELOG entry

I also added some scores to all the dans (feel free to modify them) and
updated the `Relay and system files` rule to have a minimum score of 6.
@Bullrich
Copy link
Contributor

PR #168 has been merged (932fc15).

Seeing that it is the second time that the ticket did not close with my PR I'm suspecting that an external contributor's commit can not close a issue.

@bkchr, if the requirements for this issue are satisfied, could you please close it?

Thank!

@bkchr
Copy link
Contributor Author

bkchr commented Feb 15, 2024

Yeah! Thank you!

@bkchr bkchr closed this as completed Feb 15, 2024
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 a pull request may close this issue.

3 participants