Skip to content

Commit b952966

Browse files
committed
Merge remote-tracking branch 'origin/main' into cp-targets
2 parents ab75868 + d32a643 commit b952966

42 files changed

Lines changed: 557 additions & 305 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ testem.log
4444
Thumbs.db
4545

4646
# generated Code PushUp reports
47-
**/.code-pushup
47+
/.code-pushup
4848

4949
# Nx workspace cache
5050
.nx

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
## 0.72.1 (2025-08-06)
2+
3+
### 🩹 Fixes
4+
5+
- **ci:** download portal report for base commit and include details ([21572d52](https://github.com/code-pushup/cli/commit/21572d52))
6+
7+
### ❤️ Thank You
8+
9+
- Matěj Chalk
10+
11+
## 0.72.0 (2025-08-06)
12+
13+
### 🚀 Features
14+
15+
- **ci:** add configPatterns as optional performance optimization ([823ade1f](https://github.com/code-pushup/cli/commit/823ade1f))
16+
- **cli:** use default report paths if --before/--after missing in compare command ([61ee2272](https://github.com/code-pushup/cli/commit/61ee2272))
17+
- **core:** copy label from report.json inputs to report-diff.json output ([2adcf9db](https://github.com/code-pushup/cli/commit/2adcf9db))
18+
- **models:** add optional label to report.json schema ([77d33b54](https://github.com/code-pushup/cli/commit/77d33b54))
19+
- **utils:** interpolate variables in strings ([242435e0](https://github.com/code-pushup/cli/commit/242435e0))
20+
21+
### 🔥 Performance
22+
23+
- **ci:** use bulk command to compare reports for all projects ([f9deac78](https://github.com/code-pushup/cli/commit/f9deac78))
24+
25+
### ❤️ Thank You
26+
27+
- Matěj Chalk
28+
129
## 0.71.0 (2025-08-01)
230

331
### 🚀 Features

e2e/cli-e2e/mocks/fixtures/existing-reports/.code-pushup/target-report.json renamed to e2e/cli-e2e/mocks/fixtures/existing-reports/.code-pushup/report-after.json

File renamed without changes.

e2e/cli-e2e/mocks/fixtures/existing-reports/.code-pushup/target-report.md renamed to e2e/cli-e2e/mocks/fixtures/existing-reports/.code-pushup/report-after.md

File renamed without changes.

e2e/cli-e2e/mocks/fixtures/existing-reports/.code-pushup/source-report.json renamed to e2e/cli-e2e/mocks/fixtures/existing-reports/.code-pushup/report-before.json

File renamed without changes.

e2e/cli-e2e/mocks/fixtures/existing-reports/.code-pushup/source-report.md renamed to e2e/cli-e2e/mocks/fixtures/existing-reports/.code-pushup/report-before.md

File renamed without changes.

e2e/cli-e2e/tests/compare.e2e.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ describe('CLI compare', () => {
3939
it('should compare report.json files and create report-diff.json and report-diff.md', async () => {
4040
await executeProcess({
4141
command: 'npx',
42-
args: [
43-
'@code-pushup/cli',
44-
'compare',
45-
`--before=${path.join('.code-pushup', 'source-report.json')}`,
46-
`--after=${path.join('.code-pushup', 'target-report.json')}`,
47-
],
42+
args: ['@code-pushup/cli', 'compare'],
4843
cwd: existingDir,
4944
});
5045

packages/ci/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@code-pushup/ci",
3-
"version": "0.71.0",
3+
"version": "0.72.1",
44
"description": "CI automation logic for Code PushUp (provider-agnostic)",
55
"license": "MIT",
66
"homepage": "https://github.com/code-pushup/cli/tree/main/packages/ci#readme",
@@ -26,9 +26,9 @@
2626
},
2727
"type": "module",
2828
"dependencies": {
29-
"@code-pushup/models": "0.71.0",
29+
"@code-pushup/models": "0.72.1",
3030
"@code-pushup/portal-client": "^0.14.3",
31-
"@code-pushup/utils": "0.71.0",
31+
"@code-pushup/utils": "0.72.1",
3232
"glob": "^11.0.1",
3333
"simple-git": "^3.20.0",
3434
"yaml": "^2.5.1",

packages/ci/src/lib/cli/commands/compare.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,19 @@ import { DEFAULT_PERSIST_FORMAT } from '@code-pushup/models';
22
import { executeProcess, isVerbose } from '@code-pushup/utils';
33
import type { CommandContext } from '../context.js';
44

5-
type CompareOptions = {
6-
before: string;
7-
after: string;
8-
label?: string;
9-
};
10-
115
export async function runCompare(
12-
{ before, after, label }: CompareOptions,
136
{ bin, config, directory, observer }: CommandContext,
7+
{ hasFormats }: { hasFormats: boolean },
148
): Promise<void> {
159
await executeProcess({
1610
command: bin,
1711
args: [
1812
'compare',
1913
...(isVerbose() ? ['--verbose'] : []),
20-
`--before=${before}`,
21-
`--after=${after}`,
22-
...(label ? [`--label=${label}`] : []),
2314
...(config ? [`--config=${config}`] : []),
24-
...DEFAULT_PERSIST_FORMAT.map(format => `--persist.format=${format}`),
15+
...(hasFormats
16+
? []
17+
: DEFAULT_PERSIST_FORMAT.map(format => `--persist.format=${format}`)),
2518
],
2619
cwd: directory,
2720
observer,

packages/ci/src/lib/cli/persist.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
persistConfigSchema,
1010
uploadConfigSchema,
1111
} from '@code-pushup/models';
12-
import { objectFromEntries } from '@code-pushup/utils';
12+
import { createReportPath, objectFromEntries } from '@code-pushup/utils';
1313

1414
export type EnhancedPersistConfig = Pick<CoreConfig, 'persist' | 'upload'>;
1515

@@ -27,12 +27,12 @@ export function persistedFilesFromConfig(
2727
const dir = path.isAbsolute(outputDir)
2828
? outputDir
2929
: path.join(directory, outputDir);
30-
const name = isDiff ? `${filename}-diff` : filename;
30+
const suffix = isDiff ? 'diff' : undefined;
3131

3232
return objectFromEntries(
3333
DEFAULT_PERSIST_FORMAT.map(format => [
3434
format,
35-
path.join(dir, `${name}.${format}`),
35+
createReportPath({ outputDir: dir, filename, format, suffix }),
3636
]),
3737
);
3838
}

0 commit comments

Comments
 (0)