Repository navigation
Conversation
Owner
|
Thanks for this, the code looks good. #175 just merged and #176, #177 and #179 now need a quick rebase for a CHANGELOG conflict. Once those land, please rebase this one too. With #177's two tools in, the tool count becomes 58, so it needs updating in plugin.json, AGENTS.md, CLAUDE.md, README.md, SECURITY.md, mcp-server/README.md, package.json and site.json, plus the dry-run, input-validation and service-http tests. Then I'll merge it. Generated by Claude Code |
This was referenced Nov 25, 2026
Signed-off-by: Asahi Arataki <[email protected]>
laozhej
force-pushed
the
feat/171-grafana-dashboard-import
branch
from
November 27, 2026 06:04
495752f to
623d929
Compare
This branch has not been deployed
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.
What changed
Adds
homelab_grafanaImport, accepting either raw dashboard JSON or the completehomelab_grafanaSnapshotexport. It requires confirmation, limits input to 1 MiB of UTF-8, posts to/api/dashboards/dbusing the existing Grafana auth helper, and returns the saved UID and URL.curl --data-binary @-), keeping dashboard contents out of shell commands and previews. An optionalExecOptions.stdinsends input followed by EOF without changing existing callers.overwriteto false. Retain the UID but reset database-local IDs and versions so exported values cannot bypass that choice. Allow an explicit folder UID, otherwise preserve the exported folder or use root; an empty string explicitly selects root.Why
Closes #171. The Grafana skill already describes export/import workflows, but the MCP server only implements export. This completes the round trip with an explicit overwrite choice and confirmation preview.
The request and response follow the documented dashboard API. The returned URL can be relative to the Grafana base URL.
Type
Testing
cd mcp-server && npm run build && npm testpassespytest tests/ -v --tb=shortpassesNode 22.23.0: build and
npm run typecheckpass; 659 TypeScript tests pass, with 10 live-Pi tests skipped. All 273 Python structure tests pass. No live Grafana or Pi was used.Coverage includes raw and exported JSON, UTF-8 byte limits, folder precedence, overwrite defaults, per-node settings, confirmation and dry-run behavior, credential quoting/masking, and malformed/truncated/error responses. A local SSH server verifies empty and large UTF-8 stdin payloads arrive intact with EOF.
git diff --checkpasses.Checklist
Implemented and checked with Codex assistance. Commit includes the required DCO sign-off.