mcp-gitlabpr 1.0.1__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: mcp-gitlabpr
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: MCP server para merge requests do GitLab (API v4, CE 10.8+): listar, obter, criar e mesclar, só no projeto do workspace
5
- Project-URL: Repository, https://github.com/dxaraujo/kiro/tree/main/mcps/gitlabpr
5
+ Project-URL: Repository, https://github.com/dxaraujo/mcp-gitlabpr
6
6
  Author-email: Daniel Xavier Araújo <danielxaraujo@gmail.com>
7
7
  License-Expression: MIT
8
8
  License-File: LICENSE
@@ -77,7 +77,7 @@ filtra por `author_id`/`assignee_id`.
77
77
  |---|---|
78
78
  | `gitlab_listar_mrs(pasta?, url_projeto?, estado=opened, busca?, origem?, destino?, autor?, responsavel?, limite≤100, pagina=1)` | MRs do projeto. Devolve `total`, `proxima_pagina` e os itens resumidos |
79
79
  | `gitlab_obter_mr(iid, pasta?, url_projeto?, diffs=false)` | Detalhes do MR (descrição, labels, conflitos, merge). Com `diffs`, os arquivos alterados e o diff de cada um, cortado em 4000 caracteres |
80
- | `gitlab_criar_mr(titulo, destino, pasta?, url_projeto?, origem?, descricao?, responsavel?, labels?, remover_origem=false)` | Cria o MR; a branch de origem precisa já estar no GitLab (`git push`). Se já existe um MR aberto entre as mesmas branches, o GitLab responde 409 |
80
+ | `gitlab_criar_mr(titulo, destino, pasta?, url_projeto?, origem?, descricao?, responsavel?, labels?, remover_origem=true)` | Cria o MR, já com "apagar a branch de origem após o merge" marcado (passe `remover_origem=false` para manter a branch); a branch de origem precisa já estar no GitLab (`git push`). Se já existe um MR aberto entre as mesmas branches, o GitLab responde 409 |
81
81
  | `gitlab_mesclar_mr(iid, pasta?, url_projeto?, sha?, remover_origem?, mensagem?)` | Faz o merge de um MR aberto; recusa antes de chamar o GitLab se ele está em WIP, tem conflito ou não é mesclável. Com `sha`, o GitLab recusa (409) se a branch recebeu commits depois desse commit |
82
82
 
83
83
  `estado` aceita `opened`, `closed`, `merged` ou `all`.
@@ -64,7 +64,7 @@ filtra por `author_id`/`assignee_id`.
64
64
  |---|---|
65
65
  | `gitlab_listar_mrs(pasta?, url_projeto?, estado=opened, busca?, origem?, destino?, autor?, responsavel?, limite≤100, pagina=1)` | MRs do projeto. Devolve `total`, `proxima_pagina` e os itens resumidos |
66
66
  | `gitlab_obter_mr(iid, pasta?, url_projeto?, diffs=false)` | Detalhes do MR (descrição, labels, conflitos, merge). Com `diffs`, os arquivos alterados e o diff de cada um, cortado em 4000 caracteres |
67
- | `gitlab_criar_mr(titulo, destino, pasta?, url_projeto?, origem?, descricao?, responsavel?, labels?, remover_origem=false)` | Cria o MR; a branch de origem precisa já estar no GitLab (`git push`). Se já existe um MR aberto entre as mesmas branches, o GitLab responde 409 |
67
+ | `gitlab_criar_mr(titulo, destino, pasta?, url_projeto?, origem?, descricao?, responsavel?, labels?, remover_origem=true)` | Cria o MR, já com "apagar a branch de origem após o merge" marcado (passe `remover_origem=false` para manter a branch); a branch de origem precisa já estar no GitLab (`git push`). Se já existe um MR aberto entre as mesmas branches, o GitLab responde 409 |
68
68
  | `gitlab_mesclar_mr(iid, pasta?, url_projeto?, sha?, remover_origem?, mensagem?)` | Faz o merge de um MR aberto; recusa antes de chamar o GitLab se ele está em WIP, tem conflito ou não é mesclável. Com `sha`, o GitLab recusa (409) se a branch recebeu commits depois desse commit |
69
69
 
70
70
  `estado` aceita `opened`, `closed`, `merged` ou `all`.
@@ -267,10 +267,10 @@ def gitlab_obter_mr(iid: int, pasta: str | None = None, url_projeto: str | None
267
267
  @tool
268
268
  def gitlab_criar_mr(titulo: str, destino: str, pasta: str | None = None, url_projeto: str | None = None,
269
269
  origem: str | None = None, descricao: str | None = None, responsavel: str | None = None,
270
- labels: list[str] | None = None, remover_origem: bool = False) -> dict:
270
+ labels: list[str] | None = None, remover_origem: bool = True) -> dict:
271
271
  """Cria um merge request de `origem` (padrão: branch atual do git) para `destino` no projeto do repositório
272
272
  git em `pasta`. A branch de origem precisa estar no GitLab (git push). responsavel: username.
273
- remover_origem: apaga a branch de origem após o merge. Falha (HTTP 409) se já existe MR aberto entre as branches."""
273
+ remover_origem (padrão: sim): o MR já nasce com 'apagar a branch de origem após o merge' marcado; passe False para manter a branch. Falha (HTTP 409) se já existe MR aberto entre as branches."""
274
274
  if not titulo.strip():
275
275
  raise ValueError("Informe `titulo`.")
276
276
  if url_projeto and not origem:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mcp-gitlabpr"
3
- version = "1.0.1"
3
+ version = "1.0.2"
4
4
  description = "MCP server para merge requests do GitLab (API v4, CE 10.8+): listar, obter, criar e mesclar, só no projeto do workspace"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -13,7 +13,7 @@ dependencies = [
13
13
  ]
14
14
 
15
15
  [project.urls]
16
- Repository = "https://github.com/dxaraujo/kiro/tree/main/mcps/gitlabpr"
16
+ Repository = "https://github.com/dxaraujo/mcp-gitlabpr"
17
17
 
18
18
  [project.scripts]
19
19
  mcp-gitlabpr = "mcp_gitlabpr.server:main"
@@ -93,8 +93,10 @@ def test_criar(fake):
93
93
  fake.routes[("POST", f"{API}/projects/g%2Fp/merge_requests")] = (201, MR)
94
94
  out = server.gitlab_criar_mr("Ajuste", "dev", origem="feat", responsavel="maria", labels=["a", "b"])
95
95
  assert json.loads(fake.calls[-1].body) == {"source_branch": "feat", "target_branch": "dev", "title": "Ajuste",
96
- "remove_source_branch": False, "assignee_id": 9, "labels": "a,b"}
96
+ "remove_source_branch": True, "assignee_id": 9, "labels": "a,b"}
97
97
  assert out["iid"] == 7
98
+ server.gitlab_criar_mr("Ajuste", "dev", origem="feat", remover_origem=False) # quem quiser manter a branch
99
+ assert json.loads(fake.calls[-1].body)["remove_source_branch"] is False
98
100
 
99
101
 
100
102
  def test_erros(fake):
File without changes
File without changes