RFR: 1910: Basic support for Bitbucket as a Forge [v2]

Erik Joelsson erikj at openjdk.org
Tue May 16 20:33:21 UTC 2023

On Tue, 16 May 2023 20:11:42 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

>> forge/src/main/java/org/openjdk/skara/forge/bitbucket/BitbucketHost.java line 55:
>>> 53:         this.sshPort = sshPort;
>>> 54:         this.credential = null;
>>> 55:     }
>> It seems like credential cannot be `null` when `useSsh` is `true` (see the method `sshHostString`). Maybe the constructors should reflect this? Or use static factory methods like `BitBucketHost.withSSH` and/or `BitBucketHost.withPAT`?
> I more or less copy pasted the existing gitlab implementation here so this is following the same existing patterns. The same relationship between useSsh and credential are present there too. I agree it could be made neater with a builder pattern like most other factories do, or static factory methods.

I decided to make it simpler by just removing the second constructor and let the factory deal with requiring credentials for ssh. Having two constructors didn't really make sense anymore as no API calls to bitbucket were needed.


PR Review Comment: https://git.openjdk.org/skara/pull/1521#discussion_r1195662560

More information about the skara-dev mailing list