simplify changeset & update hasFile to accept number or string
Signed-off-by: Claire Peng <clairep@spotify.com>
This commit is contained in:
@@ -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> {
|
||||
|
||||
+1
-1
@@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user