TRT-2660: Fix null Explanations crash in regressed tests modal#2
Open
openshift-trt-agent[bot] wants to merge 6 commits into
Open
TRT-2660: Fix null Explanations crash in regressed tests modal#2openshift-trt-agent[bot] wants to merge 6 commits into
openshift-trt-agent[bot] wants to merge 6 commits into
Conversation
4cce161 to
3399ff5
Compare
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>
c6e35b4 to
9dd7790
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Explanationsas[]string{}instead ofnilat bothTestComparisoncreation sites (component_report.goandtest_details.go) so Go serializes it as JSON[]instead ofnull!= nullcheck inCompSeverityIcon.jsto guard against nullexplanationsfrom the APITest plan
make lintpasses (npm audit warning is pre-existing)make testpasses (Go + Jest)go vet ./pkg/api/componentreadiness/...passesFixes: https://issues.redhat.com/browse/TRT-2660
🤖 Generated with Claude Code