openshift / tektoncd-pipeline-operator

tektoncd-pipeline operator for Kubernetes to manage installation, updation and uninstallation of tekton-cd pipelines.
Apache License 2.0
52 stars 61 forks source link

Suggestion: bitbucket server ClusterTriggerBinding clone url #635

Closed af-wieda closed 1 year ago

af-wieda commented 1 year ago

In https://github.com/openshift/tektoncd-pipeline-operator/blob/master/deploy/resources/addons/01-clustertriggerbindings/bitbucket.yaml

When a Bitbucket Server has both SSH and HTTPS enabled for clone urls the webhook payload will have a links.clone[] array like this:

"links": { "clone": [ { "href": "https://bitbucket.example.com/scm/project/project.git", "name": "http" }, { "href": "ssh://git@bitbucket.example.com:8022/project/project.git", "name": "ssh" } ], The positioning of the ssh url in the array is not predictable, and the git-clone task expects an ssh clone url.

I suggest replacing the field mapping of the payload to use a named entry instead of the first item in the array:

For example in bitbucket-pullreq:

`params:

Clone links can be found in several places in the PR payload: "fromRef.repository.links.clone[]" and "toRef.repository.links.clone[]". I can't determine which is best to use, for normal pullrequests it shouldn't matter.

Best regards, David

khrm commented 1 year ago

We don't follow the development here for Tekton atm.

khrm commented 1 year ago

/close #1640