simplify changeset & update hasFile to accept number or string

Signed-off-by: Claire Peng <clairep@spotify.com>
This commit is contained in:
Claire Peng
2025-09-25 10:12:40 +01:00
parent 0443119e7a
commit 61b6281e5c
3 changed files with 3 additions and 12 deletions
+1 -10
View File
@@ -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,
);
```
@@ -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<boolean> {
@@ -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,
);