Closed O5ten closed 1 year ago
Thank you for reporting! 👍
Needs a fix somewhere in this areas: https://github.com/backstage/backstage/blob/388c62b03a494050aa778bf2fd170b078f54faba/plugins/catalog-backend-module-bitbucket-cloud/src/providers/BitbucketCloudEntityProvider.ts#L354
I'm not entirely sure if Bitbucket cloud supports wildcards in the way that we expect and that the fix here is to make sure things are encoded, or whether we should skip the search altogether if there's a wildcard and fall back to the URL reader search with readTree
. Any thoughts on this @pjungermann?
We'll be relying on contributions for this to be fixed, appreciate any help 🙏
the problem is not about the encoding of the wildcards I believe.
You can replace /**/template.yaml
with template.yaml
.
By default, we look for all files regardless of their location inside the repository, supporting monorepos etc out of the box.
You can use /template.yaml
(or /catalog-info.yaml
) if you want only files at the root (or generalized: a specific location).
Regarding the error message:
We use the code search API under the hood. There, we use the path modifier (filter) path:catalog-info.yaml
. It does not support those placeholders.
You can try it at Bitbucket code search yourself.
Valid:
path:catalog-info.yaml
path:/catalog-info.yaml
Invalid:
path:/**/catalog-info.yaml
See also the documentation about the catalogPath
configuration option at the Bitbucket Cloud discovery documentation at backstage.io. It contains a reference to the documentation about the path modifier, too.
also valid
path:/*/catalog-info.yaml
according to Bitbucket's documentation.
@pjungermann thank you! 👍
Gonna close this, I feel the documentation sufficiently explains the catalogPath
parameter. Please do open a PR if you have any suggested documentation changes though @O5ten! 🙏
It's somewhat unfortunate that it works different that other providers but it's really the reality of different capabilities of the integrated services.
📜 Description
I have configured my catalog provider like this:
And upon startup of backstage i can see the request crashing and burning like this:
The API spews out this error when i access the URL manually:
which led me to believe that the wildcards aren't properly encoded. So i changed my configuration to this:
Which made the request go through properly and find my templates.
Workaround
Ditch the wildcards, just giving the name of the file it is looking for works well aswell as provided urlencoded settings directly in the
app-config.yaml
👍 Expected behavior
My templates should be found if i follow the documentation and the wildcards should be properly urlencoded when targeting bitbucket. I'm not sure if it makes sense in the other providers.
👎 Actual Behavior with Screenshots
👟 Reproduction steps
📃 Provide the context for the Bug.
No response
🖥️ Your Environment
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Code of Conduct?
Are you willing to submit PR?
No, I don't have time to work on this right now