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

Auto-convert git/ssh-urls to https with GithubPRPlanPlugin #254

Closed
jleopold28 opened this issue Jul 24, 2020 · 5 comments · Fixed by #282
Closed

Auto-convert git/ssh-urls to https with GithubPRPlanPlugin #254

jleopold28 opened this issue Jul 24, 2020 · 5 comments · Fixed by #282
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@jleopold28
Copy link
Contributor

When attempting to clone an https repository (https://github.com/blah/foo), the pipeline actually pulls via the git protocol (git://github.com/blah/foo).

This causes a problem when we execute the curl command to post comments.
See:

+ curl -H 'Authorization: token ****' -X POST -d @/home/jenkins/workspace/_terraform-pipeline-example_PR-4@tmp/body.txt -H 'Content-Type: application/json' -D comment.headers git://github.com/api/v3/repos/foo/terraform-pipeline-example/issues/4/comments
curl: (1) Protocol git not supported or disabled in libcurl
@jleopold28 jleopold28 changed the title GithubPRPlan Plugin bug GithubPRPlanPlugin bug Jul 24, 2020
@kmanning
Copy link
Collaborator

It looks like you're using the GithubOrg jenkins plugin, and you've added behavior to "Checkout over SSH". As a result, the git url that the plugin is finding has the git:// protocol instead of an https:// protocol.

@kmanning
Copy link
Collaborator

kmanning commented Jul 25, 2020

@bondezbond has also run into this issue, and we talked through it a bit.

I think there are 2 possible options here:

  1. We can advertise the withRepoHost() method in the README, and you can override the github URL that is being used to check the project out.
  2. We can auto-magically check and replace the git:// protocol with https://. This might be a little awkward. Since the user chose to check the repo out with SSH, we don't know if their github instance is available over http or https. Though, honestly we could just pick https and if we're wrong, it's not the worst situation in the world. If our auto-magic choice doesn't work, they can fall back to option 1 and specify the full url themselves.

@kmanning kmanning added this to the v5.9 milestone Jul 25, 2020
@kmanning kmanning added bug Something isn't working enhancement New feature or request labels Jul 31, 2020
@kmanning
Copy link
Collaborator

Have we validated that the PR link is constructed correctly for the public github?

@kmanning
Copy link
Collaborator

kmanning commented Aug 3, 2020

Bumping this to v5.10, so we can cut a v5.9 release

@kmanning kmanning modified the milestones: v5.9, v5.10 Aug 3, 2020
@jleopold28
Copy link
Contributor Author

Have we validated that the PR link is constructed correctly for the public github?

You mean posting the plan results to public github? I remember testing that when we did the initial release

@kmanning kmanning changed the title GithubPRPlanPlugin bug Auto-convert git/ssh-urls to https with GithubPRPlanPlugin Aug 5, 2020
kmanning added a commit that referenced this issue Aug 5, 2020
@kmanning kmanning linked a pull request Aug 17, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants