fix: regen api report
Signed-off-by: David Fankhänel <128792991+dfl-aeb@users.noreply.github.com>
This commit is contained in:
@@ -47,7 +47,7 @@ export const createGitlabIssueAction: (options: {
|
||||
discussionToResolve?: string | undefined;
|
||||
epicId?: number | undefined;
|
||||
labels?: string | undefined;
|
||||
issueType?: 'issue' | 'incident' | 'test_case' | 'task' | undefined;
|
||||
issueType?: 'issue' | 'task' | 'incident' | 'test_case' | undefined;
|
||||
mergeRequestToResolveDiscussionsOf?: number | undefined;
|
||||
milestoneId?: number | undefined;
|
||||
weight?: number | undefined;
|
||||
@@ -132,7 +132,7 @@ export const createGitlabRepoPushAction: (options: {
|
||||
sourcePath?: string | undefined;
|
||||
targetPath?: string | undefined;
|
||||
token?: string | undefined;
|
||||
commitAction?: 'auto' | 'update' | 'create' | 'delete' | undefined;
|
||||
commitAction?: 'auto' | 'update' | 'delete' | 'create' | undefined;
|
||||
},
|
||||
{
|
||||
projectid: string;
|
||||
@@ -189,7 +189,7 @@ export function createPublishGitlabAction(options: {
|
||||
visibility?: 'internal' | 'private' | 'public' | undefined;
|
||||
path?: string | undefined;
|
||||
description?: string | undefined;
|
||||
merge_method?: 'merge' | 'ff' | 'rebase_merge' | undefined;
|
||||
merge_method?: 'merge' | 'rebase_merge' | 'ff' | undefined;
|
||||
topics?: string[] | undefined;
|
||||
auto_devops_enabled?: boolean | undefined;
|
||||
only_allow_merge_if_pipeline_succeeds?: boolean | undefined;
|
||||
@@ -251,7 +251,7 @@ export const createPublishGitlabMergeRequestAction: (options: {
|
||||
sourcePath?: string | undefined;
|
||||
targetPath?: string | undefined;
|
||||
token?: string | undefined;
|
||||
commitAction?: 'auto' | 'update' | 'skip' | 'create' | 'delete' | undefined;
|
||||
commitAction?: 'auto' | 'update' | 'delete' | 'create' | 'skip' | undefined;
|
||||
projectid?: string | undefined;
|
||||
removeSourceBranch?: boolean | undefined;
|
||||
assignee?: string | undefined;
|
||||
@@ -302,7 +302,7 @@ export const editGitlabIssueAction: (options: {
|
||||
discussionLocked?: boolean | undefined;
|
||||
dueDate?: string | undefined;
|
||||
epicId?: number | undefined;
|
||||
issueType?: 'issue' | 'incident' | 'test_case' | 'task' | undefined;
|
||||
issueType?: 'issue' | 'task' | 'incident' | 'test_case' | undefined;
|
||||
labels?: string | undefined;
|
||||
milestoneId?: number | undefined;
|
||||
removeLabels?: string | undefined;
|
||||
|
||||
@@ -900,4 +900,44 @@ describe('publish:gitlab', () => {
|
||||
);
|
||||
expect(mockGitlabClient.ProjectMembers.add).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should warn and continue when adding ownerUsername as project member fails', async () => {
|
||||
mockGitlabClient.Users.showCurrentUser.mockResolvedValue({ id: 12345 });
|
||||
mockGitlabClient.Namespaces.show.mockResolvedValue({
|
||||
id: 1234,
|
||||
kind: 'group',
|
||||
});
|
||||
mockGitlabClient.Groups.allProjects.mockResolvedValue([]);
|
||||
mockGitlabClient.Projects.create.mockResolvedValue({
|
||||
id: 123456,
|
||||
http_url_to_repo: 'http://mockurl.git',
|
||||
});
|
||||
mockGitlabClient.Users.all.mockResolvedValue([{ id: 99999 }]);
|
||||
mockGitlabClient.ProjectMembers.add.mockRejectedValue(
|
||||
new Error('Forbidden'),
|
||||
);
|
||||
|
||||
const ctx = {
|
||||
...mockContext,
|
||||
input: {
|
||||
repoUrl: 'gitlab.com?repo=repo&owner=owner',
|
||||
ownerUsername: 'target-owner',
|
||||
},
|
||||
};
|
||||
ctx.logger.warn = jest.fn();
|
||||
|
||||
await action.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.ProjectMembers.add).toHaveBeenCalledWith(
|
||||
123456,
|
||||
50,
|
||||
{ userId: 99999 },
|
||||
);
|
||||
expect(ctx.logger.warn).toHaveBeenCalledWith(
|
||||
expect.stringContaining('Failed to add user'),
|
||||
);
|
||||
expect(ctx.logger.warn).toHaveBeenCalledWith(
|
||||
expect.stringContaining('Forbidden'),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user