Skip to content

TRT-2660: Fix null Explanations crash in regressed tests modal#2

Open
openshift-trt-agent[bot] wants to merge 6 commits into
masterfrom
TRT-2660
Open

TRT-2660: Fix null Explanations crash in regressed tests modal#2
openshift-trt-agent[bot] wants to merge 6 commits into
masterfrom
TRT-2660

Conversation

@openshift-trt-agent

Copy link
Copy Markdown

Summary

  • Initialize Explanations as []string{} instead of nil at both TestComparison creation sites (component_report.go and test_details.go) so Go serializes it as JSON [] instead of null
  • Add a defensive != null check in CompSeverityIcon.js to guard against null explanations from the API

Test plan

  • make lint passes (npm audit warning is pre-existing)
  • make test passes (Go + Jest)
  • go vet ./pkg/api/componentreadiness/... passes
  • Open the regressed tests modal on component readiness page — no crash

Fixes: https://issues.redhat.com/browse/TRT-2660

🤖 Generated with Claude Code

@openshift-trt-agent openshift-trt-agent Bot force-pushed the TRT-2660 branch 2 times, most recently from 4cce161 to 3399ff5 Compare June 4, 2026 12:37
smg247 and others added 3 commits June 4, 2026 16:41
Bump react-router and react-router-dom to 6.30.4 to resolve a moderate
open-redirect vulnerability (GHSA-2j2x-hqr9-3h42).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
NO-JIRA: Fix production npm audit vulnerability in react-router
Initialize Explanations as an empty slice instead of nil when creating
TestComparison structs. Go serializes nil slices as JSON null, which
caused a crash in CompSeverityIcon when accessing explanations.length.
Also add a defensive null check in the frontend component.

Fixes: https://redhat.atlassian.net/browse/TRT-2660

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
openshift-trt and others added 3 commits June 4, 2026 18:48
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Initialize Explanations as an empty slice instead of nil in TestComparison
structs so Go serializes it as JSON [] instead of null. Also add a defensive
null check in CompSeverityIcon.js to guard against null explanations.

Fixes: https://redhat.atlassian.net/browse/TRT-2660

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The rebase introduced a duplicate Explanations initializer in the
TestComparison struct literal, causing a compile error. Remove the
duplicate.

Fixes: https://redhat.atlassian.net/browse/TRT-2660

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant