-
Notifications
You must be signed in to change notification settings - Fork 737
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
Swtich from HttpConnector to GitHubConnector #1290
Swtich from HttpConnector to GitHubConnector #1290
Conversation
8756674
to
f1325d2
Compare
Codecov Report
@@ Coverage Diff @@
## main #1290 +/- ##
============================================
+ Coverage 77.50% 77.88% +0.37%
- Complexity 1906 1998 +92
============================================
Files 189 194 +5
Lines 6002 6209 +207
Branches 329 361 +32
============================================
+ Hits 4652 4836 +184
- Misses 1150 1159 +9
- Partials 200 214 +14
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me!
* the io exception | ||
* @see <a href="https://developer.github.com/v3/#rate-limiting">API documentation from GitHub</a> | ||
*/ | ||
void onError(GitHubConnectorResponse connectorResponse) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to @Deprecated
the HttpURLConnection
method?
@nedtwigg Any other suggestions? |
I love when javadoc has example inputs/outputs (this project scores 10/10 there) but I'm annoyed by rigid compliance with a javadoc linter forcing that gold to get diluted with "returns the value" boilerplate. Other than that personal style preference, no comments from me besides merge and release this beauty ;-) |
Yeah, there is a bunch of autogenerated text to get to compliance. Not great but compliant is still better than non-compliant. Thanks! |
Why? I do a lot of work on Spotless, because I think formatting doesn't matter and I don't want to talk about formatting. When it comes to documentation, I think it does matter, and so it's worth talking about. Automated tools can't say
isn't much better than
If you add
|
Re documentation: |
I've thought a lot about this topic, and I don't have any more to add besides this:
I don't plan to build this, but imo that's the way I would think about it. Happy documenting ;-) |
351c16e
to
a3d183c
Compare
05087f6
to
c2a13c5
Compare
@@ -21,12 +32,11 @@ | |||
* @author Liam Newman | |||
* @author Kohsuke Kawaguchi | |||
*/ | |||
public class OkHttpConnector implements HttpConnector { | |||
public class OkHttpConnector implements GitHubConnector { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Darn. OkHttpConnector
need to continue to use the HttpConnector
interface because it is may be extended by clients which will depend on further overriding HttpConnector.connet()
.
I'll need to create an OkHttpGitHubConnector
class that contains this one. I'll also need to retain ObsoleteUrlFactory
for now as well. 😢
1031179
to
fc04956
Compare
To preserve backward compatibility, OkHttpConnector must continue to be based on HttpConnector.
41cd58e
to
cd1faed
Compare
This is why we test.
b8044c5
to
e39b3d9
Compare
e39b3d9
to
056d1f0
Compare
Okay, I've got the coverage up and expanded testing to make me confident in this change. |
Huzzah, thanks a ton! Any blockers to getting this released? I can grab it from JitPack if so. |
Description
This change has the same aim as #1287 - remove this library's underlying dependency on
HttpURLConnection
and the limitations it entails.This PR introduces a new interface called
GitHubConnector
that replacesHttpConnector
. It too has a single method, but this one takesConnectorRequest
and returnsConnectorResponse
, interfaces controlled by this library instead of classes tied to any other library or java version.Significant effort was made to not change user-visible default behavior with this change. Only users who change their code to use a non-adapter implementation of
GitHubConnector
(such asOkHttpGitHubConnetor
) should see any noticeable change and even that should be limited to less used methods such asGitHub.getConnector()
.Before submitting a PR:
We love getting PRs, but we hate asking people for the same basic changes every time.
main
. Create your PR from that branch.mvn -D enable-ci clean install site
locally. If this command doesn't succeed, your change will not pass CI.When creating a PR: