RFR: Add support for using ssh cloning with GitLab

Robin Westberg rwestberg at openjdk.java.net
Mon Mar 15 12:40:39 UTC 2021


On Mon, 15 Mar 2021 11:53:36 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>> Add support for configuring a GitLab forge to use ssh for cloning repositories using a private ssh key.
>
> forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabForgeFactory.java line 71:
> 
>> 69: 
>> 70:         try {
>> 71:             Files.writeString(cfgFile, result + filtered.strip() + "\n", StandardCharsets.UTF_8);
> 
> Can this result in us writing to a users .ssh/config when running Skara CLI tools?

No, CLI tools never pass a configuration object when creating a Forge.

> forge/src/main/java/org/openjdk/skara/forge/gitlab/GitLabForgeFactory.java line 63:
> 
>> 61:         var existingMatcher = existingBlock.matcher(existing);
>> 62:         var filtered = existingMatcher.replaceAll("");
>> 63:         var result = "Match host=" + userHost + "\n" +
> 
> I don't think this is valid .ssh/config syntax. Afaik it should be `Match <keyword> <value>`, that is, no `=`. I see no tests in this PR. Are you sure this works?

Yes, tested it manually and seems to work fine. And no, there are no automated tests that exercise GitLab or GitHub APIs, except for running them with a special credential configuration..

-------------

PR: https://git.openjdk.java.net/skara/pull/1057


More information about the skara-dev mailing list