hotfix(ci): clean up ai review reruns and logging

This commit is contained in:
Tam Nhu Tran
2026-04-02 00:31:51 -04:00
parent 5b9427f8a0
commit f47e7ae5a7
3 changed files with 8 additions and 6 deletions
-4
View File
@@ -178,8 +178,6 @@ jobs:
echo "review_mode=$REVIEW_MODE"
echo "review_scope=$REVIEW_SCOPE"
echo "review_mode_reason=$REVIEW_MODE_REASON"
echo "max_turns=$MAX_TURNS"
echo "max_thinking_tokens=$MAX_THINKING_TOKENS"
echo "claude_timeout_minutes=$CLAUDE_TIMEOUT_MINUTES"
echo "runs_on=$RUNS_ON"
} >> "$GITHUB_OUTPUT"
@@ -543,8 +541,6 @@ jobs:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
REVIEW_MARKER: >-
<!-- ccs-ai-review
run:${{ github.run_id }}
attempt:${{ github.run_attempt }}
pr:${{ needs.prepare.outputs.pr_number }}
sha:${{ needs.prepare.outputs.head_sha }} -->
run: |
+2 -2
View File
@@ -271,7 +271,7 @@ export async function writeDirectReviewFromEnv(env = process.env, fetchImpl = gl
attempt === 1
? buildPrimaryPrompt({ meta, packet })
: `${buildPrimaryPrompt({ meta, packet })}\n\n${buildRepairPrompt({ validationReason: lastReason, previousCandidate })}`;
const startedAt = new Date().toISOString();
const attemptStartedAt = new Date().toISOString();
const responseJson = await postReviewRequest({
apiUrl: cleanText(env.ANTHROPIC_BASE_URL),
apiKey: cleanText(env.ANTHROPIC_AUTH_TOKEN),
@@ -286,7 +286,7 @@ export async function writeDirectReviewFromEnv(env = process.env, fetchImpl = gl
const validation = normalizeStructuredOutput(previousCandidate);
attempts.push({
attempt,
startedAt,
startedAt: attemptStartedAt,
status: validation.ok ? 'validated' : 'invalid',
timeoutMs: attemptWindow.timeoutMs,
validationReason: validation.ok ? null : validation.reason,
@@ -52,5 +52,11 @@ describe('ai-review workflow', () => {
'${{ steps.review-packet.outputs.packet_included_files }}'
);
expect(directReviewStep?.env?.AI_REVIEW_REQUEST_BUFFER_MS).toBe(45000);
const publishStep = steps.find((step) => step.name === 'Publish review comment');
expect(publishStep).toBeDefined();
expect(String(publishStep?.env?.REVIEW_MARKER)).toContain('pr:${{ needs.prepare.outputs.pr_number }}');
expect(String(publishStep?.env?.REVIEW_MARKER)).toContain('sha:${{ needs.prepare.outputs.head_sha }}');
expect(String(publishStep?.env?.REVIEW_MARKER)).not.toContain('run:${{ github.run_id }}');
});
});