Merge pull request #29037 from StateFarmIns/fix-gitlab-scaffolder-plugin

Fix gitlab scaffolder plugin
This commit is contained in:
Ben Lambert
2025-03-05 07:49:29 +01:00
committed by GitHub
3 changed files with 10 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-gitlab': patch
---
Change the if statement in the catch block to match what the new version of Gitbeaker will return
@@ -643,8 +643,10 @@ describe('publish:gitlab', () => {
it('should show proper error message when token has insufficient permissions or namespace not found', async () => {
mockGitlabClient.Namespaces.show.mockRejectedValue({
response: {
statusCode: 404,
cause: {
response: {
status: 404,
},
},
});
const owner = 'infrastructure/devex';
@@ -387,7 +387,7 @@ export function createPublishGitlabAction(options: {
targetNamespaceId = namespaceResponse.id;
} catch (e) {
if (e.response && e.response.statusCode === 404) {
if (e.cause?.response?.status === 404) {
throw new InputError(
`The namespace ${owner} is not found or the user doesn't have permissions to access it`,
);