Add negated filters to VSA
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
:
- Weight: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/22751/commands/73324
- Author: https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/22751/commands/73325
- Epic: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/22751/commands/73327
- Milestone: https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/22751/commands/73328
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
- Make sure that you're on premium or ultimate plan.
- See VSA with a new project
- 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
- Invoke the aggregation:
Analytics::CycleAnalytics::IncrementalWorker.new.perform
- Navigate to the Group -> Analyze -> Value Stream Analytics
- Open the request inspector and pick one of the
median
API call and copy it's URL. - Add the
¬[weight]=3
and see if the median value changes. - Add the
¬[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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Adam Hegyi