From 2d16997177f4e52638bb1a7320b1406ea4ee42ee Mon Sep 17 00:00:00 2001 From: Guille Polito Date: Fri, 10 Aug 2018 15:02:49 +0200 Subject: [PATCH] Fix #961 - configure remotes with the same protocol than the clone - remove useless retry --- .../class/githubRequestUrlKey.st | 4 ++++ .../IceHttpsProtocol.extension/properties.json | 3 +++ .../class/githubRequestUrlKey.st | 4 ++++ .../IceSSHProtocol.extension/properties.json | 3 +++ .../instance/getGitHubRepository.st | 13 +++++-------- .../instance/newRepository.st | 2 +- .../class/githubRequestUrlKey.st | 4 ++++ .../IceUrlProtocol.extension/properties.json | 3 +++ 8 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 Iceberg-Plugin-GitHub.package/IceHttpsProtocol.extension/class/githubRequestUrlKey.st create mode 100644 Iceberg-Plugin-GitHub.package/IceHttpsProtocol.extension/properties.json create mode 100644 Iceberg-Plugin-GitHub.package/IceSSHProtocol.extension/class/githubRequestUrlKey.st create mode 100644 Iceberg-Plugin-GitHub.package/IceSSHProtocol.extension/properties.json create mode 100644 Iceberg-Plugin-GitHub.package/IceUrlProtocol.extension/class/githubRequestUrlKey.st create mode 100644 Iceberg-Plugin-GitHub.package/IceUrlProtocol.extension/properties.json diff --git a/Iceberg-Plugin-GitHub.package/IceHttpsProtocol.extension/class/githubRequestUrlKey.st b/Iceberg-Plugin-GitHub.package/IceHttpsProtocol.extension/class/githubRequestUrlKey.st new file mode 100644 index 0000000000..891e43ec96 --- /dev/null +++ b/Iceberg-Plugin-GitHub.package/IceHttpsProtocol.extension/class/githubRequestUrlKey.st @@ -0,0 +1,4 @@ +*Iceberg-Plugin-GitHub +githubRequestUrlKey + + ^ #'clone_url' \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/IceHttpsProtocol.extension/properties.json b/Iceberg-Plugin-GitHub.package/IceHttpsProtocol.extension/properties.json new file mode 100644 index 0000000000..7276e0977e --- /dev/null +++ b/Iceberg-Plugin-GitHub.package/IceHttpsProtocol.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "IceHttpsProtocol" +} \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/IceSSHProtocol.extension/class/githubRequestUrlKey.st b/Iceberg-Plugin-GitHub.package/IceSSHProtocol.extension/class/githubRequestUrlKey.st new file mode 100644 index 0000000000..665bbc277c --- /dev/null +++ b/Iceberg-Plugin-GitHub.package/IceSSHProtocol.extension/class/githubRequestUrlKey.st @@ -0,0 +1,4 @@ +*Iceberg-Plugin-GitHub +githubRequestUrlKey + + ^ #'ssh_url' \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/IceSSHProtocol.extension/properties.json b/Iceberg-Plugin-GitHub.package/IceSSHProtocol.extension/properties.json new file mode 100644 index 0000000000..77ea33e850 --- /dev/null +++ b/Iceberg-Plugin-GitHub.package/IceSSHProtocol.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "IceSSHProtocol" +} \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/IceTipGitHubRepositoryPanel.class/instance/getGitHubRepository.st b/Iceberg-Plugin-GitHub.package/IceTipGitHubRepositoryPanel.class/instance/getGitHubRepository.st index 1a7c744586..d19d3524b9 100644 --- a/Iceberg-Plugin-GitHub.package/IceTipGitHubRepositoryPanel.class/instance/getGitHubRepository.st +++ b/Iceberg-Plugin-GitHub.package/IceTipGitHubRepositoryPanel.class/instance/getGitHubRepository.st @@ -1,10 +1,7 @@ querying-github getGitHubRepository - "It will retry 3 times" - 1 to: 3 do: [ :attempt | - [ [ ^ IceGitHubAPI new - beAnonymous; - getRepository: self userName project: self projectName ] - on: IceAuthenticationError do: [ "I will retry." ] ] - on: LGitNoCredentialsProvided do: [ ^ nil ] ]. - ^ nil \ No newline at end of file + [ ^ IceGitHubAPI new + beAnonymous; + getRepository: self userName project: self projectName ] + on: LGitNoCredentialsProvided + do: [ ^ nil ] \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/IceTipGitHubRepositoryPanel.class/instance/newRepository.st b/Iceberg-Plugin-GitHub.package/IceTipGitHubRepositoryPanel.class/instance/newRepository.st index 2dc3fa49f1..c21e642306 100644 --- a/Iceberg-Plugin-GitHub.package/IceTipGitHubRepositoryPanel.class/instance/newRepository.st +++ b/Iceberg-Plugin-GitHub.package/IceTipGitHubRepositoryPanel.class/instance/newRepository.st @@ -11,7 +11,7 @@ newRepository (githubRepository at: #fork) ifTrue: [ | parent remote | parent := githubRepository at: #parent. - remote := IceGitRemote name: ((parent at: #owner) at: #login) url: (parent at: #'ssh_url'). + remote := IceGitRemote name: ((parent at: #owner) at: #login) url: (parent at: self selectedProtocol githubRequestUrlKey). newRepository addRemote: remote. remote fetch. ] ]. ^ newRepository \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/IceUrlProtocol.extension/class/githubRequestUrlKey.st b/Iceberg-Plugin-GitHub.package/IceUrlProtocol.extension/class/githubRequestUrlKey.st new file mode 100644 index 0000000000..ce82e97741 --- /dev/null +++ b/Iceberg-Plugin-GitHub.package/IceUrlProtocol.extension/class/githubRequestUrlKey.st @@ -0,0 +1,4 @@ +*Iceberg-Plugin-GitHub +githubRequestUrlKey + "Return the key used in github REST responses to get the URL with the correct protocol" + self subclassResponsibility \ No newline at end of file diff --git a/Iceberg-Plugin-GitHub.package/IceUrlProtocol.extension/properties.json b/Iceberg-Plugin-GitHub.package/IceUrlProtocol.extension/properties.json new file mode 100644 index 0000000000..89300bb2f3 --- /dev/null +++ b/Iceberg-Plugin-GitHub.package/IceUrlProtocol.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "IceUrlProtocol" +} \ No newline at end of file