Add MCP route_setting contract specs for API tool endpoints

What does this MR do and why?

The REST API endpoints exposed as MCP tools via route_setting :mcp (issues, merge requests, pipelines, job log) had no spec asserting their per-endpoint MCP contract. The generic ApiTool spec covers the route→schema transformation, but a change to a specific endpoint's tool_name or exposed params would fail no test. This applies the existing 'an endpoint with mcp route setting' shared example to each MCP-enabled endpoint so that contract is pinned next to the route.

Spec-only. Stacked on !240451 (merged) — target branch is mcp-list-tools-spec-self-updating; it will auto-retarget to master once that merges.

References

  • Stacked on top of !240451 (merged) (MCP tools/list self-updating + tool schema locks).
What's covered

The 'an endpoint with mcp route setting' shared example now takes an optional expected status, and is applied to:

Endpoint tool_name status
GET …/issues/:iid get_issue 200
POST …/issues create_issue 201
POST …/merge_requests create_merge_request 201
GET …/merge_requests/:iid get_merge_request 200
GET …/merge_requests/:iid/commits get_merge_request_commits 200
GET …/merge_requests/:iid/diffs get_merge_request_diffs 200
GET …/merge_requests/:iid/pipelines get_merge_request_pipelines 200
GET …/jobs/:id/trace get_job_log 200
GET …/pipelines list_pipelines 200
GET …/pipelines/:id/jobs get_pipeline_jobs 200
POST …/pipeline create_pipeline 201
PUT …/pipelines/:id/metadata update_pipeline 200
DELETE …/pipelines/:id delete_pipeline 204
POST …/pipelines/:id/retry retry_pipeline 201
POST …/pipelines/:id/cancel cancel_pipeline 200

The gitlab_search_in_* routes already had this coverage; semantic_code_search is EE.

Screenshots or screen recordings

No UI changes.

How to set up and validate locally

  1. Run the new contract examples:
    bundle exec rspec spec/requests/api/issues/get_project_issues_spec.rb spec/requests/api/issues/post_projects_issues_spec.rb spec/requests/api/merge_requests_spec.rb spec/requests/api/ci/jobs_spec.rb spec/requests/api/ci/pipelines_spec.rb -e "mcp route setting"
  2. Sanity-check the guard: change a route_setting :mcp tool_name/params in lib/api/... and confirm the matching example fails.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading