From fcc073ffd7220e9ef22ba08d53332deba21aba52 Mon Sep 17 00:00:00 2001 From: Matt Benson Date: Tue, 1 Oct 2024 16:25:02 -0500 Subject: [PATCH] code review: don't pass entire context to file action computation Signed-off-by: Matt Benson --- .../src/actions/gitlabMergeRequest.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts index 3ef66f5f6f..7374aa2648 100644 --- a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts +++ b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts @@ -40,7 +40,7 @@ async function getFileAction( fileInfo: { file: SerializedFile; targetPath?: string }, target: { repoID: string; branch: string }, api: Gitlab, - ctx: { logger: Logger }, + logger: Logger, remoteFiles: Types.RepositoryTreeSchema[], defaultCommitAction: | 'create' @@ -63,7 +63,7 @@ async function getFileAction( return 'skip'; } } catch (error) { - ctx.logger.warn( + logger.warn( `Unable to retrieve detailed information for remote file ${filePath}`, ); } @@ -285,7 +285,7 @@ which uses additional API calls in order to detect whether to 'create', 'update' { file, targetPath }, { repoID, branch: targetBranch! }, api, - ctx, + ctx.logger, remoteFiles, ctx.input.commitAction, );