fix(ui): tolerate non-JSON AnalysisRun measurement values - #6802
Closed
utkarshcmu wants to merge 1 commit into
Closed
fix(ui): tolerate non-JSON AnalysisRun measurement values#6802utkarshcmu wants to merge 1 commit into
utkarshcmu wants to merge 1 commit into
Conversation
Argo Rollouts' web provider passes a plain text response body through unchanged, so a measurement value is not guaranteed to be JSON. transformMeasurementValue called JSON.parse without a guard, which threw a SyntaxError and stopped the analysis modal from rendering at all -- clicking an AnalysisRun under a Stage's Verifications tab failed with "SyntaxError: Unexpected token 'P', \"PASS\" is not valid JSON". Treat an unparseable value as a non-chartable table value, consistent with how the function already handles unsupported formats. Signed-off-by: Utkarsh Bhatnagar <utkarsh.cmu@gmail.com>
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Author
|
Closing as a duplicate — #6758 addresses the same issue and was opened first. Apologies for the noise; I missed the existing PR when picking this up. |
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.
Description
Closes #4630
Argo Rollouts'
webprovider passes a plain text response body through unchanged, so an AnalysisRun measurement value is not guaranteed to be JSON.transformMeasurementValuecalledJSON.parsewithout a guard, so clicking an AnalysisRun under a Stage's Verifications tab failed withSyntaxError: Unexpected token 'P', "PASS" is not valid JSONand the analysis modal did not render at all.An unparseable value is now treated as a non-chartable table value, surfacing the raw string rather than discarding it. This is consistent with how the function already handles unsupported formats a few lines below (
// unsupported formats are stringified and put into table).Verified the added tests fail without the fix, reproducing the reporter's exact
SyntaxError, and pass with it. Full UI suite passes (190 tests);lint-uiandtypecheck-uiare clean.Checklist
Eligibility
kind/proposal,needs discussion,needs research,maintainer only,area/security,size/large,size/x-large,size/xx-large).Quality
AI Use Disclosure
This PR was written:
Sign-Off
All commits:
git commit -s) (required)git commit -S) (encouraged)🤖 Generated with Claude Code