@wix/pathgrade 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/commands/report.js
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import * as path from 'path';
|
|
21
21
|
import fs from 'fs-extra';
|
|
22
|
-
import {
|
|
22
|
+
import { readSidecar } from '../affected/sidecar.js';
|
|
23
|
+
import { formatNoAffectedEvalsMarkdown, formatReportMarkdown, MISSING_RESULTS_BODY, postOrUpdateComment, resolvePrContext, } from '../reporters/github-comment.js';
|
|
23
24
|
const DEFAULT_RESULTS_PATH = path.join('.pathgrade', 'results.json');
|
|
24
25
|
/**
|
|
25
26
|
* Resolve the comment-id used for the dedup marker.
|
|
@@ -85,6 +86,23 @@ export async function runReport(cwd, opts = {}) {
|
|
|
85
86
|
loadError = err instanceof Error ? err.message : String(err);
|
|
86
87
|
}
|
|
87
88
|
if (loadError) {
|
|
89
|
+
const selection = await readSidecar(cwd, msg => {
|
|
90
|
+
console.error(`pathgrade report: ${msg}`);
|
|
91
|
+
});
|
|
92
|
+
if (selection && selection.selected.length === 0) {
|
|
93
|
+
const markdown = formatNoAffectedEvalsMarkdown(selection);
|
|
94
|
+
if (prContext) {
|
|
95
|
+
await postOrUpdateComment(prContext, {
|
|
96
|
+
commentId,
|
|
97
|
+
body: markdown,
|
|
98
|
+
});
|
|
99
|
+
console.log('0');
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
printMarkdownAndPassRate(markdown, 0);
|
|
103
|
+
}
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
88
106
|
console.error(`pathgrade report: ${loadError}`);
|
|
89
107
|
if (prContext) {
|
|
90
108
|
await postOrUpdateComment(prContext, {
|
|
@@ -13,6 +13,7 @@ export interface FormatOptions {
|
|
|
13
13
|
}
|
|
14
14
|
/** Minimal body posted when `.pathgrade/results.json` is missing. */
|
|
15
15
|
export declare const MISSING_RESULTS_BODY = "Pathgrade evals did not produce results. Check the workflow logs.";
|
|
16
|
+
export declare function formatNoAffectedEvalsMarkdown(selection: PathgradeSelectionReport): string;
|
|
16
17
|
export declare function commentMarker(commentId: string): string;
|
|
17
18
|
/**
|
|
18
19
|
* Format a pathgrade PR comment as markdown.
|
|
@@ -10,6 +10,21 @@
|
|
|
10
10
|
import * as fs from 'fs';
|
|
11
11
|
/** Minimal body posted when `.pathgrade/results.json` is missing. */
|
|
12
12
|
export const MISSING_RESULTS_BODY = 'Pathgrade evals did not produce results. Check the workflow logs.';
|
|
13
|
+
export function formatNoAffectedEvalsMarkdown(selection) {
|
|
14
|
+
const total = selection.selected.length + selection.skipped.length;
|
|
15
|
+
const lines = [];
|
|
16
|
+
lines.push('### Pathgrade report');
|
|
17
|
+
lines.push('');
|
|
18
|
+
lines.push('No affected evals found for this change set.');
|
|
19
|
+
lines.push('');
|
|
20
|
+
lines.push(`Base: \`${selection.base_ref}\` | Changed files: **${selection.changed_files_count}**`);
|
|
21
|
+
if (total > 0) {
|
|
22
|
+
lines.push('');
|
|
23
|
+
lines.push(formatSelectionSection(selection));
|
|
24
|
+
}
|
|
25
|
+
lines.push('');
|
|
26
|
+
return lines.join('\n');
|
|
27
|
+
}
|
|
13
28
|
export function commentMarker(commentId) {
|
|
14
29
|
return `<!-- pathgrade:${commentId} -->`;
|
|
15
30
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/pathgrade",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Evaluate whether AI agents discover and use your skills correctly",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"typescript": "^5.9.3",
|
|
85
85
|
"zod": "4.3.6"
|
|
86
86
|
},
|
|
87
|
-
"falconPackageHash": "
|
|
87
|
+
"falconPackageHash": "d98d954f1467c94ec73646e4a73cd9096d86991e79e3786c42690dd7"
|
|
88
88
|
}
|