fix(catalog-backend): support Bitbucket servers with custom BaseURLs

Previously, the `BitbucketDiscoveryProcessor` assumed that all Bitbucket servers would have paths formed in the pattern of `/projects/{project}/repos/{repo}`.  However, since Bitbucket servers have the ability to configure custom baseUrls, this assumption does not always hold true. Instead of evaluating project and repo terms from the full target path, the processor will find the `/projects/` url segment, and start path evaluations from its index instead. This path substring is then used to determine the `projectSearchPath` and the `repoSearchPath`. Support is also added to accept search params for the `catalogPath` as well.

Fixes #8771

Signed-off-by: Dhruval Darji <dhruvaldarji@gmail.com>
This commit is contained in:
Dhruval Darji
2022-01-07 11:19:10 -05:00
parent 3cf9ff0ba4
commit 6fd70f8bc8
3 changed files with 222 additions and 18 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend': patch
---
Provide support for Bitbucket servers with custom BaseURLs.