Skip to content

Fix 0.17-allow-new-players#242

Open
tnelling wants to merge 22 commits into
masterfrom
no-fake-users
Open

Fix 0.17-allow-new-players#242
tnelling wants to merge 22 commits into
masterfrom
no-fake-users

Conversation

@tnelling
Copy link
Copy Markdown
Collaborator

@tnelling tnelling commented Feb 15, 2019

@jeffkaufman's testing made me realize we probably need this.

Prevents fake users from joining.
Addresses an issue (see #243) that caused any new user PR to be rejected on the PR itself.
Adds a set of tests to validate the allow-new-players rule.

@tnelling tnelling added the reviewme PRs that are ready for review label Feb 15, 2019
@tnelling
Copy link
Copy Markdown
Collaborator Author

I have tested that a fake user will return 404 from GitHub's API.

Also re-order to put cheaper checks first.
@tnelling
Copy link
Copy Markdown
Collaborator Author

I've also added a fix here per the discussion in #243. I think it makes sense to do it here so that we close the loophole allowing fake GitHub users before we open the gate we intended to for real users.

Comment thread rules/0.17-allow-new-players.py Outdated
@jeffkaufman
Copy link
Copy Markdown
Owner

I've also added a fix here per the discussion in #243.

Can you add that to the PR description?

@jeffkaufman
Copy link
Copy Markdown
Owner

I made #244 for testing this

@jeffkaufman jeffkaufman mentioned this pull request Feb 15, 2019
@tnelling tnelling added do-not-merge Used for work in progress PRs and removed reviewme PRs that are ready for review labels Mar 5, 2019
@tnelling
Copy link
Copy Markdown
Collaborator Author

tnelling commented Mar 5, 2019

Relabelling until I have a chance to actually run these unit tests.

@tnelling tnelling mentioned this pull request Mar 10, 2019

if points_name != 'initial':
raise Exception('New player bonus value must be called "initial"')
raise Exception('New player bonus value is called "%s" instead of "initial"' % points_name)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What I'm not clear on is how we know we're looking at a PR for a new user at this point? If an existing user tries to add a new, non-'initial' bonus file won't this exception still throw?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes. And that's fine, because this is an allow rule. If it throws, we just move to the next rule. The general pattern for the allow rules is that we assume the PR in question is trying to pass that rule, and throw exceptions with wording to match.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Doesn't a throw still look like a failure in CI?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

validate.py traps the exceptions and prints them.

@tnelling tnelling changed the title Don't allow fake users Fix allowing players to join without approval Mar 11, 2019
@tnelling tnelling changed the title Fix allowing players to join without approval Fix 0.17-allow-new-players Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge Used for work in progress PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants