@kakarot-ci/core 0.6.4 → 0.6.5
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/cli/index.js +48 -15
- package/dist/cli/index.js.map +2 -2
- package/dist/index.cjs +48 -15
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +48 -15
- package/dist/index.js.map +2 -2
- package/dist/src/core/orchestrator.d.ts.map +1 -1
- package/dist/src/github/client.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -69,6 +69,8 @@ var GitHubClient = class {
|
|
|
69
69
|
this.retryDelay = 1e3;
|
|
70
70
|
this.owner = options.owner;
|
|
71
71
|
this.repo = options.repo;
|
|
72
|
+
const originalConsoleError = console.error;
|
|
73
|
+
const originalConsoleWarn = console.warn;
|
|
72
74
|
this.octokit = new Octokit({
|
|
73
75
|
auth: options.token,
|
|
74
76
|
request: {
|
|
@@ -76,6 +78,8 @@ var GitHubClient = class {
|
|
|
76
78
|
retryAfter: this.retryDelay / 1e3
|
|
77
79
|
}
|
|
78
80
|
});
|
|
81
|
+
console.error = originalConsoleError;
|
|
82
|
+
console.warn = originalConsoleWarn;
|
|
79
83
|
}
|
|
80
84
|
/**
|
|
81
85
|
* Retry wrapper with exponential backoff
|
|
@@ -274,7 +278,23 @@ var GitHubClient = class {
|
|
|
274
278
|
* Check if a file exists in the repository
|
|
275
279
|
*/
|
|
276
280
|
async fileExists(ref, path) {
|
|
281
|
+
const originalError = console.error;
|
|
282
|
+
const originalWarn = console.warn;
|
|
283
|
+
const suppressedError = (...args) => {
|
|
284
|
+
const message = args.join(" ");
|
|
285
|
+
if (!message.includes("404") && !message.includes("Not Found")) {
|
|
286
|
+
originalError(...args);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
const suppressedWarn = (...args) => {
|
|
290
|
+
const message = args.join(" ");
|
|
291
|
+
if (!message.includes("404") && !message.includes("Not Found")) {
|
|
292
|
+
originalWarn(...args);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
277
295
|
try {
|
|
296
|
+
console.error = suppressedError;
|
|
297
|
+
console.warn = suppressedWarn;
|
|
278
298
|
await this.octokit.rest.repos.getContent({
|
|
279
299
|
owner: this.owner,
|
|
280
300
|
repo: this.repo,
|
|
@@ -294,6 +314,9 @@ var GitHubClient = class {
|
|
|
294
314
|
}
|
|
295
315
|
}
|
|
296
316
|
throw err;
|
|
317
|
+
} finally {
|
|
318
|
+
console.error = originalError;
|
|
319
|
+
console.warn = originalWarn;
|
|
297
320
|
}
|
|
298
321
|
}
|
|
299
322
|
/**
|
|
@@ -1926,21 +1949,31 @@ async function runPullRequest(context) {
|
|
|
1926
1949
|
if (testFiles.size > 0) {
|
|
1927
1950
|
const testRunner = createTestRunner(framework);
|
|
1928
1951
|
const writtenPaths = Array.from(testFiles.keys());
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1952
|
+
try {
|
|
1953
|
+
info("Running tests with coverage...");
|
|
1954
|
+
const finalTestResults = await testRunner.runTests({
|
|
1955
|
+
testFiles: writtenPaths,
|
|
1956
|
+
framework,
|
|
1957
|
+
packageManager,
|
|
1958
|
+
projectRoot,
|
|
1959
|
+
coverage: true
|
|
1960
|
+
});
|
|
1961
|
+
const coverageReport = readCoverageReport(projectRoot, framework);
|
|
1962
|
+
if (coverageReport) {
|
|
1963
|
+
info(`Coverage collected: ${coverageReport.total.lines.percentage.toFixed(1)}% lines`);
|
|
1964
|
+
summary.coverageReport = coverageReport;
|
|
1965
|
+
summary.testResults = finalTestResults;
|
|
1966
|
+
} else {
|
|
1967
|
+
warn("Could not read coverage report");
|
|
1968
|
+
}
|
|
1969
|
+
} catch (err) {
|
|
1970
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1971
|
+
if (errorMessage.includes("coverage") || errorMessage.includes("MISSING DEPENDENCY")) {
|
|
1972
|
+
warn(`Coverage collection failed (likely missing coverage package): ${errorMessage}`);
|
|
1973
|
+
warn("Continuing without coverage report");
|
|
1974
|
+
} else {
|
|
1975
|
+
throw err;
|
|
1976
|
+
}
|
|
1944
1977
|
}
|
|
1945
1978
|
}
|
|
1946
1979
|
if (config.enableAutoCommit && testFiles.size > 0) {
|