From db91602fea78c58af2c6922494e48864d50a75ab Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 9 Oct 2018 11:05:04 -0300 Subject: [PATCH 1/3] Update scpUrl and httpsUrl to support self-hosted gitlab instances --- .../README.md | 0 .../instance/testHttpsUrl.st | 7 +++++++ .../instance/testHttpsUrlForSelfHostedGitlab.st | 7 +++++++ .../instance/testScpUrl.st | 7 +++++++ .../instance/testScpUrlForSelfHostedGitlab.st | 7 +++++++ .../properties.json | 11 +++++++++++ ...efaultForRemoteURL..st => defaultForRemoteUrl..st} | 0 .../MCGitlabRepository.extension/instance/httpsUrl.st | 4 ++-- .../MCGitlabRepository.extension/instance/scpUrl.st | 4 ++-- 9 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/README.md create mode 100644 Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrl.st create mode 100644 Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrlForSelfHostedGitlab.st create mode 100644 Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrl.st create mode 100644 Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrlForSelfHostedGitlab.st create mode 100644 Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/properties.json rename Iceberg.package/IceCredentialsProvider.class/class/{defaultForRemoteURL..st => defaultForRemoteUrl..st} (100%) diff --git a/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/README.md b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrl.st b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrl.st new file mode 100644 index 0000000000..02f71368dd --- /dev/null +++ b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrl.st @@ -0,0 +1,7 @@ +running +testHttpsUrl + + | repository | + + repository := MCGitlabRepository location: 'gitlab://pharo-project/pharo:master'. + self assert: repository httpsUrl equals: 'https://gitlab.com/pharo-project/pharo.git' \ No newline at end of file diff --git a/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrlForSelfHostedGitlab.st b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrlForSelfHostedGitlab.st new file mode 100644 index 0000000000..33f6cd0afe --- /dev/null +++ b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrlForSelfHostedGitlab.st @@ -0,0 +1,7 @@ +running +testHttpsUrlForSelfHostedGitlab + + | repository | + + repository := MCGitlabRepository location: 'gitlab://git.pharo.org:pharo-project/pharo:master'. + self assert: repository httpsUrl equals: 'https://git.pharo.org/pharo-project/pharo.git' \ No newline at end of file diff --git a/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrl.st b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrl.st new file mode 100644 index 0000000000..0546007f75 --- /dev/null +++ b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrl.st @@ -0,0 +1,7 @@ +running +testScpUrl + + | repository | + + repository := MCGitlabRepository location: 'gitlab://pharo-project/pharo:master'. + self assert: repository scpUrl equals: 'git@gitlab.com:pharo-project/pharo.git' \ No newline at end of file diff --git a/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrlForSelfHostedGitlab.st b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrlForSelfHostedGitlab.st new file mode 100644 index 0000000000..15a67c54d0 --- /dev/null +++ b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrlForSelfHostedGitlab.st @@ -0,0 +1,7 @@ +running +testScpUrlForSelfHostedGitlab + + | repository | + + repository := MCGitlabRepository location: 'gitlab://git.pharo.org:pharo-project/pharo:master'. + self assert: repository scpUrl equals: 'git@git.pharo.org:pharo-project/pharo.git' \ No newline at end of file diff --git a/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/properties.json b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/properties.json new file mode 100644 index 0000000000..ef33767537 --- /dev/null +++ b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/properties.json @@ -0,0 +1,11 @@ +{ + "commentStamp" : "", + "super" : "TestCase", + "category" : "Iceberg-Tests-Core-Remotes", + "classinstvars" : [ ], + "pools" : [ ], + "classvars" : [ ], + "instvars" : [ ], + "name" : "MCGitlabRepositoryIcebergExtensionsTest", + "type" : "normal" +} \ No newline at end of file diff --git a/Iceberg.package/IceCredentialsProvider.class/class/defaultForRemoteURL..st b/Iceberg.package/IceCredentialsProvider.class/class/defaultForRemoteUrl..st similarity index 100% rename from Iceberg.package/IceCredentialsProvider.class/class/defaultForRemoteURL..st rename to Iceberg.package/IceCredentialsProvider.class/class/defaultForRemoteUrl..st diff --git a/Iceberg.package/MCGitlabRepository.extension/instance/httpsUrl.st b/Iceberg.package/MCGitlabRepository.extension/instance/httpsUrl.st index 24d2d720b2..3b25e96f0d 100644 --- a/Iceberg.package/MCGitlabRepository.extension/instance/httpsUrl.st +++ b/Iceberg.package/MCGitlabRepository.extension/instance/httpsUrl.st @@ -1,3 +1,3 @@ -*Iceberg-Adapters +*Iceberg httpsUrl - ^ 'https://gitlab.com/', projectPath, '.git' \ No newline at end of file + ^ 'https://<1s>/<2s>.git' expandMacrosWith: self hostname with: projectPath \ No newline at end of file diff --git a/Iceberg.package/MCGitlabRepository.extension/instance/scpUrl.st b/Iceberg.package/MCGitlabRepository.extension/instance/scpUrl.st index 1501dcd09b..3d3054e7e3 100644 --- a/Iceberg.package/MCGitlabRepository.extension/instance/scpUrl.st +++ b/Iceberg.package/MCGitlabRepository.extension/instance/scpUrl.st @@ -1,3 +1,3 @@ -*Iceberg-Adapters +*Iceberg scpUrl - ^ 'git@gitlab.com:', projectPath, '.git' \ No newline at end of file + ^ 'git@<1s>:<2s>.git' expandMacrosWith: self hostname with: projectPath \ No newline at end of file From 7b0e2ba35d31ce3aecac8a1b359a1d1e00b42e22 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 9 Oct 2018 11:27:29 -0300 Subject: [PATCH 2/3] Backwards compatibility with Pharo 6 --- .../MCGitlabRepository.extension/instance/hostname.st | 4 ++++ .../MCGitlabRepository.extension/properties.json | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 Iceberg-Pharo6.package/MCGitlabRepository.extension/instance/hostname.st create mode 100644 Iceberg-Pharo6.package/MCGitlabRepository.extension/properties.json diff --git a/Iceberg-Pharo6.package/MCGitlabRepository.extension/instance/hostname.st b/Iceberg-Pharo6.package/MCGitlabRepository.extension/instance/hostname.st new file mode 100644 index 0000000000..0d18b652c7 --- /dev/null +++ b/Iceberg-Pharo6.package/MCGitlabRepository.extension/instance/hostname.st @@ -0,0 +1,4 @@ +*Iceberg-Pharo6 +hostname + + ^ 'gitlab.com' diff --git a/Iceberg-Pharo6.package/MCGitlabRepository.extension/properties.json b/Iceberg-Pharo6.package/MCGitlabRepository.extension/properties.json new file mode 100644 index 0000000000..7565ccc4b6 --- /dev/null +++ b/Iceberg-Pharo6.package/MCGitlabRepository.extension/properties.json @@ -0,0 +1,3 @@ +{ + "name" : "MCGitlabRepository" +} From 536aae20142d4f044e3a01b7e7b6b3c76ed91a15 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 9 Oct 2018 15:05:44 -0300 Subject: [PATCH 3/3] Skip self-hosted Gitlab tests for Pharo 6 --- .../instance/testHttpsUrlForSelfHostedGitlab.st | 3 ++- .../instance/testScpUrlForSelfHostedGitlab.st | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrlForSelfHostedGitlab.st b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrlForSelfHostedGitlab.st index 33f6cd0afe..499c2cad91 100644 --- a/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrlForSelfHostedGitlab.st +++ b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testHttpsUrlForSelfHostedGitlab.st @@ -3,5 +3,6 @@ testHttpsUrlForSelfHostedGitlab | repository | + (SystemVersion current major <= 6) ifTrue: [self skip]. repository := MCGitlabRepository location: 'gitlab://git.pharo.org:pharo-project/pharo:master'. - self assert: repository httpsUrl equals: 'https://git.pharo.org/pharo-project/pharo.git' \ No newline at end of file + self assert: repository httpsUrl equals: 'https://git.pharo.org/pharo-project/pharo.git' diff --git a/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrlForSelfHostedGitlab.st b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrlForSelfHostedGitlab.st index 15a67c54d0..2b6dc7bc00 100644 --- a/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrlForSelfHostedGitlab.st +++ b/Iceberg-Tests.package/MCGitlabRepositoryIcebergExtensionsTest.class/instance/testScpUrlForSelfHostedGitlab.st @@ -3,5 +3,6 @@ testScpUrlForSelfHostedGitlab | repository | + (SystemVersion current major <= 6) ifTrue: [self skip]. repository := MCGitlabRepository location: 'gitlab://git.pharo.org:pharo-project/pharo:master'. - self assert: repository scpUrl equals: 'git@git.pharo.org:pharo-project/pharo.git' \ No newline at end of file + self assert: repository scpUrl equals: 'git@git.pharo.org:pharo-project/pharo.git'