Add additional filters to issuesCompletedCount
Problem
We currently have a limited filter set available on the issuesCompletedCount
metric. We need filters available which match what we currently offer in Issues Analytics.
Solution
Add the following filters to the metrics:
reactions
epics
iterations
weights
The issuesCompletedCount
uses aggregated VSA which means that some data must be duplicated from the issues
table into the analytics_cycle_analytics_issue_stage_events
table.
- Reactions: 1:N relation to
award_emoji
table. We don't have a way to de-normalize this data to fit into our aggregated table. We need to use a join for now: see how we filter thelabels
. (https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/analytics/cycle_analytics/aggregated/base_query_builder.rb#L36) - epics: same as reactions
- iterations: add the sprint_id column
- weight: add the weight column
itearations
and weights
:
- Add the
sprint_id
andweight
columns to theanalytics_cycle_analytics_issue_stage_events
- Override the
upsert_data
method coming fromStageEventModel
to include the two new column - In the DataLoaderService select the two new column when aggregating issues.
- In the
BaseQueryBuilder
, implement simple filters:query.where(iteration_id: 1)
New data will start showing up once the MR is deployed. Old data will be eventually migrated by the aggregation framework.
reactions
and epics
:
- Extend the
BaseQueryBuilder
class to handle these two filters. - Join the table with
analytics_cycle_analytics_issue_stage_events
(we know the issue id here) and implement the filter.
Note: We probably need to also implement the negated version of these filters.
Edited by Adam Hegyi