grafana / grafonnet

Jsonnet library for generating Grafana dashboards.
https://grafana.github.io/grafonnet/
Apache License 2.0
352 stars 19 forks source link

refactor(util/grid): rewrite makegrid() with helper functions #158

Closed Duologic closed 9 months ago

Duologic commented 9 months ago

This PR rewrites util.grid.makeGrid() to use the helper functions from util.panel introduced in #155, this could serve as an example on how to use these functions to create other grid builders.

This PR can be reviewed commit-by-commit, following a proper TDD approach:

  1. introduce unit tests, this surfaces a few minor bugs in the current makeGrid() (see failing tests)
  2. fixes the current makeGrid() to pass the unit tests
  3. fixes runtimeDashboard smoke tests to match this change in behavior
  4. the actual refactor, this time only the smoke tests fail
  5. fixes redMethod smoke test, this test surfaced a bug in the refactor
  6. fixes runtimeDashboard smoke test, this test surfaced a bug in the current makeGrid(), incorrectly calculating the Y for collapsed row panels