Fix 0.17-allow-new-players#242
Conversation
|
I have tested that a fake user will return 404 from GitHub's API. |
Also re-order to put cheaper checks first.
|
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. |
Can you add that to the PR description? |
|
I made #244 for testing this |
|
Relabelling until I have a chance to actually run these unit tests. |
|
|
||
| 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Doesn't a throw still look like a failure in CI?
There was a problem hiding this comment.
validate.py traps the exceptions and prints them.
@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.