Add licensed filters to VSA

What does this MR do and why?

This change adds licensed filters (only available for the paid tiers) to the VSA GraphQL API.

The following filters are added:

  • epicId
  • iterationId
  • weight
  • myReactionEmoji
  • not filters (negated):
    • assigneeUsernames
    • authorUsername
    • milestoneTitle
    • labelNames
    • epicId
    • iterationId
    • weight
    • myReactionEmoji

Some of these filters are not supported for merge request based stages so we're going to raise an error if user attempts to filter for it (example: merge request is not associated with an epic).

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Ensure that you're on premium or on ultimate plan.
  2. Seed VSA: FILTER=cycle_analytics SEED_VSA=1 bundle exec rake db:seed_fu
  3. Go to the generated group
  4. Pick a filter (for example reaction emoji). Add reaction emoji to a few issues or MRs.
  5. Make sure data is aggregated: Analytics::CycleAnalytics::IncrementalWorker.new.perform
  6. Invoke a GraphQL query (ids might be different)
query test {
  group(fullPath: "vsmg-1722585516") {
    id
    valueStreams(id: "gid://gitlab/Analytics::CycleAnalytics::ValueStream/6") {
      nodes {
        id
        stages(id: "gid://gitlab/Analytics::CycleAnalytics::Stage/31") {
          id
          name
          metrics(not: {myReactionEmoji: "thumbsup" }, timeframe: {start: "2024-05-01", end: "2024-09-30"}) {
            count {
              value
            }
          }
        }
      }
    }
  }
}

Related to #460671 (closed)

Edited by Adam Hegyi

Merge request reports

Loading