feat(analytics): add authorHuman filter for MR analytics

What does this MR do and why?

Adds an authorHuman filter to the merge request analytics source. The DAP impact dashboard can then compare Duo-created merge requests with a human baseline: createdByDuo = false and authorHuman = true.

authorHuman maps to the authorHuman: [Boolean!] argument that gitlab!262410 (merged) adds to the mergeRequests aggregation engine. That argument is true when the merge request has an author whose user type is human. Bots, service accounts and every other non-human type are looked up from a ClickHouse dictionary. Merge requests with no author count as not human.

  • Filter only. The engine has no author_human dimension, so authorHuman can't be used in dimensions or sort. Tests check both are rejected.
  • != works. authorHuman != true compiles to authorHuman: [false], through the same boolean flip createdByDuo uses, so no authorHumanNot argument is generated.
  • Use it only on the non-Duo side. Flows that run remotely open merge requests as a service account, so authorHuman = true on a createdByDuo = true query would drop most Duo-created merge requests.

Release order: merge gitlab!262410 (merged) first. Until it is on gitlab master, the graphql-validate job here fails with Unknown argument authorHuman, because it validates against master's schema. GitLab should only bump to a GLQL release with this change after gitlab!262410 (merged) is deployed.

Example Usage

Non-Duo, human cycle time (the dashboard baseline)

mode: analytics
query: type = MergeRequest and createdByDuo = false and authorHuman = true and merged >= "2026-09-15" and merged <= "2026-10-15"
metrics: timeToMergeQuantile(0.5) as "Median", timeToMergeQuantile(0.75) as "p75", throughputCount
Generated GraphQL

Compiled with glql::compile and the context {"group": "gitlab-org", "mode": "analytics", ...}. Executing it against gitlab.com has to wait until gitlab!262410 (merged) is deployed.

query GLQL($before: String, $after: String, $limit: Int) {
  group(fullPath: "gitlab-org") {
    analytics {
      mergeRequests(createdByDuo: [false], authorHuman: [true], metricMergedAtFrom: "2026-09-15 00:00", metricMergedAtTo: "2026-10-15 23:59") {
        aggregated(before: $before, after: $after, first: $limit) {
          count
          pageInfo {
            startCursor
            endCursor
            hasNextPage
            hasPreviousPage
          }
          nodes {
            timeToMerge {
              timeToMergeQuantile_quantile_0_d5: quantile(quantile: 0.5)
            }
            timeToMerge {
              timeToMergeQuantile_quantile_0_d75: quantile(quantile: 0.75)
            }
            throughputCount
          }
        }
      }
    }
  }
}

How to set up and validate locally

  1. Run cargo test --test merge_request_analytics_tests author_human.
  2. Compile the query above with glql::compile (or Glql.compile from glql_rb) and check that the output contains authorHuman: [true].

References

🤖 Generated with Claude Code

Edited by Serhii Yarynovskyi

Merge request reports

Loading
Loading