fix: dashboard repo variable refresh on tier change #433

Merged
ldraney merged 1 commit from fix/dora-dashboard-nits into main 2026-06-14 11:34:57 +00:00
Owner

Summary

Change repo variable refresh from 2 (on time range change) to 1 (on dashboard load) so the repo dropdown re-queries when the tier variable changes.

Changes

  • terraform/dashboards/dora-dashboard.json: Changed refresh: 2 to refresh: 1 on the repo template variable

Rationale

The repo variable query is label_values(dora_pr_merges_total{tier=~"$tier"}, repo) -- it references $tier. With refresh: 2, it only re-executes on time range changes, not on tier variable changes. With refresh: 1 (on dashboard load), Grafana cascades re-queries to dependent variables when the upstream variable changes, which is the standard pattern for chained variables.

Test Plan

  • Open DORA Metrics dashboard in Grafana
  • Change the Tier dropdown from "Tier 1" to "All"
  • Verify the repo dropdown updates to show repos from the new tier
  • Nit from post-merge review of PR #432

🤖 Generated with Claude Code

## Summary Change repo variable refresh from `2` (on time range change) to `1` (on dashboard load) so the repo dropdown re-queries when the tier variable changes. ## Changes - `terraform/dashboards/dora-dashboard.json`: Changed `refresh: 2` to `refresh: 1` on the `repo` template variable ## Rationale The repo variable query is `label_values(dora_pr_merges_total{tier=~"$tier"}, repo)` -- it references `$tier`. With `refresh: 2`, it only re-executes on time range changes, not on tier variable changes. With `refresh: 1` (on dashboard load), Grafana cascades re-queries to dependent variables when the upstream variable changes, which is the standard pattern for chained variables. ## Test Plan - [ ] Open DORA Metrics dashboard in Grafana - [ ] Change the Tier dropdown from "Tier 1" to "All" - [ ] Verify the repo dropdown updates to show repos from the new tier ## Related - Nit from post-merge review of PR #432 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix: set repo variable refresh to on-dashboard-load
All checks were successful
ci/woodpecker/push/terraform Pipeline was successful
ci/woodpecker/pr/terraform Pipeline was successful
ci/woodpecker/pull_request_closed/terraform Pipeline was successful
973ed6d3af
The repo variable query uses $tier, so it depends on the tier variable.
With refresh: 2 (on time range change), the repo dropdown would not
re-query when tier selection changed without also changing the time
range. Change to refresh: 1 (on dashboard load) which is the standard
Grafana pattern for dependent variables -- Grafana cascades the
re-query automatically when the referenced variable changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Owner

PR #433 Review

DOMAIN REVIEW

Stack: Grafana dashboard JSON managed via Terraform.

The change is correct. The repo template variable's query references $tier via label_values(dora_pr_merges_total{tier=~"$tier"}, repo), making it a dependent/chained variable. Grafana's refresh field semantics:

Value Behavior
0 Never
1 On dashboard load (+ upstream variable change cascade)
2 On time range change only

With refresh: 2, changing the tier dropdown did not trigger a re-query of the repo dropdown -- users would see stale repo options until the time range changed. With refresh: 1, Grafana correctly cascades re-queries to dependent variables when $tier changes. This is the standard Grafana pattern for chained template variables.

No Terraform state risk -- dashboard JSON is a declarative resource definition. Applying this change simply updates the dashboard in-place.

BLOCKERS

None.

NITS

None.

SOP COMPLIANCE

  • PR body has Summary, Changes, Rationale, Test Plan, Related
  • No secrets or credentials in diff
  • No scope creep -- single-line fix targeting the exact nit from PR #432 review
  • Commit message is descriptive (fix: dashboard repo variable refresh on tier change)
  • Test plan is appropriate (manual Grafana verification -- no programmatic test exists for dashboard variable cascade behavior)

PROCESS OBSERVATIONS

Clean nit-to-fix cycle: post-merge review of PR #432 identified the issue, this PR addresses it in isolation. Low change failure risk -- the fix aligns with documented Grafana behavior for chained variables.

VERDICT: APPROVED

## PR #433 Review ### DOMAIN REVIEW **Stack:** Grafana dashboard JSON managed via Terraform. The change is correct. The `repo` template variable's query references `$tier` via `label_values(dora_pr_merges_total{tier=~"$tier"}, repo)`, making it a dependent/chained variable. Grafana's `refresh` field semantics: | Value | Behavior | |-------|----------| | 0 | Never | | 1 | On dashboard load (+ upstream variable change cascade) | | 2 | On time range change only | With `refresh: 2`, changing the `tier` dropdown did not trigger a re-query of the `repo` dropdown -- users would see stale repo options until the time range changed. With `refresh: 1`, Grafana correctly cascades re-queries to dependent variables when `$tier` changes. This is the standard Grafana pattern for chained template variables. No Terraform state risk -- dashboard JSON is a declarative resource definition. Applying this change simply updates the dashboard in-place. ### BLOCKERS None. ### NITS None. ### SOP COMPLIANCE - [x] PR body has Summary, Changes, Rationale, Test Plan, Related - [x] No secrets or credentials in diff - [x] No scope creep -- single-line fix targeting the exact nit from PR #432 review - [x] Commit message is descriptive (`fix: dashboard repo variable refresh on tier change`) - [x] Test plan is appropriate (manual Grafana verification -- no programmatic test exists for dashboard variable cascade behavior) ### PROCESS OBSERVATIONS Clean nit-to-fix cycle: post-merge review of PR #432 identified the issue, this PR addresses it in isolation. Low change failure risk -- the fix aligns with documented Grafana behavior for chained variables. ### VERDICT: APPROVED
ldraney deleted branch fix/dora-dashboard-nits 2026-06-14 11:34:57 +00:00
Sign in to join this conversation.
No description provided.