From b9f18cddf7d3262d0b6f9bd8838ceac793125f01 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sat, 2 Aug 2025 21:24:33 -0600 Subject: [PATCH] refactor(gitlab): reorder token refresh and provider fetching for improved clarity --- packages/server/src/utils/providers/gitlab.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/utils/providers/gitlab.ts b/packages/server/src/utils/providers/gitlab.ts index 65a09d248..f68bd3be7 100644 --- a/packages/server/src/utils/providers/gitlab.ts +++ b/packages/server/src/utils/providers/gitlab.ts @@ -371,9 +371,9 @@ export const cloneRawGitlabRepository = async (entity: Compose) => { }); } - const gitlabProvider = await findGitlabById(gitlabId); const { COMPOSE_PATH } = paths(); await refreshGitlabToken(gitlabId); + const gitlabProvider = await findGitlabById(gitlabId); const basePath = COMPOSE_PATH; const outputPath = join(basePath, appName, "code"); await recreateDirectory(outputPath); @@ -419,9 +419,9 @@ export const cloneRawGitlabRepositoryRemote = async (compose: Compose) => { message: "Gitlab Provider not found", }); } - const gitlabProvider = await findGitlabById(gitlabId); const { COMPOSE_PATH } = paths(true); await refreshGitlabToken(gitlabId); + const gitlabProvider = await findGitlabById(gitlabId); const basePath = COMPOSE_PATH; const outputPath = join(basePath, appName, "code"); const repoClone = getGitlabRepoClone(gitlabProvider, gitlabPathNamespace);