@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/index.js
CHANGED
|
@@ -164,6 +164,8 @@ var GitHubClient = class {
|
|
|
164
164
|
this.retryDelay = 1e3;
|
|
165
165
|
this.owner = options.owner;
|
|
166
166
|
this.repo = options.repo;
|
|
167
|
+
const originalConsoleError = console.error;
|
|
168
|
+
const originalConsoleWarn = console.warn;
|
|
167
169
|
this.octokit = new Octokit({
|
|
168
170
|
auth: options.token,
|
|
169
171
|
request: {
|
|
@@ -171,6 +173,8 @@ var GitHubClient = class {
|
|
|
171
173
|
retryAfter: this.retryDelay / 1e3
|
|
172
174
|
}
|
|
173
175
|
});
|
|
176
|
+
console.error = originalConsoleError;
|
|
177
|
+
console.warn = originalConsoleWarn;
|
|
174
178
|
}
|
|
175
179
|
/**
|
|
176
180
|
* Retry wrapper with exponential backoff
|
|
@@ -369,7 +373,23 @@ var GitHubClient = class {
|
|
|
369
373
|
* Check if a file exists in the repository
|
|
370
374
|
*/
|
|
371
375
|
async fileExists(ref, path) {
|
|
376
|
+
const originalError = console.error;
|
|
377
|
+
const originalWarn = console.warn;
|
|
378
|
+
const suppressedError = (...args) => {
|
|
379
|
+
const message = args.join(" ");
|
|
380
|
+
if (!message.includes("404") && !message.includes("Not Found")) {
|
|
381
|
+
originalError(...args);
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
const suppressedWarn = (...args) => {
|
|
385
|
+
const message = args.join(" ");
|
|
386
|
+
if (!message.includes("404") && !message.includes("Not Found")) {
|
|
387
|
+
originalWarn(...args);
|
|
388
|
+
}
|
|
389
|
+
};
|
|
372
390
|
try {
|
|
391
|
+
console.error = suppressedError;
|
|
392
|
+
console.warn = suppressedWarn;
|
|
373
393
|
await this.octokit.rest.repos.getContent({
|
|
374
394
|
owner: this.owner,
|
|
375
395
|
repo: this.repo,
|
|
@@ -389,6 +409,9 @@ var GitHubClient = class {
|
|
|
389
409
|
}
|
|
390
410
|
}
|
|
391
411
|
throw err;
|
|
412
|
+
} finally {
|
|
413
|
+
console.error = originalError;
|
|
414
|
+
console.warn = originalWarn;
|
|
392
415
|
}
|
|
393
416
|
}
|
|
394
417
|
/**
|
|
@@ -1916,21 +1939,31 @@ async function runPullRequest(context) {
|
|
|
1916
1939
|
if (testFiles.size > 0) {
|
|
1917
1940
|
const testRunner = createTestRunner(framework);
|
|
1918
1941
|
const writtenPaths = Array.from(testFiles.keys());
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1942
|
+
try {
|
|
1943
|
+
info("Running tests with coverage...");
|
|
1944
|
+
const finalTestResults = await testRunner.runTests({
|
|
1945
|
+
testFiles: writtenPaths,
|
|
1946
|
+
framework,
|
|
1947
|
+
packageManager,
|
|
1948
|
+
projectRoot,
|
|
1949
|
+
coverage: true
|
|
1950
|
+
});
|
|
1951
|
+
const coverageReport = readCoverageReport(projectRoot, framework);
|
|
1952
|
+
if (coverageReport) {
|
|
1953
|
+
info(`Coverage collected: ${coverageReport.total.lines.percentage.toFixed(1)}% lines`);
|
|
1954
|
+
summary.coverageReport = coverageReport;
|
|
1955
|
+
summary.testResults = finalTestResults;
|
|
1956
|
+
} else {
|
|
1957
|
+
warn("Could not read coverage report");
|
|
1958
|
+
}
|
|
1959
|
+
} catch (err) {
|
|
1960
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
1961
|
+
if (errorMessage.includes("coverage") || errorMessage.includes("MISSING DEPENDENCY")) {
|
|
1962
|
+
warn(`Coverage collection failed (likely missing coverage package): ${errorMessage}`);
|
|
1963
|
+
warn("Continuing without coverage report");
|
|
1964
|
+
} else {
|
|
1965
|
+
throw err;
|
|
1966
|
+
}
|
|
1934
1967
|
}
|
|
1935
1968
|
}
|
|
1936
1969
|
if (config.enableAutoCommit && testFiles.size > 0) {
|