applicationset icon indicating copy to clipboard operation
applicationset copied to clipboard

feat: add support for Bitbucket Server (SCM + PR)

Open mlosicki opened this issue 2 years ago • 9 comments

Implementation details

Uses Basic auth instead of access tokens like the other SCMs. Note that Personal Access Tokens do work with this.

PRs do not support labels. Added a branchMatch field for PRs which allows you to filter based on the source branch name (e.g. only consider PRs that include -argocd)

Repos do indeed support labels, but the go-bitbucket-v1 library does not. It would have to be added upstream first.

Speaking of go-bitbucket-v1, version was increased as it has some bugfixes that were merged and are related to this PR (e.g. missing pagination options)

Closes #505

mlosicki avatar Feb 15 '22 22:02 mlosicki

@mlosicki this morning got taken up by another review. But I should have a chance to do a last pass review no later than tomorrow morning.

crenshaw-dev avatar Mar 14 '22 17:03 crenshaw-dev

@mlosicki : Can u please move this PR into argocd as applicationset is moved. If u find it laborious, i can do it on your behalf with your consent

rishabh625 avatar Apr 04 '22 05:04 rishabh625

This is merged we can close it

rishabh625 avatar Apr 25 '22 04:04 rishabh625

@mlosicki - A question about this PR. I can see that Basic Auth is implemented. We are using ssh with privatekeys stored in secrets towards bitbucket server. Do you know if this would work, or would we still need to provide basic auth as well?

simcax avatar May 06 '22 09:05 simcax

@mlosicki - A question about this PR. I can see that Basic Auth is implemented. We are using ssh with privatekeys stored in secrets towards bitbucket server. Do you know if this would work, or would we still need to provide basic auth as well?

@simcax No, it won't work. Bitbucket Server doesn't have an option to authenticate to the REST API via ssh keys. Those keys are only used for Git operations. So you do need Basic auth, preferably via personal access tokens.

mlosicki avatar May 06 '22 15:05 mlosicki

@mlosicki - A question about this PR. I can see that Basic Auth is implemented. We are using ssh with privatekeys stored in secrets towards bitbucket server. Do you know if this would work, or would we still need to provide basic auth as well?

@simcax No, it won't work. Bitbucket Server doesn't have an option to authenticate to the REST API via ssh keys. Those keys are only used for Git operations. So you do need Basic auth, preferably via personal access tokens.

Ah - of coures, that makes sense - although a bit of a nuisance having to create a service user of sorts. Thx!

simcax avatar May 06 '22 18:05 simcax

Has this PR been moved to applicationSet controller in ArgoCD, now that the applicationSet Controller is part of it?

simcax avatar Jun 03 '22 09:06 simcax

Yep! https://github.com/argoproj/argo-cd/pull/9049

crenshaw-dev avatar Jun 03 '22 13:06 crenshaw-dev

Yep! argoproj/argo-cd#9049

Cool!

simcax avatar Jun 07 '22 05:06 simcax