Ir al contenido

Merge trains

Un merge train pone en cola los merge requests hacia una rama de destino y prueba cada uno junto con los que van delante antes de fusionarlo. Estas acciones listan los merge trains de un proyecto o el tren de una rama de destino, leen la entrada de un merge request en el tren y añaden un merge request a su tren.

  • “¿Qué hay en el merge train de main?”
  • “Añade el merge request !15 al merge train”
  • “¿En qué posición del tren está el merge request !15?”
  • Dinámica, la superficie predeterminada: llama a gitlab_execute_action con action igual al ID de la acción, como merge_train.add, y sus parámetros en params. gitlab_find_action encuentra un ID a partir de una descripción de la tarea.
  • Meta (GITLAB_MCP_TOOL_SURFACE=meta): llama a gitlab_merge_train con action igual al nombre de la acción, como add, y sus parámetros en params.
  • Individual (GITLAB_MCP_TOOL_SURFACE=individual): llama a la herramienta propia de la acción, como gitlab_add_merge_request_to_merge_train, pasándole directamente sus parámetros.

Cuántas de estas acciones sirve una instancia en cada nivel, de un total de 4:

  • Free: 0
  • Premium: 4
  • Ultimate: 4

Acciones de solo lectura: 3 de 4, las que conserva un despliegue en modo de solo lectura. A un token con read_api y sin api se le sirven 3 de las 4.

La descripción de cada acción, y la de cada uno de sus parámetros, es el texto que sirve el servidor para ella en la superficie predeterminada, citado tal cual; por eso está en inglés. Las líneas de token dicen lo que exige GitLab 19.4.1 a un token para las peticiones que envía cada acción; en una instancia con Admin Mode activado, una acción que solo puede ejecutar un administrador necesita además admin_mode.

AcciónIndividual
merge_train.addgitlab_add_merge_request_to_merge_train
merge_train.getgitlab_get_merge_request_on_merge_train
merge_train.list_branchgitlab_list_merge_request_in_merge_train
merge_train.list_projectgitlab_list_project_merge_trains

Add a merge request to a merge train. Returns: the resulting merge train entries with the merge request, user, pipeline, target branch, status, and duration. See also: merge_train.get, merge_train.list_branch, merge_train.list_project.

  • Meta-herramienta: gitlab_merge_train, acción add
  • Herramienta individual: gitlab_add_merge_request_to_merge_train
  • Nivel: Premium
  • Token clásico u OAuth: api
  • Token de grano fino: Merge Train Merge Request: Add en proyecto (página de permisos)
  • Comportamiento: escribe, no idempotente
ParámetroTipoRequeridoDescripción
merge_request_iidintegersíMerge request internal ID
project_idstring/integersíProject ID or URL-encoded path
auto_mergebooleannoEnable auto-merge when pipeline succeeds
shastringnoHead SHA of the merge request to verify
squashbooleannoSquash commits when merging
when_pipeline_succeedsbooleannoDeprecated in 17.11. Use auto_merge instead. Merge only when the pipeline succeeds

Get the merge train status of a single merge request. Returns: the merge train entry with the merge request, user, pipeline, target branch, status, and duration. See also: merge_train.list_project, merge_train.list_branch, merge_train.add.

  • Meta-herramienta: gitlab_merge_train, acción get
  • Herramienta individual: gitlab_get_merge_request_on_merge_train
  • Nivel: Premium
  • Token clásico u OAuth: read_api (o api)
  • Token de grano fino: Merge Train: Read en proyecto (página de permisos)
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
merge_request_iidintegersíMerge request internal ID
project_idstring/integersíProject ID or URL-encoded path

List the merge requests on a merge train for a target branch. Returns: merge train entries with the merge request, user, pipeline, status, duration, and pagination metadata. See also: merge_train.list_project, merge_train.get, merge_train.add.

  • Meta-herramienta: gitlab_merge_train, acción list_branch
  • Herramienta individual: gitlab_list_merge_request_in_merge_train
  • Nivel: Premium
  • Token clásico u OAuth: read_api (o api)
  • Token de grano fino: Merge Train: Read en proyecto (página de permisos)
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
project_idstring/integersíProject ID or URL-encoded path
target_branchstringsíTarget branch name
order_bystringnoColumn to order results by (keyset pagination)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoNext page of a keyset listing: the next_page_token of the previous response of this action, passed back unchanged. It carries the position and every filter of the listing as GitLab read them, and those are what the next page is asked with, whatever filters are sent beside it. Leave it empty for the first page.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost, and a keyset page names the next one in next_page_token rather than next_page.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
scopestring (active, complete)noFilter by scope: active, complete
sortstring (asc, desc)noSort order: asc or desc

List all merge trains in a project. Returns: merge train entries with the merge request, user, pipeline, target branch, status, duration, and pagination metadata. See also: merge_train.list_branch, merge_train.get, merge_train.add.

  • Meta-herramienta: gitlab_merge_train, acción list_project
  • Herramienta individual: gitlab_list_project_merge_trains
  • Nivel: Premium
  • Token clásico u OAuth: read_api (o api)
  • Token de grano fino: Merge Train: Read en proyecto (página de permisos)
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
project_idstring/integersíProject ID or URL-encoded path
order_bystringnoColumn to order results by (keyset pagination)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoNext page of a keyset listing: the next_page_token of the previous response of this action, passed back unchanged. It carries the position and every filter of the listing as GitLab read them, and those are what the next page is asked with, whatever filters are sent beside it. Leave it empty for the first page.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost, and a keyset page names the next one in next_page_token rather than next_page.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
scopestring (active, complete)noFilter by scope: active, complete
sortstring (asc, desc)noSort order: asc or desc