weaveworks / pipeline-controller

This repository contains the Pipeline CRD and associated controller for Weave GitOps Enterprise.
1 stars 4 forks source link

Add GitHub promotion unit test over SSH #47

Closed makkes closed 1 year ago

makkes commented 2 years ago

We need to test cloning and pushing over SSH for a Pipeline spec like this:


[...]
spec:
  promotion:
    pull-request:
      url: ssh://github.com/org/repo
[...]
sympatheticmoose commented 1 year ago

@makkes can you confirm if this is required after the switch to go-git-providers?

makkes commented 1 year ago

This is actually independent of go-git-providers as this is exclusively about pure git operations for which we use github.com/fluxcd/pkg/git/gogit. So yes, it is still relevant.

yitsushi commented 1 year ago

This is blocked:

msg: "unsupported URL scheme, only HTTPS supported: ssh://git@127.0.0.1:34307/org/test.git",
err: <*errors.errorString | 0xc000216140>{
    s: "unsupported URL scheme, only HTTPS supported",
},

We use go-git-provider's ParseUserRepositoryURL function to in order to create the repo client. There is actually a unit test for exactly this case in the p-c repo. Since we only have a single URL field in the Pipeline CRD, the same URL is used for both the PR creation as well as the clone operation. Therefore, we only support HTTPS. Adding support for SSH and potentially other clone protocols supported by source-controller would mean to add another URL field to the Pipeline CRD.

this one: https://github.com/weaveworks/pipeline-controller/issues/47 is blocked on ssh being added to the controller

Yes, this is an oversight. SSH is not supported.

Source: Slack

LappleApple commented 1 year ago

Closing as the issue is about testing something we don't support.

makkes commented 1 year ago

Since when do we not support SSH? It has always been supported since the inception of p-c.

yitsushi commented 1 year ago

Since when do we not support SSH? It has always been supported since the inception of p-c.

We are still using github.com/fluxcd/go-git-providers/gitprovider, did they add SSH to that, that was the blocker previously.