(params: {
runtime: ToolConfiguration["runtime"];
repoCwd: string;
remotePatchPath: string;
taskId: string;
workspaceId: string;
})
| 1485 | } |
| 1486 | |
| 1487 | async function cleanupRuntimePatchFile(params: { |
| 1488 | runtime: ToolConfiguration["runtime"]; |
| 1489 | repoCwd: string; |
| 1490 | remotePatchPath: string; |
| 1491 | taskId: string; |
| 1492 | workspaceId: string; |
| 1493 | }): Promise<void> { |
| 1494 | try { |
| 1495 | const result = await execBuffered( |
| 1496 | params.runtime, |
| 1497 | `rm -f ${shellQuote(params.remotePatchPath)}`, |
| 1498 | { |
| 1499 | cwd: params.repoCwd, |
| 1500 | timeout: 30, |
| 1501 | } |
| 1502 | ); |
| 1503 | if (result.exitCode !== 0) { |
| 1504 | log.debug("task_apply_git_patch: patch file cleanup failed", { |
| 1505 | taskId: params.taskId, |
| 1506 | workspaceId: params.workspaceId, |
| 1507 | remotePatchPath: params.remotePatchPath, |
| 1508 | exitCode: result.exitCode, |
| 1509 | stderr: result.stderr.trim(), |
| 1510 | stdout: result.stdout.trim(), |
| 1511 | }); |
| 1512 | } |
| 1513 | } catch (error: unknown) { |
| 1514 | log.debug("task_apply_git_patch: patch file cleanup threw", { |
| 1515 | taskId: params.taskId, |
| 1516 | workspaceId: params.workspaceId, |
| 1517 | remotePatchPath: params.remotePatchPath, |
| 1518 | error, |
| 1519 | }); |
| 1520 | } |
| 1521 | } |
| 1522 | |
| 1523 | export async function applyTaskGitPatchArtifact( |
| 1524 | config: TaskApplyGitPatchConfiguration, |
no test coverage detected