-
Notifications
You must be signed in to change notification settings - Fork 17
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
Enhance normalize uri #14
base: main
Are you sure you want to change the base?
Conversation
uri = "git://" + uri.substring(4); | ||
} | ||
//2. Replace github.com: with github.com/ | ||
String githubDotCom = "github.com"; |
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.
The host might be arbitrary, like bitbucket.org: https://bitbucket.org/cofarrell/bower-maven-plugin/src/ee0f41a83905?at=master
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.
Ok, improved.
72dbf59
to
ca1c995
Compare
// into | ||
// git://github.com/errai/errai.git | ||
// These 3 distinctions may happen independently in other cases. | ||
String gitPrefix = "git://"; |
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.
It looks like git@ is actually an ssh:// url which, in github's case, only requires you to have a private key that matches with a ssh public key signature in github settings.
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.
Ok, let's first attempt connection with SSH, and if it fails, show message that suggests user connecting git anonymously. If user cancels, just do nothing, if user confirms, change URL from git@ into git:// and repeat the attempt.
ca1c995
to
f108279
Compare
@scabanovich can you please add some unit tests? |
f108279
to
52915f9
Compare
Tests are added. |
final boolean[] result = new boolean[]{false}; | ||
Display.getDefault().syncExec(new Runnable() { | ||
@Override | ||
public void run() { |
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.
The method run() of type new Runnable(){} must override a superclass method.
This error shows up because the project BREE is J2SE-1.5 and I happen to have a Java 5 JDK, exhibiting the issue.
We should bump the BREE to 1.7, as well as the project version to 0.15.0-SNAPSHOT
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.
Done.
Other than the BREE issue and the text to tweak, everything seems to work as advertised |
52915f9
to
befb115
Compare
throw new CoreException(new Status(IStatus.ERROR, getClass().getName(), cause.getMessage(), cause)); | ||
} catch(IOException e) { | ||
throw new CoreException(new Status(IStatus.ERROR, getClass().getName(), e.getMessage(), e)); | ||
} catch(URISyntaxException e) { |
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.
Can use multicatch now
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.
Ok.
befb115
to
d5ab2d8
Compare
1) remove tail after .git 2) In case SSH protocol is used and failed, suggest connecting git anonymously. If user cancels, do nothing, just cancel the operation. If user confirms, a) set git:// instead git@ b) set host/ instead host: Steps to reproduce: 1. Clone https://github.com/jenkinsci/jenkins 2. Import into Eclipse as a maven project. 3. Select in cli project in Maven Dependencies javassist-3.19.0.GA.jar and call Maven-> Import project(s) from SCM. 'Select Maven artifacts' press Next, then Finish. 4. If you have ssh key: Expected result: repository will be cloned, and 'Select Maven Projects' page will appear with projects to import. Current failure: 'Select Maven Projects' page appears empty. Fixed by (1 - remove tail after .git) 5. If you do not have ssh key: Expected result: a dialog 'Auth fail' appears that suggests connecting git anonymously. If accepted, continues as in 4. Current failure: 'Select Maven Projects' page appears empty. After fix of (1) - failure - system error dialog reporting exception 'Auth failed'. Fixed by (1) and (2).
d5ab2d8
to
4262766
Compare
Changes:
remove tail after .git
In case SSH protocol is used and failed, suggest connecting git anonymously.
If user cancels, do nothing, just cancel the operation.
If user confirms,
a) set git:// instead git@
b) set host/ instead host:
Steps to reproduce:
Expected result: repository will be cloned, and 'Select Maven Projects' page will appear with projects to import.
Current failure: 'Select Maven Projects' page appears empty.
Fixed by (1 - remove tail after .git)
Expected result: a dialog 'Auth fail' appears that suggests connecting git anonymously. If accepted, continues as in 4.
Current failure: 'Select Maven Projects' page appears empty.
After fix of (1) - failure - system error dialog reporting exception 'Auth failed'.
Fixed by (1) and (2).