From 0443119e7a3a1dd1b086d715a0bf0ff10aa29cf5 Mon Sep 17 00:00:00 2001 From: Claire Peng Date: Tue, 23 Sep 2025 09:16:57 +0100 Subject: [PATCH] add changeset Signed-off-by: Claire Peng --- .changeset/twelve-oranges-grin.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .changeset/twelve-oranges-grin.md 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, +); +```