Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,332
    • Merge requests 1,332
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #335391
Closed
Open
Issue created Jul 07, 2021 by Adam Hegyi@ahegyiMaintainer

[VSA] Implement the new DB queries

What

With the new database structure in place, we need to implement the query backend. We can implement a switch in lib/gitlab/analytics/cycle_analytics/base_query_builder.rb so we can optionally use the new database and queries.

How

Implement finder classes for the new database tables created in #335386 (closed)

We need two separate finder classes for the following tables:

  • analytics_cycle_analytics_merge_request_stage_events
  • analytics_cycle_analytics_issue_stage_events

We can start with a base class because the two finders might diverge a bit later.

The following query params we need to support (ideally avoiding joins):

  • stage_hash_id
    • This parameter is always required
  • root_group_id, group_id, project_id: one of them is always required
  • author_username
    • Find the author(s) from the DB and take the id(s). Query the author_id column.
  • milestone_title
    • Find the milestone(s) from the DB and take the id(s). Query the milestone_id column.
  • start_event_timestamp (greater than)
    • Query the start_event_timestamp column
  • end_event_timestamp (less than)
    • Query the end_event_timestamp column
Edited Jul 12, 2021 by Adam Hegyi
Assignee
Assign to
Time tracking