feat(named-queries): add context_for_issue, context_for_review, and context_for_job

What does this MR do and why?

Adds three named queries shaped like the tasks agents get: picking up an issue, reviewing a merge request, and fixing a failed CI job. The context endpoint can expand entities with these instead of the generic neighborhood queries. The SDLC eval GitLab already serves them.

Needed by the Rails context endpoint change that adds job tokens and task-shaped expansions.

Testing

Each query has a JSON and a GQL spelling with an example, so the existing check that every named query compiles the same in both languages covers them. CI runs it.

Performance Analysis

  • This merge request does not introduce any performance regression. If a performance regression is expected, explain why.

Each is one graph query with a caller-set limit, like the expand queries.

Agent context: long-form analysis, file-by-file walkthroughs, profiler output, alternatives considered

Queries

  • context_for_issue: neighbors of a work item, as in expand_work_item, plus the merge requests and work items it mentions or that mention it.
  • context_for_review: neighbors of a merge request, as in expand_merge_request, plus approvers, the merge commit, and mentioned merge requests and work items.
  • context_for_job: the job's pipeline and every failed job in it, with failure reason and allow-failure.

Scope

  • Text such as descriptions, review threads, and job logs is not in the graph; the caller adds it.

Related to https://gitlab.com/gitlab-org/orbit/knowledge-graph/-/work_items/1260

Edited by Michael Angelo Rivera

Merge request reports

Loading
Loading