Skip to content

Fix/grafana rights2 - #227

Merged
HardMax71 merged 4 commits into
mainfrom
fix/grafana-rights2
Feb 24, 2026
Merged

Fix/grafana rights2#227
HardMax71 merged 4 commits into
mainfrom
fix/grafana-rights2

Conversation

@HardMax71

@HardMax71 HardMax71 commented Feb 24, 2026

Copy link
Copy Markdown
Owner

Summary by cubic

Secured Grafana access and made dashboard provisioning reliable. Updated the Integr8sCode dashboard with an “All Dashboards” panel, fixed a stale metric, and set a safe default alert recipient.

  • New Features
    • Enabled Grafana basic HTTP auth.
    • Locked the dashboards provider (folderUid set, UI updates disabled).
    • Added Grafana healthcheck and automatic dashboard reload in release-deploy.

Written for commit 2c1d563. Summary will update on new commits.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added "All Dashboards" panel to the observability dashboard.
    • Implemented service health monitoring.
  • Improvements

    • Enabled basic authentication for enhanced security.
    • Updated monitoring query expressions for improved accuracy.
    • Optimized dashboard layout and panel positioning.
  • Chores

    • Enhanced deployment automation for dashboard provisioning.

Copilot AI review requested due to automatic review settings February 24, 2026 11:00
@coderabbitai

coderabbitai Bot commented Feb 24, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The changes configure Grafana authentication, update service orchestration with health monitoring, enhance dashboard provisioning, and modify the deployment workflow to trigger dashboard reloads. Includes enabling basic auth, adding healthchecks, repositioning dashboard panels, updating a metrics query, and adjusting release deployment steps.

Changes

Cohort / File(s) Summary
Grafana Configuration
backend/grafana/grafana.ini
Enabled basic authentication by setting enabled = true under [auth.basic] section.
Dashboard Provisioning
backend/grafana/provisioning/dashboards/dashboard.yml, backend/grafana/provisioning/dashboards/integr8scode.json
Added folderUid: 'integr8scode' to dashboard provider config and disabled UI updates (allowUiUpdates: false). Added a new dashlist panel and repositioned multiple panels vertically. Updated PromQL query in panel 7 from sum(execution_queue_depth) to sum(queue_depth).
Deployment & Orchestration
.github/workflows/release-deploy.yml, docker-compose.yaml
Removed Grafana container cleanup command from release workflow and added curl-based API call to reload dashboards. Added healthcheck to Grafana service and updated default SMTP alert recipients to noreply@integr8scode.cc.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A dashlist blooms where panels dance,
Auth enabled, metrics enhanced,
Health checks guard the dashboard door,
Queue depths flow evermore! 📊

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix/grafana rights2' is vague and does not clearly convey the actual changes being made (Grafana configuration updates, dashboard provisioning, authentication enablement, healthcheck addition). Revise the title to be more descriptive and specific, such as 'Enable Grafana basic auth and update dashboard provisioning' or 'Configure Grafana authentication and health checks'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/grafana-rights2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@HardMax71
HardMax71 merged commit 8a35101 into main Feb 24, 2026
14 of 15 checks passed
@HardMax71
HardMax71 deleted the fix/grafana-rights2 branch February 24, 2026 11:03

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 5 files

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.

Pull request overview

This pull request implements Grafana permissions and configuration improvements to enforce read-only dashboard provisioning while maintaining appropriate access controls. The changes lock down dashboard modifications through the UI while enabling basic authentication alongside anonymous viewer access, and improve deployment reliability through health checks and proper dashboard reloading.

Changes:

  • Enabled basic authentication in Grafana while maintaining anonymous viewer access for a dual authentication model
  • Changed dashboard provisioning to disallow UI updates (allowUiUpdates: false), enforcing infrastructure-as-code for dashboards
  • Added Grafana health check to docker-compose and implemented dashboard reload API call in deployment workflow
  • Fixed metric query from incorrect execution_queue_depth to correct queue_depth metric name
  • Added dashboard list panel to main dashboard for better navigation

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
docker-compose.yaml Added default value for GRAFANA_ALERT_RECIPIENTS and health check configuration for Grafana service
backend/grafana/grafana.ini Enabled basic authentication (changed from false to true) to allow admin access alongside anonymous viewers
backend/grafana/provisioning/dashboards/dashboard.yml Added folderUid and changed allowUiUpdates to false to prevent dashboard modifications through UI
backend/grafana/provisioning/dashboards/integr8scode.json Added dashboard list panel, adjusted grid positions, and corrected metric name from execution_queue_depth to queue_depth
.github/workflows/release-deploy.yml Removed grafana container removal step and added dashboard reload API call after deployment

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +159 to +161
curl -sf -X POST \
-u "$GRAFANA_ADMIN_USER:$GRAFANA_ADMIN_PASSWORD" \
http://localhost:3000/api/admin/provisioning/dashboards/reload

Copilot AI Feb 24, 2026

Copy link

Choose a reason for hiding this comment

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

