[VSA parity] Update the BG aggregation and query logic
VSA periodically collects data from the database and stores them in specialized database tables. The first step of the data collection is gathering all distinct (same start and end event ids) stages within the group hierarchy.
With the support of ProjectNamespace
, we need to extend the DistinctStageLoader
class to include stages associated with ProjectNamesapce
.
Task 1:
The current query uses group.self_and_descendants
which does not include ProjectNamespace
rows. We need to use a different query (maybe a recursive one) to include all namespace rows in the group hierarchy.
Ignore the ProjectStage
class. This will go away.
Task 2:
Update the VSA query backend (BaseQueryBuilder
) to support non-Group
namespaces. We have several cases where we check the class: is_a?(Group)
. This needs to be updated to check for Namespace
. See the PoC MR for more context: !101361 (diffs)