diff --git a/.changeset/twelve-oranges-grin.md b/.changeset/twelve-oranges-grin.md new file mode 100644 index 0000000000..b508a59b0b --- /dev/null +++ b/.changeset/twelve-oranges-grin.md @@ -0,0 +1,20 @@ +--- +'@backstage/plugin-catalog-backend-module-gitlab': patch +--- + +Update GitlabDiscoveryEntityProvider to use `project.id` rather than `project.path_with_namespace` for `hasFile` check in `shouldProcessProject` + +Solves [#30147](https://github.com/backstage/backstage/issues/30147): + +> Use of project.id avoids edgecases caused by path encoding or project structure changes +> [...] +> It also simplifies reasoning about the GitLab API usage, since IDs are immutable, while paths are not. + +```diff +const hasFile = await client.hasFile( +- project.path_with_namespace, ++ project.id.toString(), + project_branch, + this.config.catalogFile, +); +```