Skip to content

Commit

Permalink
feat: add project path
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Zhang committed Dec 27, 2023
1 parent f249c50 commit bc8b2a9
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,25 @@ export class RetrieveCoverageTreeSummaryService {
});

const commitSha = summaryFindFirst?.commitSha;

const noCommitShaWithCoverage = await this.prisma.coverage.findFirst({
where: removeNullKeys({
reportID: params.reportID,
commitSha: params.sha,
}),
});
const project = await this.prisma.project.findFirst({
where: {
id: noCommitShaWithCoverage.projectID,
},
});
if (!commitSha) {
const noCommitShaWithCoverage = await this.prisma.coverage.findFirst({
where: removeNullKeys({
reportID: params.reportID,
commitSha: params.sha,
}),
});
return {
status: 'pending',
reportIDs: [],
sha: noCommitShaWithCoverage?.commitSha || '',
statistics: emptyStatistics,
projectID: noCommitShaWithCoverage?.projectID || '',
projectPathWithNamespace: project?.pathWithNamespace || '',
};
}

Expand Down Expand Up @@ -79,6 +84,7 @@ export class RetrieveCoverageTreeSummaryService {
sha: commitSha,
statistics: calculateCoverageOverviewByConditionFilter(summarys),
projectID: coverage.projectID,
projectPathWithNamespace: project.pathWithNamespace,
};
}
}

0 comments on commit bc8b2a9

Please sign in to comment.