I think what's going on is that GitHub takes some non-zero amount of time to compute this value, and our test runs too fast sometimes and try to fetch a PR before its mergeability is computed
regex_expected: The . character(s) in the pattern ".md" can match any character, because calls to replaceAll treat the pattern as a regular expression, which might be unexpected.
This reverts commit 0bf81f4fb9.
The point of this is to allow me to use a separate account to avoid
corrupting my event stream. GitHub.connect() does the standard handling
for those who are not me.
Strategy pattern is better for API rate limit handling as the current
behavior is quite valid for batch applications.
I'm not taking OkHttp version change so as not to introduce any unneeded
version requirement.
Using the Jenkins EnvInject or Credentials Binding Plugins its possible to
pass credentials as Environment Variables.
Its useful for Github.connect() to be able to directly read the values of the
'login', 'password' and 'oauth' properties directly from the environment.
This commit modifies the base Github.connect() method to resolve credentials
in two steps:
1. ~/.github credentials file if it exists.
2. login, password or oauth variables from the environment
A further fromEnvironment() method is provided to support
loading from non-standard variable names.
The old Github.connect() method would throw an IOException if the ~/.github file
did not exist. Now it will fail silently instead dropping back to the anonymous
users access level.
Added new unit tests into GitHubTest.
Setting labels and assignee on Pull requests failed silently, because
the API endpoint being hit contained '/pulls/' rather than '/issues/'.
"Every pull request is an issue, but not every issue is a pull request.
For this reason, “shared” actions for both features, like manipulating
assignees, labels and milestones, are provided within the Issues API."
https://developer.github.com/v3/pulls/#labels-assignees-and-milestones
If the test assertion fails, we want the pull-request to be closed anyway.
You can't have more than one pull-request merging a given branch into
another, so leaving the PR hanging will cause subsequent test runs to fail
in setup.
Exposes a new API call at GitHub root level to build the complete
set of organisations and teams that current user belongs to.
This change allows to massively reduce the number of calls to GitHub
especially for people that belongs to multiple organisations with
lots of teams and members.
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>