Skip to content

fix(app): show evidence block for failed automation runs#2645

Merged
tofikwest merged 1 commit intomainfrom
fix/automation-evidence-on-fail
Apr 23, 2026
Merged

fix(app): show evidence block for failed automation runs#2645
tofikwest merged 1 commit intomainfrom
fix/automation-evidence-on-fail

Conversation

@tofikwest
Copy link
Copy Markdown
Contributor

@tofikwest tofikwest commented Apr 23, 2026

Summary

Follow-up to #2643. The automation-run detail card in Compliance → Task → Integration Checks rendered a View Evidence expandable JSON tree for every passing result but never for a failing one — even though the backend saves the same `evidence` payload in both cases and the API returns it identically.

After the Dependabot severity gating in #2643, fails surface exactly the context users need to understand them (the `open_by_severity` breakdown, `checked_at`, the `alerts` totals). Hiding that JSON for fails defeats the point of showing the evidence at all.

This PR mirrors the passing block's `

Details > ` pattern onto the findings map so both states render identically. 12-line diff, one file.

Trace of the pre-existing inconsistency:

  • Check emits `evidence` identically for pass/fail (`packages/integration-platform/src/manifests/github/checks/dependabot.ts`)
  • Backend save path writes `evidence: JSON.parse(JSON.stringify(finding.evidence || {}))` for both (`apps/api/src/trigger/integration-platform/run-connection-checks.ts:191-214`)
  • DB schema has single `evidence Json?` column shared by pass/fail (`IntegrationCheckResult`)
  • API endpoint returns `evidence: r.evidence` with no pass/fail filtering (`task-integrations.controller.ts:614`)
  • Frontend hook types `evidence?: Record<string, unknown>` on all results (`useIntegrationChecks.ts:54`)
  • Frontend component only renders it in the passing map (`TaskIntegrationChecks.tsx:1077-1088`) — this was the only gap, now closed

Test plan

  • `tsc --noEmit` clean for this file's module graph (unrelated pre-existing failures in `auth-client.ts` and `ai-elements/tool.tsx` already present on `main`)
  • Diff is additive only; no existing behaviour changed for passing results, logs, remediation, or badges
  • Before merge: run a Dependabot automation against a repo with open high alerts and visually confirm the red failing card now shows the same "▶ View Evidence" expandable block that passing cards show

Why not also write a unit test?

`TaskIntegrationChecks.tsx` is a 1432-line component with no existing test file of its own. Adding one purely for this 12-line conditional would be out-of-scope scaffolding; the sibling component tests (`SingleTask.test.tsx`, etc.) don't reach into this code path. Happy to add one if you'd prefer — flag it in review.

🤖 Generated with Claude Code


Summary by cubic

Show the "View Evidence" JSON block for failing automation runs in Compliance → Task → Integration Checks, not only for passing results. This fixes the UI inconsistency and lets users see the same evidence (e.g., open_by_severity, checked_at) to understand failures.

Written for commit 975b4c9. Summary will update on new commits.

The automation-run detail card in Compliance → Task → Integration Checks
rendered a "View Evidence" expandable JSON tree for every *passing*
result but never for a *failing* one — even though the backend saves the
same `evidence` payload for both and the API returns it identically.

After the Dependabot severity-gating change (#2643), failing runs
surface useful context in their evidence (open_by_severity breakdown,
checked_at, etc.) that users need to understand *why* the check failed.
Hiding it behind a UI inconsistency defeats that.

Mirror the passing block's `details > EvidenceJsonView` pattern onto the
findings map so both states render identically.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Apr 23, 2026 3:04am
comp-framework-editor Ready Ready Preview, Comment Apr 23, 2026 3:04am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal Skipped Skipped Apr 23, 2026 3:04am

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Auto-approved: Low-risk UI fix that shows existing evidence data for failed checks, mirroring the behavior of passing checks. No business logic or data integrity changes.

@tofikwest tofikwest merged commit 0a77112 into main Apr 23, 2026
11 checks passed
@tofikwest tofikwest deleted the fix/automation-evidence-on-fail branch April 23, 2026 03:07
@claudfuen
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.30.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants