Add support for Bitbucket Context path - Fix issue #742
Add support for Bitbucket Context path
Fix: #742
@fbuchmeier-abi would you be able to test this fix? There is no patch release planned yet, so it may take time for this to be officially released.
You should be able to build notification-controller container image by running make docker-build IMG=<custom-image-name:tag> at the root of the cloned repository.
Hi @darkowlzz ,
thank you very much for the quick fix. I will test it tomorrow and let you know how it works.
@fbuchmeier-abi would you be able to test this fix? There is no patch release planned yet, so it may take time for this to be officially released.
You should be able to build notification-controller container image by running
make docker-build IMG=<custom-image-name:tag>at the root of the cloned repository.
Hi,
sorry for the late response. I was able to test the fix and it is working fine in our environment with the following configuration:
apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Provider
metadata:
name: bitbucket
namespace: flux-system
spec:
type: bitbucketserver
address: https://example.com/bitbucket/scm/proj/fluxcd.git
secretRef:
name: bitbucket-token
@fbuchmeier-abi, @fbuchmeier-abi : I have now added code to support all of the scenarios.
Here is how it works:
Look at the last /scm/ in the path (after host). Anything, if present, on left of it is context path. Anything right of it is project/repo. We finally build api path by using the context, project and repo values. We don't care what's on the left of last /scm/ i.e context path may contain any depth or may contain /scm/
@fbuchmeier-abi Could you please test this new code in your env? I have tested in mine for all different scenarios and it works fine.
@darkowlzz : While working on this fix, I realized there were some unused variables being passed in functions. I added the fix for it in this PR. Is it okay to club those fixes with this change or should I revert these and submit a separate PR to fix these?
While working on this fix, I realized there were some unused variables being passed in functions. I added the fix for it in this PR. Is it okay to club those fixes with this change or should I revert these and submit a separate PR to fix these?
@gdasson yes, seems good to me. Thanks.
@gdasson I've built and deployed commit a3d456c8b2a6199209a11af96e101848e25d54e0 in our env and it is working as expected, thanks!
I've used the following provider config:
apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Provider
metadata:
name: bitbucket
namespace: flux-system
spec:
type: bitbucketserver
address: https://example.com/bitbucket/scm/project/sandbox.git
secretRef:
name: bitbucket-token
@darkowlzz : Fixed all of the review comments. Please review. Thx.
@gdasson can you please rebase with upstream main