Skip to content

Commit b7705b3

Browse files
committed
refactor(core,ci): update to latest portal-client version
1 parent d32a643 commit b7705b3

File tree

13 files changed

+36
-38
lines changed

13 files changed

+36
-38
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"node": ">=22.14"
2323
},
2424
"dependencies": {
25-
"@code-pushup/portal-client": "^0.14.3",
25+
"@code-pushup/portal-client": "^0.15.0",
2626
"@isaacs/cliui": "^8.0.2",
2727
"@nx/devkit": "19.8.13",
2828
"@poppinss/cliui": "6.4.1",

packages/ci/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"type": "module",
2828
"dependencies": {
2929
"@code-pushup/models": "0.72.1",
30-
"@code-pushup/portal-client": "^0.14.3",
30+
"@code-pushup/portal-client": "^0.15.0",
3131
"@code-pushup/utils": "0.72.1",
3232
"glob": "^11.0.1",
3333
"simple-git": "^3.20.0",

packages/ci/src/lib/portal/download.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { mkdir, writeFile } from 'node:fs/promises';
22
import path from 'node:path';
33
import {
4-
type PortalDownloadArgs,
5-
downloadFromPortal,
4+
type PortalReportDownloadArgs,
5+
downloadReportFromPortal,
66
} from '@code-pushup/portal-client';
77
import { transformGQLReport } from './transform.js';
88

9-
export async function downloadReportFromPortal(
10-
args: PortalDownloadArgs,
9+
export async function downloadFromPortal(
10+
args: PortalReportDownloadArgs,
1111
): Promise<string | null> {
12-
const gqlReport = await downloadFromPortal(args);
12+
const gqlReport = await downloadReportFromPortal(args);
1313
if (!gqlReport) {
1414
return null;
1515
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { downloadReportFromPortal } from './download.js';
1+
export { downloadFromPortal } from './download.js';

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import type {
4343
} from './models.js';
4444
import type { ProjectConfig } from './monorepo/index.js';
4545
import { saveOutputFiles } from './output-files.js';
46-
import { downloadReportFromPortal } from './portal/download.js';
46+
import { downloadFromPortal } from './portal/download.js';
4747

4848
export type RunEnv = {
4949
refs: NormalizedGitRefs;
@@ -376,14 +376,14 @@ async function loadCachedBaseReportFromPortal(
376376
return null;
377377
}
378378

379-
const reportPath = await downloadReportFromPortal({
379+
const reportPath = await downloadFromPortal({
380380
server: config.upload.server,
381381
apiKey: config.upload.apiKey,
382382
parameters: {
383383
organization: config.upload.organization,
384384
project: config.upload.project,
385385
commit: base.sha,
386-
withDetails: true,
386+
withAuditDetails: true,
387387
},
388388
}).catch((error: unknown) => {
389389
logger.warn(

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { type SimpleGit, simpleGit } from 'simple-git';
1212
import { type MockInstance, expect } from 'vitest';
1313
import {
1414
type ReportFragment,
15-
downloadFromPortal,
15+
downloadReportFromPortal,
1616
} from '@code-pushup/portal-client';
1717
import {
1818
type CoreConfig,
@@ -43,7 +43,7 @@ vi.mock('@code-pushup/portal-client', async importOriginal => {
4343
await importOriginal();
4444
return {
4545
...mod,
46-
downloadFromPortal: vi.fn(simulateDownloadFromPortal),
46+
downloadReportFromPortal: vi.fn(simulateDownloadReportFromPortal),
4747
};
4848
});
4949

@@ -84,7 +84,7 @@ const fixturePaths = {
8484
},
8585
};
8686

87-
function simulateDownloadFromPortal() {
87+
function simulateDownloadReportFromPortal() {
8888
return utils.readJsonFile<ReportFragment>(fixturePaths.reports.before.portal);
8989
}
9090

@@ -500,16 +500,16 @@ describe('runInCI', () => {
500500
},
501501
} satisfies RunResult);
502502

503-
expect(downloadFromPortal).toHaveBeenCalledWith<
504-
Parameters<typeof downloadFromPortal>
503+
expect(downloadReportFromPortal).toHaveBeenCalledWith<
504+
Parameters<typeof downloadReportFromPortal>
505505
>({
506506
server: 'https://api.code-pushup.dunder-mifflin.org/graphql',
507507
apiKey: 'cp_abcdef0123456789',
508508
parameters: {
509509
organization: 'dunder-mifflin',
510510
project: 'website',
511511
commit: refs.base.sha,
512-
withDetails: true,
512+
withAuditDetails: true,
513513
},
514514
});
515515

packages/cli/src/lib/autorun/autorun-command.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { vol } from 'memfs';
22
import { describe, expect, it, vi } from 'vitest';
3-
import { uploadToPortal } from '@code-pushup/portal-client';
3+
import { uploadReportToPortal } from '@code-pushup/portal-client';
44
import { collectAndPersistReports, readRcByPath } from '@code-pushup/core';
55
import { MEMFS_VOLUME, MINIMAL_REPORT_MOCK } from '@code-pushup/test-utils';
66
import { DEFAULT_CLI_CONFIGURATION } from '../../../mocks/constants.js';
@@ -58,8 +58,8 @@ describe('autorun-command', () => {
5858
);
5959

6060
// values come from CORE_CONFIG_MOCK returned by readRcByPath mock
61-
expect(uploadToPortal).toHaveBeenCalledWith<
62-
Parameters<typeof uploadToPortal>
61+
expect(uploadReportToPortal).toHaveBeenCalledWith<
62+
Parameters<typeof uploadReportToPortal>
6363
>({
6464
apiKey: 'dummy-api-key',
6565
server: 'https://example.com/api',

packages/cli/src/lib/upload/upload-command.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { vol } from 'memfs';
22
import { describe, expect, it } from 'vitest';
3-
import { uploadToPortal } from '@code-pushup/portal-client';
3+
import { uploadReportToPortal } from '@code-pushup/portal-client';
44
import { readRcByPath } from '@code-pushup/core';
55
import {
66
ISO_STRING_REGEXP,
@@ -52,8 +52,8 @@ describe('upload-command-object', () => {
5252
);
5353

5454
// values come from CORE_CONFIG_MOCK returned by readRcByPath mock
55-
expect(uploadToPortal).toHaveBeenCalledWith<
56-
Parameters<typeof uploadToPortal>
55+
expect(uploadReportToPortal).toHaveBeenCalledWith<
56+
Parameters<typeof uploadReportToPortal>
5757
>({
5858
apiKey: 'dummy-api-key',
5959
server: 'https://example.com/api',

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"ansis": "^3.3.0"
4545
},
4646
"peerDependencies": {
47-
"@code-pushup/portal-client": "^0.14.3"
47+
"@code-pushup/portal-client": "^0.15.0"
4848
},
4949
"peerDependenciesMeta": {
5050
"@code-pushup/portal-client": {

0 commit comments

Comments
 (0)