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

We should practice selflessness in this experiment. #173

Closed
wants to merge 2 commits into from

Conversation

mrhwick
Copy link
Contributor

@mrhwick mrhwick commented May 24, 2017

Changelog:

  • Added a function owner_name_added_in_diff() which will detect the PR owner's name in the PR diff as an addition.
  • Reject PRs outright that exhibit selfishness.

path = 'http://github.com/{urn}/pull/{pr_num}.diff'
diff = api('get', path)
regex = '\+.+{username}'.format(username=owner_name)
return re.match(regex, diff)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be case insensitive

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch

@rhengles
Copy link
Member

Why not let democracy judge that ?

@mrhwick
Copy link
Contributor Author

mrhwick commented May 24, 2017

That's what this PR is for, democracy is judging it as we speak.

@bperson
Copy link

bperson commented May 24, 2017

@rhengles due to @PlasmaPower sneakily grabbing the power earlier :) See #162 for a beautiful story written by @rudehn

@dehodson
Copy link
Contributor

I thought about making this very same PR but decided against it, it doesn't stop anyone from just obfuscating and putting their name in. Heck, "deho" + "dson" gets around it.

@mrhwick
Copy link
Contributor Author

mrhwick commented May 24, 2017

Good point, but at least it makes the attack more difficult.

@PlasmaPower
Copy link
Contributor

PlasmaPower commented May 24, 2017

I don't like this. It creates a false sense of security. The author can just register another username or just do something like "rewopamsalp"[::-1].

Edit: missed the 2 above comments

@bperson
Copy link

bperson commented May 24, 2017

A possible solution is to have chaosbot edit all comments and PRs to "blank" them, leaving only the code, hence forcing everyone to look at it before voting.

@rudehn
Copy link
Contributor

rudehn commented May 24, 2017

or make it harder to change the voting rules

@dehodson
Copy link
Contributor

dehodson commented May 24, 2017

Or, perhaps someone other than the author needs to leave a review approving the changes? Obviously doesn't stop collusion but an army of bots mass-upvoting would also circumvent the current process.

@bperson
Copy link

bperson commented May 24, 2017

@dehodson The review on #138 didn't stop people from upvoting our benevolent dictator into power.

@dehodson
Copy link
Contributor

@bperson It wasn't an approval, though, and a lot of people probably voted before reading that. If there was a change made requiring someone other than the author approve the changes it would at least show that someone took the time to look at what was changed.

@bperson
Copy link

bperson commented May 24, 2017

@dehodson so we should not count votes before the review? it seems super flaky to me, we might as well start voting via reviews instead of "reactions"

@PlasmaPower
Copy link
Contributor

PlasmaPower commented May 24, 2017

How about we require one non-author review submitted after the latest push?

Edit: and make sure the account is at least one month old.

@dehodson
Copy link
Contributor

dehodson commented May 24, 2017

@bperson, no, no, that's not what I'm saying. I'm saying we need one approval before merging, as well as a positive vote ratio.
edit: @PlasmaPower sniped me

@bperson
Copy link

bperson commented May 24, 2017

Yes, I understood that and you're not solving "a lot of people probably voted before reading that" by doing it.

It's like patching a leak with duct tape full of holes :D

@dehodson
Copy link
Contributor

@bperson: The review on #138 was not an approval.

@@ -23,6 +23,16 @@ def poll_pull_requests():
pr_num = pr["number"]
Copy link

Choose a reason for hiding this comment

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

proving a point, sry :)

@PlasmaPower
Copy link
Contributor

Maybe instead of requiring one approval, we should require more approval reviews than rejection reviews, similar to how the base voting works? The difference would be only reviews submitted after the latest push would count.

@bperson
Copy link

bperson commented May 24, 2017

we might as well start voting via reviews instead of "reactions"

:)

@PlasmaPower
Copy link
Contributor

we might as well start voting via reviews instead of "reactions"

People might, but this project relies on people doing the right thing anyway. If we make it clear that a review should only be submitted after fully reviewing the changes, it might work.

@xyproto
Copy link
Contributor

xyproto commented May 24, 2017

This pull request will prevent people from accidentally submitting their usernames. Which is nice.

@@ -1,4 +1,6 @@
import arrow
import re
import requests
Copy link
Contributor

Choose a reason for hiding this comment

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

This import doesn't appear to be used anywhere.

"""
path = 'http://github.com/{urn}/pull/{pr_num}.diff'
diff = api('get', path)
regex = '\+.+{username}'.format(username=owner_name)
Copy link
Contributor

@reddraggone9 reddraggone9 May 24, 2017

Choose a reason for hiding this comment

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

This requires there be at least one character between the literal '+' and the username. You probably want .* instead of .+. It'd also be slightly more correct if you used ^ with MULTILINE.

__log.info("PR %d rejected for selfishness, closing", pr_num)
gh.comments.leave_reject_comment_too_selfish(api, settings.URN, pr_num)
gh.prs.label_pr(api, settings.URN, pr_num, ["rejected"])
gh.prs.close_pr(api, settings.URN, pr)
Copy link
Contributor

Choose a reason for hiding this comment

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

You could factor out a reject_with_comment function instead of duplicating this logic.

@PlasmaPower
Copy link
Contributor

This would also prevent legit PRs like #166.

@mrhwick
Copy link
Contributor Author

mrhwick commented May 24, 2017

I think it would be useful to require that people be honored by others as a part of legitimate PRs like #166

@chaosbot
Copy link
Collaborator

🙅 This PR did not meet the required vote threshold and will not be merged. Closing.

Open a new PR to restart voting.

@rudehn
Copy link
Contributor

rudehn commented May 24, 2017

Try this again with #153 accepted

@PlasmaPower
Copy link
Contributor

I guess I got to use my power after all :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants