Add comprehensive logging to debug slow job completion

- Add timestamps to prepare.ts completion
- Add timestamps and signal handlers to both MCP servers
- Add start/end logging to update-comment-link.ts
- Add final action completion logging step
- Log when composite action steps complete vs job cleanup
This commit is contained in:
claude
2025-07-29 22:41:27 +00:00
parent b570f2eb8e
commit 308512548e
5 changed files with 52 additions and 4 deletions

View File

@@ -121,11 +121,14 @@ async function run() {
branchInfo.currentBranch,
);
core.setOutput("mcp_config", mcpConfig);
console.log(`[${new Date().toISOString()}] Prepare step completed successfully`);
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error);
core.setFailed(`Prepare step failed with error: ${errorMessage}`);
// Also output the clean error message for the action to capture
core.setOutput("prepare_error", errorMessage);
console.log(`[${new Date().toISOString()}] Prepare step failed with error: ${errorMessage}`);
process.exit(1);
}
}

View File

@@ -358,11 +358,14 @@ async function run() {
throw updateError;
}
console.log(`[${new Date().toISOString()}] Update comment completed successfully`);
process.exit(0);
} catch (error) {
console.error("Error updating comment with job link:", error);
console.log(`[${new Date().toISOString()}] Update comment failed`);
process.exit(1);
}
}
console.log(`[${new Date().toISOString()}] Starting update-comment-link.ts`);
run();

View File

@@ -12,7 +12,7 @@ const BRANCH_NAME = process.env.BRANCH_NAME;
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
const GITEA_API_URL = process.env.GITEA_API_URL || "https://api.github.com";
console.log(`[GITEA-MCP] Starting Gitea API Operations MCP Server`);
console.log(`[GITEA-MCP ${new Date().toISOString()}] Starting Gitea API Operations MCP Server`);
console.log(`[GITEA-MCP] REPO_OWNER: ${REPO_OWNER}`);
console.log(`[GITEA-MCP] REPO_NAME: ${REPO_NAME}`);
console.log(`[GITEA-MCP] BRANCH_NAME: ${BRANCH_NAME}`);
@@ -1268,9 +1268,20 @@ async function runServer() {
await server.connect(transport);
console.log(`[GITEA-MCP] Gitea MCP server connected and ready!`);
process.on("exit", () => {
console.log(`[GITEA-MCP] Server shutting down...`);
console.log(`[GITEA-MCP ${new Date().toISOString()}] Server shutting down...`);
server.close();
});
// Add more signal handlers for debugging
process.on("SIGTERM", () => {
console.log(`[GITEA-MCP ${new Date().toISOString()}] Received SIGTERM signal`);
process.exit(0);
});
process.on("SIGINT", () => {
console.log(`[GITEA-MCP ${new Date().toISOString()}] Received SIGINT signal`);
process.exit(0);
});
}
console.log(`[GITEA-MCP] Calling runServer()...`);

View File

@@ -15,7 +15,7 @@ const REPO_DIR = process.env.REPO_DIR || process.cwd();
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
const GITEA_API_URL = process.env.GITEA_API_URL || "https://api.github.com";
console.log(`[LOCAL-GIT-MCP] Starting Local Git Operations MCP Server`);
console.log(`[LOCAL-GIT-MCP ${new Date().toISOString()}] Starting Local Git Operations MCP Server`);
console.log(`[LOCAL-GIT-MCP] REPO_OWNER: ${REPO_OWNER}`);
console.log(`[LOCAL-GIT-MCP] REPO_NAME: ${REPO_NAME}`);
console.log(`[LOCAL-GIT-MCP] BRANCH_NAME: ${BRANCH_NAME}`);
@@ -497,9 +497,20 @@ async function runServer() {
await server.connect(transport);
console.log(`[LOCAL-GIT-MCP] MCP server connected and ready!`);
process.on("exit", () => {
console.log(`[LOCAL-GIT-MCP] Server shutting down...`);
console.log(`[LOCAL-GIT-MCP ${new Date().toISOString()}] Server shutting down...`);
server.close();
});
// Add more signal handlers for debugging
process.on("SIGTERM", () => {
console.log(`[LOCAL-GIT-MCP ${new Date().toISOString()}] Received SIGTERM signal`);
process.exit(0);
});
process.on("SIGINT", () => {
console.log(`[LOCAL-GIT-MCP ${new Date().toISOString()}] Received SIGINT signal`);
process.exit(0);
});
}
console.log(`[LOCAL-GIT-MCP] Calling runServer()...`);