@zereight/mcp-gitlab 2.3.23-next.213 → 2.3.23-next.214
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.
- package/README.md +1 -0
- package/build/index.js +59 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@zereight/mcp-gitlab)
|
|
5
5
|
[](https://www.npmjs.com/package/@zereight/mcp-gitlab)
|
|
6
6
|
[](https://github.com/zereight/gitlab-mcp/blob/main/LICENSE)
|
|
7
|
+
[](https://scorecard.dev/viewer/?uri=github.com/zereight/gitlab-mcp)
|
|
7
8
|
[](https://deepwiki.com/zereight/gitlab-mcp)
|
|
8
9
|
[](https://mcptoplist.com/server/io.github.zereight%2Fgitlab-mcp)
|
|
9
10
|
[](https://mcpindex.ai/server/io-github-zereight-gitlab-mcp)
|
package/build/index.js
CHANGED
|
@@ -4528,22 +4528,72 @@ async function getMergeRequestApprovalState(projectId, mergeRequestIid) {
|
|
|
4528
4528
|
source_endpoint: "approval_state",
|
|
4529
4529
|
};
|
|
4530
4530
|
}
|
|
4531
|
+
// `conflictStatus` and `conflictFiles` are experimental fields (GitLab 19.4+); an
|
|
4532
|
+
// instance that lacks them answers with a validation error naming exactly these
|
|
4533
|
+
// fields, which getMergeRequestConflicts retries without.
|
|
4534
|
+
const EXPERIMENTAL_CONFLICT_FIELDS = new Set(["conflictStatus", "conflictFiles"]);
|
|
4535
|
+
function isUnsupportedConflictFieldsError(message) {
|
|
4536
|
+
const fields = [...message.matchAll(/Field '(\w+)' doesn't exist on type 'MergeRequest'/g)].map(match => match[1]);
|
|
4537
|
+
return fields.length > 0 && fields.every(field => EXPERIMENTAL_CONFLICT_FIELDS.has(field));
|
|
4538
|
+
}
|
|
4531
4539
|
/**
|
|
4532
|
-
* Get the conflicts of a merge request
|
|
4540
|
+
* Get the conflicts of a merge request.
|
|
4541
|
+
*
|
|
4542
|
+
* There is no REST endpoint for this; GitLab only exposes conflict data over
|
|
4543
|
+
* GraphQL. `conflicts` (a boolean) is stable, while `conflictStatus` and
|
|
4544
|
+
* `conflictFiles` are experimental (GitLab 19.4+), so instances that lack them
|
|
4545
|
+
* are retried with just `conflicts`.
|
|
4533
4546
|
*
|
|
4534
4547
|
* @param {string} projectId - The ID or URL-encoded path of the project
|
|
4535
4548
|
* @param {string | number} mergeRequestIid - The internal ID of the merge request
|
|
4536
4549
|
* @returns {Promise<Record<string, unknown>>} The merge request conflicts
|
|
4537
4550
|
*/
|
|
4538
4551
|
async function getMergeRequestConflicts(projectId, mergeRequestIid) {
|
|
4539
|
-
|
|
4540
|
-
const
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4552
|
+
const fullPath = await resolveProjectFullPath(projectId);
|
|
4553
|
+
const variables = { fullPath, iid: String(mergeRequestIid) };
|
|
4554
|
+
let data;
|
|
4555
|
+
try {
|
|
4556
|
+
data = await executeGraphQL(`query getMergeRequestConflicts($fullPath: ID!, $iid: String!) {
|
|
4557
|
+
project(fullPath: $fullPath) {
|
|
4558
|
+
mergeRequest(iid: $iid) {
|
|
4559
|
+
conflicts
|
|
4560
|
+
conflictStatus
|
|
4561
|
+
conflictFiles {
|
|
4562
|
+
ourPath
|
|
4563
|
+
theirPath
|
|
4564
|
+
content
|
|
4565
|
+
}
|
|
4566
|
+
}
|
|
4567
|
+
}
|
|
4568
|
+
}`, variables);
|
|
4569
|
+
}
|
|
4570
|
+
catch (error) {
|
|
4571
|
+
if (!(error instanceof Error) || !isUnsupportedConflictFieldsError(error.message)) {
|
|
4572
|
+
throw error;
|
|
4573
|
+
}
|
|
4574
|
+
data = await executeGraphQL(`query getMergeRequestConflicts($fullPath: ID!, $iid: String!) {
|
|
4575
|
+
project(fullPath: $fullPath) {
|
|
4576
|
+
mergeRequest(iid: $iid) {
|
|
4577
|
+
conflicts
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
}`, variables);
|
|
4581
|
+
}
|
|
4582
|
+
if (!data.project) {
|
|
4583
|
+
throw new Error(`Project not found or not accessible: ${fullPath}`);
|
|
4584
|
+
}
|
|
4585
|
+
if (!data.project.mergeRequest) {
|
|
4586
|
+
throw new Error(`Merge request !${mergeRequestIid} not found in project ${fullPath}`);
|
|
4587
|
+
}
|
|
4588
|
+
const { conflicts, conflictStatus, conflictFiles } = data.project.mergeRequest;
|
|
4589
|
+
const result = { has_conflicts: conflicts };
|
|
4590
|
+
if (conflictStatus !== undefined) {
|
|
4591
|
+
result.conflict_status = conflictStatus;
|
|
4592
|
+
}
|
|
4593
|
+
if (conflictFiles !== undefined) {
|
|
4594
|
+
result.conflict_files = conflictFiles;
|
|
4595
|
+
}
|
|
4596
|
+
return result;
|
|
4547
4597
|
}
|
|
4548
4598
|
async function getMergeRequestApprovalsFallback(projectId, mergeRequestIid) {
|
|
4549
4599
|
const approvalsUrl = new URL(`${getEffectiveApiUrl()}/projects/${encodeGitLabPathSegment(getEffectiveProjectId(projectId))}/merge_requests/${encodeGitLabPathSegment(mergeRequestIid)}/approvals`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zereight/mcp-gitlab",
|
|
3
|
-
"version": "2.3.23-next.
|
|
3
|
+
"version": "2.3.23-next.214",
|
|
4
4
|
"mcpName": "io.github.zereight/gitlab-mcp",
|
|
5
5
|
"description": "GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more",
|
|
6
6
|
"keywords": [
|