Skip to content

Add negated filters to VSA

Adam Hegyi requested to merge dev-419925-add-negated-filters-to-vsa into master

What does this MR do and why?

This MR adds negated filters to paid Value Stream Analytics. The change is not-user facing, eventually these will be added to the GraphQL API.

VSA uses separate aggregated tables to achieve better query performance, I tried to re-use the filters from the Issueable module as much I could.

Database

I don't expect high usage for the negated filters, here are a few plans from gitlab-org:

For the median aggregation, all rows in the stage needs to be read in the given time frame, the extra negated filters won't add too much overhead.

How to set up and validate locally

  1. Make sure that you're on premium or ultimate plan.
  2. See VSA with a new project
  3. Find the project and make some data changes:
      project = Project.find_by_path("vsmp-1695637902")
      project.issues.sample(3).each { |issue| issue.update!(weight: 3) }
      project.issues.sample(2).each { |issue| FactoryBot.create(:award_emoji, awardable: issue, user: User.first) } # assuming that the first user is the logged in user
  4. Invoke the aggregation: Analytics::CycleAnalytics::IncrementalWorker.new.perform
  5. Navigate to the Group -> Analyze -> Value Stream Analytics
  6. Open the request inspector and pick one of the median API call and copy it's URL.
  7. Add the &not[weight]=3 and see if the median value changes.
  8. Add the &not[my_reaction_emoji]=thumbsup param and see if the median value changes.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Adam Hegyi

Merge request reports