← Back to Pull requests

fix(ci): read dashboard JSON from file in grafana-preview #8092

Closed
unknown closed this pull request without merging on Nov 13, 2026 14:40 UTC
View on GitHub
unknown unknown commented on Nov 13, 2026 07:07 UTC
Author

What

upload_dashboard() in hack/ci/grafana-preview.sh builds the Grafana API payload by reading the dashboard body from a temp file via jq --slurpfile, instead of passing it as a jq CLI argument.

Why

The previous jq --argjson dashboard "${dashboard_json}" ... passed the whole dashboard JSON as a single command-line argument. On Linux a single argument is capped at MAX_ARG_STRLEN (128 KiB), independent of total ARG_MAX. Dashboards larger than that fail the exec with E2BIG, which the shell reports as:

hack/ci/grafana-preview.sh: line 149: /usr/local/bin/jq: Argument list too long
error: failed to execute wrapped command: exit status 126

observability/grafana-dashboards/velero/velero.json already exceeds the limit on main (~149 KB pretty-printed), so any PR that changes a large dashboard breaks the preview step. macOS does not reproduce (1 MiB per-arg limit); reproduced in alpine:3.20 linux/amd64 with jq 1.7.1.

Example: https://prow.ci.openshift.org/view/gs/test-platform-results-public/pr-logs/pull/Azure_ARO-HCP/7861/pull-ci-Azure-ARO-HCP-main-grafana-preview/2120903758706642944 in #7861

Testing

In alpine:3.20 linux/amd64 with real jq:

  • Before: original code path → exit 126, Argument list too long.

  • After: velero.json → exit 0, payload built from file.

  • Invalid-JSON board → exit 1 with Failed to parse dashboard JSON.

  • Semantically rejected board (empty title) → exit 1 via Grafana non-success status.
  • shellcheck (as run by the mega-linter CI job) passes clean on the changed file.

    Jira: ARO-30718

    Diff: 204 lines (+153 / -51) across 2 files Reviewer: tmstff Review duration: 452m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 204 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.318
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #8092"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.3% (MEDIUM) · Higher = larger blast radius
    36.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.3% · Safe to merge
    14.3%
    Repository