Skip to content

feat: dashboard PR preview bot #541 - #743

Open
Sulamoney222 wants to merge 1 commit into
Chronopay-Org:mainfrom
Sulamoney222:feat/dashboard-preview-bot
Open

feat: dashboard PR preview bot #541#743
Sulamoney222 wants to merge 1 commit into
Chronopay-Org:mainfrom
Sulamoney222:feat/dashboard-preview-bot

Conversation

@Sulamoney222

Copy link
Copy Markdown

Overview

This PR adds a dashboard preview PR-comment bot that renders panel preview PNGs and JSON diffs into PR comments so reviewers can inspect Grafana dashboard changes visually — without leaking internal dashboards to public forks.

Related Issue

Closes #541

Changes

Dashboard preview bot

  • [ADD] scripts/dashboard-preview-bot.ts

    • Diffs ops/dashboards/*.json by panel id (added / removed / modified).
    • Renders schematic panel preview PNGs with a minimal zlib-based encoder (no new deps).
    • Posts JSON diff (truncated for large dashboards) + panel change summary.
    • Suppresses content on fork PRs (HEAD_REPO missing treated as unsafe on pull_request).
  • [ADD] .github/workflows/dashboard-preview.yml

    • Path-filtered on dashboard JSON; skips forks at the job if level; uploads PNG artifacts.
  • [ADD] scripts/__tests__/dashboard-preview-bot.test.ts

    • Edge cases: deleted dashboard/panel, invalid JSON, large diffs, fork suppression, PNG generation.
  • [ADD] docs/dashboard-preview-bot.md

Verification Results

npm test -- --testPathPattern=dashboard-preview-bot --coverage=false
✅ 27/27 passed
Acceptance Criteria Status
Render panels to PNG ✅ Minimal PNG encoder + panel cards
Post images + JSON diff in comment ✅ Data-URI embed / artifact note + truncated diff
Suppress on forks (no leak) ✅ Workflow if + script isForkPr()
Edge: large / deleted panel / non-JSON ✅ Covered in unit tests

@drips-wave

drips-wave Bot commented Aug 3, 2026

Copy link
Copy Markdown

@Sulamoney222 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Add dashboard preview PR-comment bot rendering diffs for reviewers

1 participant