From 4700d7bad2868dfa8fd4f07cc8fff7db6dda489a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allen=20Zhang=20=28=E5=BC=A0=E6=B6=9B=29?= Date: Tue, 16 Jan 2024 18:48:57 +0800 Subject: [PATCH] upd --- .../src/adapter/gitlab.adapter.ts | 25 +++++++++++-------- .../services/get-project-records.service.ts | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/canyon-backend/src/adapter/gitlab.adapter.ts b/packages/canyon-backend/src/adapter/gitlab.adapter.ts index ac2a50ae..2b90c926 100755 --- a/packages/canyon-backend/src/adapter/gitlab.adapter.ts +++ b/packages/canyon-backend/src/adapter/gitlab.adapter.ts @@ -149,24 +149,27 @@ export const getFileInfo = async ( ) .then(({ data }) => data); }; - +// console.log(process.env.PRIVATE_TOKEN) export const getCommits = async ( { projectID, commitShas }: { projectID: string; commitShas: string[] }, token: string, ) => { return await Promise.all( commitShas.map((commitSha) => - axios - .get( - `${GITLAB_URL}/api/v4/projects/${projectID}/repository/commits/${commitSha}`, - { - headers: { - // Authorization: `Bearer ${token}`, - 'private-token': process.env.PRIVATE_TOKEN, + { + console.log(commitSha) + return axios + .get( + `${GITLAB_URL}/api/v4/projects/${projectID}/repository/commits/${commitSha}`, + { + headers: { + // Authorization: `Bearer ${token}`, + 'private-token': process.env.PRIVATE_TOKEN, + }, }, - }, - ) - .then(({ data }) => data), + ) + .then(({ data }) => data) + }, ), ); }; diff --git a/packages/canyon-backend/src/project/services/get-project-records.service.ts b/packages/canyon-backend/src/project/services/get-project-records.service.ts index 12f277b7..251cea17 100644 --- a/packages/canyon-backend/src/project/services/get-project-records.service.ts +++ b/packages/canyon-backend/src/project/services/get-project-records.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { PrismaService } from '../../prisma/prisma.service'; import { calculateCoverageOverviewByConditionFilter } from '../../utils/summary'; -import process from 'process'; +// import process from 'process'; import { getCommits } from '../../adapter/gitlab.adapter'; // import { getProjectByID } from '../adapter/gitlab.adapter'; @Injectable()