Skip to content

refactor(grafana): delete the home-grown dashboard builders #5278

Closed

Description

@dan-petty

Problem or Motivation

src/devops_cli/grafana/builders.py and the panel types of src/devops_cli/grafana/schema.py are a home-grown builder of the Grafana dashboard schema (dashboard, layout, row, stat, target, targets, timeseries). No module of src/ calls the builders: git grep finds them only in src/devops_cli/grafana/__init__.py and in tests/grafana/test_grafana_dashboards.py, sections 1 to 4 and the test test_generated_dashboards_lint_clean. The service dashboards now come from the Grafana Foundation SDK (#5184), so the project has two dashboard builders, and only the SDK makes a committed dashboard.

Proposed Solution & Architectural Design

  • Delete the builders and their tests. The linter tests make their dashboards as JSON dicts, or with the SDK of the dependency group dashboards.
  • Keep the part of schema.py that the linter reads (Dashboard, Panel, Target, GridPos, Datasource), or read the dashboards with the SDK models (grafana_foundation_sdk.models.dashboard.Dashboard.from_json) if the linter can run on them.

Target Subsystem

Grafana (src/devops_cli/grafana/).

Existing Tool Considered

The Grafana Foundation SDK (Apache-2.0, Grafana Labs), which #5184 adds as a build-time dependency group. The change deletes code and adds none.

Acceptance Criteria

  • ! git grep -n -e "grafana.builders" -- src tests exits 0.
  • devops grafana dashboards lint k8s/monitoring/dashboards gives the same result as before.

Source: #5184

Activity

  1. added
    source/agent
    on Nov 12, 2026
  2. added
    type/refactor
    status/new
    value/low
    effort/low
    on Nov 12, 2026
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
    • Scope: none. The title has the scope grafana, and .github/labels.yml declares no scope/grafana label. Add the label to the file to give the scope to this item.
    • Priority: P3-Low. Dead code removal with no user-facing change and no blocking dependency.
    • Related: feat(cli): grafana declarative dashboard schema models & bi-directional gitops provisioning research #315, which asks for a different change. Both concern the Grafana schema models in schema.py; #315 created them, the candidate deletes the builder code that used them.
  4. added
    priority/p3-low
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 12, 2026
  5. removed
    status/in-review
    on Nov 15, 2026
  6. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-15 16:38 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p3-lowsource/agenttype/refactorvalue/low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions