Skip to content

fix: harden bundled dashboard and alert asset loading - #1200

Closed
Aias00 wants to merge 3 commits into
apache:rocketmq-studiofrom
Aias00:fix/studio-grafana-dashboard-utf8-1199
Closed

fix: harden bundled dashboard and alert asset loading#1200
Aias00 wants to merge 3 commits into
apache:rocketmq-studiofrom
Aias00:fix/studio-grafana-dashboard-utf8-1199

Conversation

@Aias00

@Aias00 Aias00 commented Aug 7, 2026

Copy link
Copy Markdown

Summary

  • decode bundled Grafana dashboard JSON as UTF-8
  • skip malformed or non-object Grafana dashboard assets
  • skip empty, invalid, and incomplete bundled Prometheus alert rules

Closes #1199
Closes #1201
Closes #1209

Verification

  • mvn -Dtest=GrafanaDashboardServiceTest,AlertRuleAssetServiceTest test

Copilot AI lite review requested due to automatic review settings August 7, 2026 03:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR fixes Grafana dashboard asset loading to use explicit UTF-8 encoding instead of the platform default charset. Prevents garbled dashboard names/descriptions on systems where the default encoding is not UTF-8 (e.g., Windows with GBK).

Simple but important correctness fix.

LGTM.


Automated review by github-manager-bot

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR fixes Grafana dashboard asset loading to use explicit UTF-8 encoding instead of the platform default charset. Prevents garbled dashboard names/descriptions on systems where the default encoding is not UTF-8 (e.g., Windows with GBK).

Simple but important correctness fix.

LGTM.


Automated review by github-manager-bot

@Aias00 Aias00 changed the title fix: decode Grafana dashboard assets as UTF-8 fix: harden Grafana dashboard asset loading Aug 7, 2026

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New commit looks good. Adding a null/non-object guard after readTree() prevents crashes on malformed dashboard JSON assets. The protected visibility change on resolveResources() is a reasonable trade-off for testability. The new test covering empty and array JSON inputs is thorough.


Automated review by github-manager-bot

@Aias00
Aias00 force-pushed the fix/studio-grafana-dashboard-utf8-1199 branch from 6c0faaf to 64cf382 Compare August 7, 2026 07:06
@Aias00 Aias00 changed the title fix: harden Grafana dashboard asset loading fix: harden bundled dashboard and alert asset loading Aug 7, 2026
lizhimins pushed a commit to Aias00/rocketmq-dashboard that referenced this pull request Aug 7, 2026
…quick start; align tests

Consolidates apache#1122, apache#1123, apache#1200, apache#1217: decode Grafana dashboard assets as
UTF-8, skip invalid Grafana assets and incomplete alert rules, bound
Prometheus time-series labels, stop seeding demo resources by default and
complete the Docker Compose quick start docs. Also aligns pre-existing tests
with the integrated behaviors (required instance type, live resource counts
on delete, long TPS fields, default dashboard cluster type).
lizhimins pushed a commit that referenced this pull request Aug 7, 2026
…tics and asset loading (#1177)

* feat: complete instance scoping for metadata mutations, message queries, producers and dashboard

Consolidates #1112, #1120, #1162, #1166, #1177: route Apache Topic mutations,
test messages, producer connections, message queries, dashboard data and
metrics sources by the selected instance; scope metadata deletes to the
current cluster; redirect unknown instance routes.

* fix: harden instance lifecycle, runtime admin caches and cloud credential invalidation

Consolidates #1185, #1213, #1225, #1236, #1238: release unused runtime
AdminClients, normalize NameServer cache keys, align cache lifecycle,
validate Apache instance endpoints and type before persistence, invalidate
Aliyun clients after credential changes, expose unavailable cloud resource
counts and check current resources before deleting an instance.

* fix: harden runtime diagnostics, dashboard overview and async detail freshness

Consolidates #1089, #1205, #1219, #1223, #1240: guard stale async detail
responses (consumer groups, LiteTopic), coordinate group refreshes, remove
unsupported group/subscription actions, surface unavailable broker runtime
statistics/versions and cluster discovery failures, wire Broker Cluster
restart, mark dashboard clusters warning on runtime failures, preserve TPS
precision, reuse broker runtime snapshots, distinguish unavailable DLQ
statistics, handle missing DLQ enqueue timestamps, stop stalled pull scans
and report DLQ resend failures.

* fix: harden bundled asset loading, metrics labels and defaults; docs quick start; align tests

Consolidates #1122, #1123, #1200, #1217: decode Grafana dashboard assets as
UTF-8, skip invalid Grafana assets and incomplete alert rules, bound
Prometheus time-series labels, stop seeding demo resources by default and
complete the Docker Compose quick start docs. Also aligns pre-existing tests
with the integrated behaviors (required instance type, live resource counts
on delete, long TPS fields, default dashboard cluster type).
@lizhimins

Copy link
Copy Markdown
Member

Consolidated into #1177 (merged into rocketmq-studio as f727341): this change was integrated together with the remaining batch of instance-scoping, lifecycle, runtime-diagnostic and asset-hardening fixes, adapted to the current architecture and verified with the full test suite. Thanks for the contribution! / 已并入 #1177(合入 rocketmq-studio,SHA f727341):与其余 instance 作用域、生命周期、运行时诊断与资产加固修复合批整合,适配了当前架构并通过全量测试。感谢贡献!

@lizhimins lizhimins closed this Aug 7, 2026
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.

4 participants