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:
20
action.yml
20
action.yml
@@ -111,6 +111,12 @@ runs:
|
||||
ANTHROPIC_API_KEY: ${{ inputs.anthropic_api_key != 'use-oauth' && inputs.anthropic_api_key || '' }}
|
||||
CLAUDE_CREDENTIALS: ${{ inputs.claude_credentials }}
|
||||
|
||||
- name: Log before Claude Code
|
||||
if: steps.prepare.outputs.contains_trigger == 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
echo "[$(date -u +%Y-%m-%dT%H:%M:%S.%3NZ)] Starting Claude Code base action..."
|
||||
|
||||
- name: Run Claude Code
|
||||
id: claude-code
|
||||
if: steps.prepare.outputs.contains_trigger == 'true'
|
||||
@@ -165,6 +171,13 @@ runs:
|
||||
VERTEX_REGION_CLAUDE_3_5_SONNET: ${{ env.VERTEX_REGION_CLAUDE_3_5_SONNET }}
|
||||
VERTEX_REGION_CLAUDE_3_7_SONNET: ${{ env.VERTEX_REGION_CLAUDE_3_7_SONNET }}
|
||||
|
||||
- name: Log after Claude Code
|
||||
if: steps.prepare.outputs.contains_trigger == 'true' && always()
|
||||
shell: bash
|
||||
run: |
|
||||
echo "[$(date -u +%Y-%m-%dT%H:%M:%S.%3NZ)] Claude Code base action completed with status: ${{ steps.claude-code.outcome }}"
|
||||
echo "[$(date -u +%Y-%m-%dT%H:%M:%S.%3NZ)] Starting comment update..."
|
||||
|
||||
- name: Update comment with job link
|
||||
if: steps.prepare.outputs.contains_trigger == 'true' && steps.prepare.outputs.claude_comment_id && always()
|
||||
shell: bash
|
||||
@@ -200,3 +213,10 @@ runs:
|
||||
else
|
||||
echo "⚠️ Claude Code execution completed but no report file was generated" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
- name: Log action completion
|
||||
if: always()
|
||||
shell: bash
|
||||
run: |
|
||||
echo "[$(date -u +%Y-%m-%dT%H:%M:%S.%3NZ)] Claude Code Action composite steps completed"
|
||||
echo "[$(date -u +%Y-%m-%dT%H:%M:%S.%3NZ)] Waiting for job cleanup..."
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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()...`);
|
||||
|
||||
@@ -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()...`);
|
||||
|
||||
Reference in New Issue
Block a user