diff --git a/.changeset/twelve-oranges-grin.md b/.changeset/twelve-oranges-grin.md index b508a59b0b..174dbdcd66 100644 --- a/.changeset/twelve-oranges-grin.md +++ b/.changeset/twelve-oranges-grin.md @@ -6,15 +6,6 @@ Update GitlabDiscoveryEntityProvider to use `project.id` rather than `project.pa Solves [#30147](https://github.com/backstage/backstage/issues/30147): -> Use of project.id avoids edgecases caused by path encoding or project structure changes +> Use of project.id avoids edge cases 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, -); -``` diff --git a/plugins/catalog-backend-module-gitlab/src/lib/client.ts b/plugins/catalog-backend-module-gitlab/src/lib/client.ts index 46ff54846c..5c373dcf4a 100644 --- a/plugins/catalog-backend-module-gitlab/src/lib/client.ts +++ b/plugins/catalog-backend-module-gitlab/src/lib/client.ts @@ -349,7 +349,7 @@ export class GitLabClient { * @param filePath - The path to the file */ async hasFile( - projectIdentifier: string, + projectIdentifier: string | number, branch: string, filePath: string, ): Promise { diff --git a/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts b/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts index e52c231d46..b3371dcc9e 100644 --- a/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts +++ b/plugins/catalog-backend-module-gitlab/src/providers/GitlabDiscoveryEntityProvider.ts @@ -590,7 +590,7 @@ export class GitlabDiscoveryEntityProvider implements EntityProvider { this.config.fallbackBranch; const hasFile = await client.hasFile( - project.id.toString(), + project.id, project_branch, this.config.catalogFile, );