Skip to content

fix(ui): handle non-JSON AnalysisRun measurement values - #6787

Open
SuyogShinde942 wants to merge 1 commit into
akuity:mainfrom
SuyogShinde942:fix/analysis-run-non-json-measurement
Open

fix(ui): handle non-JSON AnalysisRun measurement values#6787
SuyogShinde942 wants to merge 1 commit into
akuity:mainfrom
SuyogShinde942:fix/analysis-run-non-json-measurement

Conversation

@SuyogShinde942

Copy link
Copy Markdown

Summary

  • transformMeasurementValue() in the analysis modal called JSON.parse() on every metric measurement value unconditionally. Providers such as web can return a plain-text response (not JSON), which throws inside the useMemo() that builds the AnalysisRun chart/table data and leaves the panel unable to open (a brief "flash" with no further UI, per the console error in the issue).
  • Catch the parse failure and fall back to displaying the raw string in the table, non-chartable — consistent with how other unsupported value shapes are already handled in this function.
  • Added a unit test covering a plain, non-JSON string measurement value.

Fixes #6785

Test plan

  • pnpm typecheck
  • pnpm lint (targeted eslint run on changed files)
  • pnpm test (vitest run) — 187/187 passing, including new test case

Metric providers such as web can return a plain-text response instead
of JSON. JSON.parse() throws in that case, which crashes the
useMemo() computing the analysis chart/table data and leaves the
AnalysisRun panel unable to open.

Catch the parse failure and fall back to displaying the raw value in
the table (as an unsupported/non-chartable format), matching how
other unsupported value shapes are already handled.

Fixes akuity#6785

Signed-off-by: Suyog Shinde <suyog942.shinde@gmail.com>
@netlify

netlify Bot commented Aug 10, 2026

Copy link
Copy Markdown

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit bc11ffc
🔍 Latest deploy log https://app.netlify.com/projects/docs-kargo-io/deploys/6a7a2b105f44bd000804b754
😎 Deploy Preview https://deploy-preview-6787.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kargo-governance-bot kargo-governance-bot Bot added kind/bug Something isn't working as intended; If unsure that something IS a bug, start a discussion instead needs/area Issue or PR needs to be labeled to indicate what parts of the code base are affected needs/priority Priority has not yet been determined; a good signal that maintainers aren't fully committed labels Aug 10, 2026
@SuyogShinde942

Copy link
Copy Markdown
Author

With this fix applied, the modal renders normally and shows the raw value in the measurement table instead of crashing:
after-fix-6785-table-renders

@Marvin9

Marvin9 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

There is already a PR open similar to this #6758

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

Labels

kind/bug Something isn't working as intended; If unsure that something IS a bug, start a discussion instead needs/area Issue or PR needs to be labeled to indicate what parts of the code base are affected needs/priority Priority has not yet been determined; a good signal that maintainers aren't fully committed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui(verification): AnalysisRun fails to popup

2 participants