Add exact pipeline name filtering to GraphQL

What does this MR do and why?

Add experimental exact, case-sensitive pipeline-name filtering to Project.pipelines(name: String). The project-scoped pipeline_name_filter flag is disabled by default, and the experiment targets GitLab 19.6.

The shared finder and model query optimizations, with their tests, have moved to !262458 (merged). The shared connection token authorization, its request coverage, and the generated fine-grained token reference are now in !262500 (merged). This MR is blocked by both prerequisites. The UI and user guide are in !262417 (merged); shared frontend fixes are in !262412 (merged).

Merge this backend MR before !262417 (merged). Deploy the backend GraphQL argument everywhere before enabling pipeline_name_filter.

Backend behavior and review scope

When the project flag is disabled, the resolver ignores name before applying name-specific authorization or count validation. Other filters and the existing count contract remain intact. With the flag enabled, non-blank names require read_build; name-filtered counts require an explicit limit from 1 to 1000, including aliases and fragments. Explicit null count limits remain invalid under the existing API contract.

The shared authorize_granular_token declaration and its generated permission reference have been removed from this diff. Their Application Security review continues in the authorization prerequisite. The feature-specific read_build check and name-count validation remain here. The authorization and database prerequisites can merge in either order.

The four DB model/finder files now match this MR's original base exactly. Existing Ci::PipelinesFinder name support remains available, but the optimized queries must land through the database prerequisite before this feature merges. The production-scale query review continues in that MR with its before/after REST SQL packs and pending Database Lab rerun.

After removing the database and shared token authorization changes, the EE GraphQL request suite passed 117 examples with zero failures and two existing pending examples. Flag-off coverage includes other filters, project actor isolation, existing count limits, and external CI access. GraphQL reference and introspection were regenerated. This update adds ordinary commits and preserves the existing review history. Full merged-results CI remains pending both prerequisites.

References

Screenshots or screen recordings

Not applicable to this backend MR. UI screenshots and the user guide accompany !262417 (merged).

How to set up and validate locally

  1. Integrate the database and authorization prerequisites. Use a project with pipelines named Nightly build and Nightly build extended through workflow:name.
  2. Enable the project flag in the Rails console: Feature.enable(:pipeline_name_filter, Project.find_by_full_path('your-group/your-project')).
  3. Query project(fullPath: "your-group/your-project") { pipelines(name: "Nightly build") { nodes { id } count(limit: 1000) } }. Check that only the exact, case-sensitive name matches.
  4. Combine the name with existing filters and pagination. Request a named count without a limit and check the argument error.
  5. Compare users with and without project build access. Verify that inaccessible names return no records or count, including count-only requests.
  6. Disable the project flag and send a name together with another filter. Check that name is ignored while the other filter and existing count behavior remain intact.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Aleksandr Kotlyar

Merge request reports

Loading
Loading