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

[JENKINS-31482] Be able to use HTTP/HTTPS for new GH API Endpoints #9

Merged
merged 7 commits into from Nov 10, 2015

Conversation

@recena
Copy link
Contributor

commented Nov 9, 2015

JENKINS-31482

This PR is a second part (review) of #6

@reviewbybees

@reviewbybees

This comment has been minimized.

Copy link

commented Nov 9, 2015

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@@ -82,13 +82,14 @@

protected AbstractGitHubSCMSource(String id, String apiUri, String checkoutCredentialsId, String scanCredentialsId, String repoOwner, String repository) {
super(id);
this.apiUri = apiUri;
this.apiUri = Util.fixEmpty(apiUri);

This comment has been minimized.

Copy link
@jglick

jglick Nov 9, 2015

Member

🐛 this directly contradicts the stated intent of the PR.

This comment has been minimized.

Copy link
@jglick

jglick Nov 9, 2015

Member

Still contradicts the annotation a few lines below.

This comment has been minimized.

Copy link
@recena

recena Nov 9, 2015

Author Contributor

Done.

@@ -207,7 +207,7 @@ public ListBoxModel doFillCheckoutCredentialsIdItems(@AncestorInPath SCMSourceOw

public ListBoxModel doFillApiUriItems() {
ListBoxModel result = new ListBoxModel();
result.add("Github", "");
result.add("Github", "https://github.com");

This comment has been minimized.

Copy link
@jglick

jglick Nov 9, 2015

Member

🐜 GitHub

@jglick

This comment has been minimized.

Copy link
Member

commented Nov 9, 2015

🐛 fixEmpty makes no sense for a field intended to be @Nonnull; and you are missing a readResolve for existing settings using a null (or blank?) field.

@jenkinsadmin

This comment has been minimized.

Copy link
Member

commented Nov 9, 2015

Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests

@recena recena changed the title apiUri is now mandatory, cannot be null Be able to use HTTP or HTTPS for new GH API Endpoints Nov 9, 2015
@recena recena changed the title Be able to use HTTP or HTTPS for new GH API Endpoints Be able to use HTTP/HTTPS for new GH API Endpoints Nov 9, 2015
recena added 3 commits Nov 9, 2015
@recena

This comment has been minimized.

Copy link
Contributor Author

commented Nov 9, 2015

I forget that the method Connector.connect(String, StandardCredentials) is designed considering apiUri == null then GitHub (SaaS).

return endpoint.getHost();
} catch (MalformedURLException e) {
// ignore

This comment has been minimized.

Copy link
@amuniz

amuniz Nov 9, 2015

Member

So, if apiUri is not a well formed URL then github.com is returned. It's a weird behaviour from a UX point of view IMO (if the user sets something wrong then it must be notified back somehow).

This comment has been minimized.

Copy link
@recena

recena Nov 9, 2015

Author Contributor

This happens when the logic (backend) defines a behavior and the UI other different 😵
The idea is to include input data validation to avoid this kind of checks here.

@recena

This comment has been minimized.

Copy link
Contributor Author

commented Nov 10, 2015

@jglick I've changed the PoV of this PR. The title has been changed.

@jglick

This comment has been minimized.

Copy link
Member

commented Nov 10, 2015

🐝

@jglick

This comment has been minimized.

Copy link
Member

commented Nov 10, 2015

If you can verify that #6 introduced the regression I think I saw (http-protocol checkout even though authenticated against github.com), and that this PR corrects it, then I think it qualifies as a priority bug fix eligible for inclusion in 1.0.

@recena

This comment has been minimized.

Copy link
Contributor Author

commented Nov 10, 2015

@jglick Let me check it.

@recena recena changed the title Be able to use HTTP/HTTPS for new GH API Endpoints [JENKINS-31482] Be able to use HTTP/HTTPS for new GH API Endpoints Nov 10, 2015
@recena

This comment has been minimized.

Copy link
Contributor Author

commented Nov 10, 2015

@jglick I've tested:

  1. Create a GH Organization using github.com 👍
  2. Create a GH Organization using a GH Enterprise Server (HTTP) 👍

I could not try with GH Enterprise Server (HTTPs) because the certificate generated in the installation process has a different IP (No subject alternative names matching IP address X.X.X.X found).

@recena

This comment has been minimized.

Copy link
Contributor Author

commented Nov 10, 2015

@jglick I've repeated the same tests using the current master and this result was the result:

  1. Create a GH Organization using github.com 👎 because it uses http to clone
  2. Create a GH Organization using a GH Enterprise Server (HTTP) 👍
@amuniz

This comment has been minimized.

Copy link
Member

commented Nov 10, 2015

🐝

recena added a commit that referenced this pull request Nov 10, 2015
[JENKINS-31482] Be able to use HTTP/HTTPS for new GH API Endpoints
@recena recena merged commit 04c7597 into jenkinsci:master Nov 10, 2015
1 check passed
1 check passed
Jenkins This pull request looks good
Details
@recena recena deleted the recena:reviewOf-JENKINS-31445 branch Nov 10, 2015
@recena

This comment has been minimized.

Copy link
Contributor Author

commented Nov 10, 2015

@jglick

This comment has been minimized.

Copy link
Member

commented Nov 10, 2015

Thanks. I released this as 0.1-beta-4 to assist in testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.