The dashboard reload API call should include error handling or verification. If the API call fails, the deployment script should either retry or provide a warning message. The -f flag in curl will cause it to fail silently on HTTP errors (4xx, 5xx status codes) but the script won't know about the failure. Consider adding an explicit check or error message after this curl command to ensure the reload was successful.

Suggested change
curl -sf -X POST \
-u "$GRAFANA_ADMIN_USER:$GRAFANA_ADMIN_PASSWORD" \
http://localhost:3000/api/admin/provisioning/dashboards/reload
if ! curl -sS -X POST \
-u "$GRAFANA_ADMIN_USER:$GRAFANA_ADMIN_PASSWORD" \
http://localhost:3000/api/admin/provisioning/dashboards/reload; then
echo "Error: Failed to reload Grafana dashboards via API." >&2
exit 1
fi

Copilot uses AI. Check for mistakes.
Comment on lines 23 to +24
[auth.basic]
enabled = false
enabled = true

Copilot AI Feb 24, 2026

Copy link

Choose a reason for hiding this comment

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

Enabling basic authentication alongside anonymous access creates a dual authentication scenario. While this is functional, it should be verified that this is the intended security model. The anonymous users will have Viewer role access while authenticated users can have different permissions. Ensure this aligns with the security requirements and that sensitive operations are properly protected by authentication checks.

Copilot uses AI. Check for mistakes.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
docker-compose.yaml (1)

201-206: Healthcheck is well-structured and correctly gates the provisioning reload.

With this healthcheck in place, docker compose up --wait will block until Grafana is healthy before the deployment script reaches the curl reload call — ensuring correct sequencing.

Minor nit: && echo 'ready' is a no-op in a healthcheck — the exit code of curl -f alone determines health status. It can be dropped without any behavioral change.

🧹 Proposed cleanup
-      test: ["CMD-SHELL", "curl -f localhost:3000/api/health && echo 'ready'"]
+      test: ["CMD-SHELL", "curl -f localhost:3000/api/health"]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docker-compose.yaml` around lines 201 - 206, Remove the no-op echo from the
healthcheck test command: in the healthcheck block (the "healthcheck" entry and
its "test" array) replace the test command that currently includes "&& echo
'ready'" so it only runs "curl -f localhost:3000/api/health" (the curl -f exit
code will determine health); i.e., edit the "test" value to drop the "&& echo
'ready'" portion.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release-deploy.yml:
- Around line 159-162: The current curl invocation uses -sf which silences the
response body on HTTP errors; update the curl call that posts to
/api/admin/provisioning/dashboards/reload to surface error details by removing
-s or replacing -f with --fail-with-body (i.e., use curl -f ... or curl
--fail-with-body ... without -s) so any 4xx/5xx response body is printed to the
Actions log and failures become diagnosable.

---

Nitpick comments:
In `@docker-compose.yaml`:
- Around line 201-206: Remove the no-op echo from the healthcheck test command:
in the healthcheck block (the "healthcheck" entry and its "test" array) replace
the test command that currently includes "&& echo 'ready'" so it only runs "curl
-f localhost:3000/api/health" (the curl -f exit code will determine health);
i.e., edit the "test" value to drop the "&& echo 'ready'" portion.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4f7431 and 2c1d563.

📒 Files selected for processing (5)
  • .github/workflows/release-deploy.yml
  • backend/grafana/grafana.ini
  • backend/grafana/provisioning/dashboards/dashboard.yml
  • backend/grafana/provisioning/dashboards/integr8scode.json
  • docker-compose.yaml

Comment on lines +159 to +162
curl -sf -X POST \
-u "$GRAFANA_ADMIN_USER:$GRAFANA_ADMIN_PASSWORD" \
http://localhost:3000/api/admin/provisioning/dashboards/reload

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Silent failure on provisioning reload makes deployment failures undiagnosable.

The combined -sf flags mean that if this call returns a 4xx/5xx (wrong credentials, API error, etc.), set -e will abort the deployment with no output in the GitHub Actions log — just a non-zero exit code and no explanation. Drop -s or swap -f for --fail-with-body to surface the error response:

🔧 Proposed fix
-            curl -sf -X POST \
+            curl -f --fail-with-body -X POST \
               -u "$GRAFANA_ADMIN_USER:$GRAFANA_ADMIN_PASSWORD" \
               http://localhost:3000/api/admin/provisioning/dashboards/reload
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
curl -sf -X POST \
-u "$GRAFANA_ADMIN_USER:$GRAFANA_ADMIN_PASSWORD" \
http://localhost:3000/api/admin/provisioning/dashboards/reload
curl -f --fail-with-body -X POST \
-u "$GRAFANA_ADMIN_USER:$GRAFANA_ADMIN_PASSWORD" \
http://localhost:3000/api/admin/provisioning/dashboards/reload
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-deploy.yml around lines 159 - 162, The current
curl invocation uses -sf which silences the response body on HTTP errors; update
the curl call that posts to /api/admin/provisioning/dashboards/reload to surface
error details by removing -s or replacing -f with --fail-with-body (i.e., use
curl -f ... or curl --fail-with-body ... without -s) so any 4xx/5xx response
body is printed to the Actions log and failures become diagnosable.

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.

2 participants