Skip to content

Commit 21572d5

Browse files
committed
fix(ci): download portal report for base commit and include details
1 parent 7fb18f6 commit 21572d5

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/ci/src/lib/run-utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ async function loadCachedBaseReportFromPortal(
368368
const {
369369
config,
370370
env: { settings },
371+
base,
371372
} = args;
372373
const { logger } = settings;
373374

@@ -381,6 +382,8 @@ async function loadCachedBaseReportFromPortal(
381382
parameters: {
382383
organization: config.upload.organization,
383384
project: config.upload.project,
385+
commit: base.sha,
386+
withDetails: true,
384387
},
385388
}).catch((error: unknown) => {
386389
logger.warn(

packages/ci/src/lib/run.int.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
import * as utils from '@code-pushup/utils';
2929
import type {
3030
Comment,
31+
GitBranch,
3132
GitRefs,
3233
Logger,
3334
Options,
@@ -309,7 +310,7 @@ describe('runInCI', () => {
309310
});
310311

311312
describe('pull request event', () => {
312-
let refs: GitRefs;
313+
let refs: { head: GitBranch; base: GitBranch };
313314
let diffMdString: string;
314315

315316
beforeEach(async () => {
@@ -499,12 +500,16 @@ describe('runInCI', () => {
499500
},
500501
} satisfies RunResult);
501502

502-
expect(downloadFromPortal).toHaveBeenCalledWith({
503+
expect(downloadFromPortal).toHaveBeenCalledWith<
504+
Parameters<typeof downloadFromPortal>
505+
>({
503506
server: 'https://api.code-pushup.dunder-mifflin.org/graphql',
504507
apiKey: 'cp_abcdef0123456789',
505508
parameters: {
506509
organization: 'dunder-mifflin',
507510
project: 'website',
511+
commit: refs.base.sha,
512+
withDetails: true,
508513
},
509514
});
510515

0 commit comments

Comments
 (0)