-
Notifications
You must be signed in to change notification settings - Fork 92
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
Voting modularization v3a #397
Voting modularization v3a #397
Conversation
☑️ Voting procedure reminder:To cast a vote, post a comment containing 👍 All comments within this discussion are searched for votes, regardless of the time of posting. A decision will be made after this PR has been open for 15 minutes (plus/minus 10 percent, to avoid people timing their votes), and at least 8 votes have been made. NOTE: the PR will be closed if any new commits are added after: |
1 similar comment
👍 |
👍 even though I'm not exactly sure what / why exactly this is needed. |
I'm not sure everything needs to be defined on the voting object, and I'd rather reuse the minVotes and majority in the config when calculating the guaranteed result |
👎 Please wait a minute. I find the voting to be relatively complex. It is already at, say 4th grade level math, and I'd prefer it be around 2nd grade level math: listing the pairs (#yes votes,#no votes) as a key to a "votingPolicy" object whose values indicate the behavior the bot is going to take. {"0-0":"wait","0-1":"wait","1-0":"wait",..."6-0":"win","0-4":"lose","4-4":"wait"} That way, decideVoteResult just does a table lookup and the entire voting policy is sitting in the config as a table. No addition, no division, no comparison, just lookup into table. In terms of implementation, I've used string keys since javascript (unlike python) has no hashable pair type. It is ugly, but there is no doubt as to what the bot is going to do. For diagnostics, the http endpoint /votingpolicy could display a simple HTML table that tells the user what behavior the bot takes given a particular number of yes and no votes. It does take more space in the configs (so it could go in, say, config.voting.js or voting.config.js) but it is simple to implement and explain. If colors are used to code bot actions, then a visual inspection of /votingpolicy should be sufficient for the users to agree that there are no eggregious errors in the bot's voting policy. |
@dbpokorny That's a very interesting idea. I would upvote a PR for that. |
👎 I prefer voting configuration to be in the code, not in the config. Config is gitignore'd, because it's typically stuff you wouldn't want checked in. This should be checked in. |
Agreed, that voting should be in code. A table of vote results also makes it much harder to change the values later on. We would have to rebuild the voting table, if we wanted to change minimum votes to 10. |
Ugh, just realized that we're doing that with the rest of config. I have no idea what our story is here. The below feels like the ideal, but I have no idea what we're doing right now. I know things are happening, but I have no idea where we are from implementation.
|
"A table of vote results also makes it much harder to change the values later on" I see this as a feature. Changing the voting should be hard, and it should be a big deal. |
Not understand what table are you talking about. I just moved constants which were at the beginning of voting.js file to config. |
@korczis I think @dbpokorny is proposing that we build a table of predefined vote results. If a vote has 3 yes, and 3 no, it is hardcoded to stay as pending. |
@SpenserJ I think the table could be simplified further, to only include predefined pass or fail results, and all other cases being inferred as 'wait'. |
👎 |
👍 |
In hindsight my downvote was about the propose table. I do not mind the code as submitted in the PR. |
👍 OK but can the hard wired condition (highestVote < config.voting.guarantedResult) be refactored so that canDecideVote is a function like decideVoteResult? The reason is so that /votingpolicy http endpoint can then display the vote map as it is currently reflected in the bot's voting behavior by calling canDecideVote and decideVoteResult. Colored squares in a matrix could be used instead of letters so that, say yellow means not possible to decide yet if PR wins or loses, green means PR wins, red means PR loses. |
|
No description provided.