Skip to content

Main graph v2 backend#6173

Draft
RobertJoonas wants to merge 9 commits intomasterfrom
main-graph-v2-backend
Draft

Main graph v2 backend#6173
RobertJoonas wants to merge 9 commits intomasterfrom
main-graph-v2-backend

Conversation

@RobertJoonas
Copy link
Contributor

Changes

A cleaned up, rebased version of #6152, including only the backend changes to support migrating main graph to the API v2 based /query endpoint.

While the backend part is done, this PR is not ready to be deployed as it would break the main graph on the dashboard without the necessary frontend changes. Those are currently being implemented in #6159.

Summary of changes introduced in this PR:

  • When include.time_labels is set, also include meta.time_label_result_indices (right next to meta.time_labels themselves). This helps to avoid searching for rows corresponding to a time label on the client side.
  • Support returning comparisons in the API v2 response format. This was tricky to figure out. More on that in the description of Move main graph to new API v2 endpoint #6152.
  • Remove the main graph endpoint
  • A major rewrite of main_graph_test.exs - populate_stats and other tests setup remained mostly the same, but the request is now made against the new endpoint and the assertions on the returned data structures have changed significantly.
  • Remove comparisons logic from legacy timeseries (see commit with description 7ad120a)

Tests

  • Automated tests have been added

Changelog

  • Entry has been added to changelog

Documentation

  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode

* Add a new response structure: a separate `comparison_results` field,
  used only when comparing in a time-dimensional query.

* Add `meta.time_label_result_indices` to response (exclusive to internal
  API). Makes it easier for FE to find buckets for time labels.
This is currently only used by the main graph, which is going to move to
a new endpoint in this PR.

* The CSV export is currently ignoring comparisons

* the `&compare=previous_period` option in Stats API v1 is ignored by
  the timeseries endpoint
@RobertJoonas RobertJoonas marked this pull request as draft March 18, 2026 12:56
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.

1 participant