mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
fix: make analyze-pr non-blocking and log Gemini response
- Log raw Gemini response for debugging when parsing fails - Handle possible wrapper keys in response - Make qa-before/qa-after run even if analyze-pr fails (only gate on resolve-matrix success)
This commit is contained in:
4
.github/workflows/pr-qa.yaml
vendored
4
.github/workflows/pr-qa.yaml
vendored
@@ -140,7 +140,7 @@ jobs:
|
||||
always() &&
|
||||
needs.resolve-matrix.outputs.skip != 'true' &&
|
||||
needs.resolve-matrix.outputs.mode == 'focused' &&
|
||||
(needs.analyze-pr.result == 'success' || needs.analyze-pr.result == 'skipped')
|
||||
needs.resolve-matrix.result == 'success'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -276,7 +276,7 @@ jobs:
|
||||
if: >-
|
||||
always() &&
|
||||
needs.resolve-matrix.outputs.skip != 'true' &&
|
||||
(needs.analyze-pr.result == 'success' || needs.analyze-pr.result == 'skipped')
|
||||
needs.resolve-matrix.result == 'success'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
@@ -444,13 +444,26 @@ async function analyzeWithGemini(
|
||||
.trim()
|
||||
|
||||
console.warn('Gemini response received')
|
||||
console.warn('Raw response (first 500 chars):', text.slice(0, 500))
|
||||
const parsed = JSON.parse(text)
|
||||
|
||||
if (!parsed.before || !parsed.after) {
|
||||
throw new Error('Response missing "before" or "after" keys')
|
||||
// Handle possible nesting — Gemini may wrap in an extra object
|
||||
const guide =
|
||||
parsed.before && parsed.after
|
||||
? parsed
|
||||
: (parsed.qa_guide ?? parsed.guides ?? parsed)
|
||||
|
||||
if (!guide.before || !guide.after) {
|
||||
console.warn(
|
||||
'Full response:',
|
||||
JSON.stringify(parsed, null, 2).slice(0, 2000)
|
||||
)
|
||||
throw new Error(
|
||||
`Response missing "before" or "after" keys. Got keys: ${Object.keys(parsed).join(', ')}`
|
||||
)
|
||||
}
|
||||
|
||||
return { before: parsed.before, after: parsed.after }
|
||||
return { before: guide.before, after: guide.after }
|
||||
}
|
||||
|
||||
// ── Main ──
|
||||
|
||||
Reference in New Issue
Block a user