@zereight/mcp-gitlab 2.1.70 → 2.2.1

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.
Files changed (158) hide show
  1. package/README.ko.md +9 -5
  2. package/README.md +15 -11
  3. package/README.pt-BR.md +9 -5
  4. package/README.zh-CN.md +9 -5
  5. package/build/config.js +12 -4
  6. package/build/deprecated-env.js +63 -0
  7. package/build/index.js +430 -200
  8. package/build/oauth-device-flow.js +80 -0
  9. package/build/oauth.js +135 -18
  10. package/build/schemas.js +1 -1
  11. package/build/server/remote-http-stack.js +39 -0
  12. package/build/tools/discover-activation.js +38 -0
  13. package/build/tools/exposed-tools.js +35 -0
  14. package/build/tools/listed-tools.js +76 -0
  15. package/build/tools/registry.js +232 -63
  16. package/build/tools/tool-descriptions.js +3 -3
  17. package/build/tools/tool-profile.js +66 -0
  18. package/build/utils/compact-tool-allowlist.js +14 -0
  19. package/build/utils/logger.js +34 -12
  20. package/package.json +3 -3
  21. package/build/scripts/check-skill-sync.js +0 -143
  22. package/build/scripts/generate-server-card.js +0 -39
  23. package/build/scripts/generate-tool-coverage.js +0 -58
  24. package/build/scripts/generate-tool-docs.js +0 -430
  25. package/build/scripts/tool-coverage/coverage.js +0 -341
  26. package/build/scripts/tool-coverage/coverage.test.js +0 -142
  27. package/build/test/callback-proxy-tests.js +0 -321
  28. package/build/test/cli/args.test.js +0 -175
  29. package/build/test/cli/boolean-flags.test.js +0 -106
  30. package/build/test/cli/compact-mcp-result.test.js +0 -93
  31. package/build/test/cli/credentials.test.js +0 -153
  32. package/build/test/cli/exposure.test.js +0 -104
  33. package/build/test/cli/load-config-snapshot.js +0 -5
  34. package/build/test/cli/output.test.js +0 -74
  35. package/build/test/cli/replay-command.test.js +0 -37
  36. package/build/test/cli/router.test.js +0 -183
  37. package/build/test/client-pool-test.js +0 -109
  38. package/build/test/clients/client.js +0 -34
  39. package/build/test/clients/custom-header-client.js +0 -122
  40. package/build/test/clients/sse-client.js +0 -95
  41. package/build/test/clients/stdio-client.js +0 -113
  42. package/build/test/clients/streamable-http-client.js +0 -95
  43. package/build/test/config-allowed-groups.test.js +0 -97
  44. package/build/test/create-commit-actions.test.js +0 -102
  45. package/build/test/draft-note-schema.test.js +0 -44
  46. package/build/test/dynamic-api-url-allowlist.test.js +0 -121
  47. package/build/test/dynamic-api-url-test.js +0 -304
  48. package/build/test/dynamic-routing-tests.js +0 -495
  49. package/build/test/get-merge-request-discussion-schema.test.js +0 -30
  50. package/build/test/gitlab-api-tool-errors.test.js +0 -112
  51. package/build/test/gitlab-artifact-entry-schema.test.js +0 -44
  52. package/build/test/gitlab-diff-schema.test.js +0 -36
  53. package/build/test/gitlab-pipeline-schedule-schema.test.js +0 -32
  54. package/build/test/gitlab-tag-schema.test.js +0 -51
  55. package/build/test/group-milestone-schema.test.js +0 -45
  56. package/build/test/mcp-oauth-tests.js +0 -905
  57. package/build/test/mcp-server-name.test.js +0 -87
  58. package/build/test/merge-merge-request-schema.test.js +0 -75
  59. package/build/test/multi-server-test.js +0 -190
  60. package/build/test/no-proxy-integration-test.js +0 -183
  61. package/build/test/no-proxy-test.js +0 -149
  62. package/build/test/nullable-gitlab-response-fields.test.js +0 -37
  63. package/build/test/nullish-tool-arguments-schema.test.js +0 -118
  64. package/build/test/oauth-device-flow-tests.js +0 -450
  65. package/build/test/oauth-download-url.test.js +0 -157
  66. package/build/test/oauth-startup.test.js +0 -204
  67. package/build/test/oauth-tests.js +0 -428
  68. package/build/test/path-segment-encoding.test.js +0 -98
  69. package/build/test/remote-auth-simple-test.js +0 -277
  70. package/build/test/remote-auth-tests.js +0 -314
  71. package/build/test/response-masking.test.js +0 -445
  72. package/build/test/schema-tests.js +0 -1679
  73. package/build/test/server/metrics.test.js +0 -47
  74. package/build/test/server/request-helpers.test.js +0 -48
  75. package/build/test/server/version.test.js +0 -13
  76. package/build/test/sse-auth-guard.test.js +0 -96
  77. package/build/test/sse-session-limits.test.js +0 -273
  78. package/build/test/stateless/callback-proxy.test.js +0 -510
  79. package/build/test/stateless/client-id.test.js +0 -177
  80. package/build/test/stateless/codec.test.js +0 -328
  81. package/build/test/stateless/config-ttl.test.js +0 -149
  82. package/build/test/stateless/consumed-proxy-code-cache.test.js +0 -150
  83. package/build/test/stateless/session-id-integration.test.js +0 -675
  84. package/build/test/stateless/session-id.test.js +0 -157
  85. package/build/test/streamable-http-concurrent-session.test.js +0 -171
  86. package/build/test/streamable-http-dns-rebinding.test.js +0 -185
  87. package/build/test/streamable-http-sse-stream.test.js +0 -350
  88. package/build/test/streamable-http-static-token-auth.test.js +0 -157
  89. package/build/test/streamable-http-unauthenticated-discovery.test.js +0 -207
  90. package/build/test/test-all-transport-server.js +0 -255
  91. package/build/test/test-auth-retry.js +0 -195
  92. package/build/test/test-blank-filters.js +0 -156
  93. package/build/test/test-ci-catalog.js +0 -177
  94. package/build/test/test-ci-lint.js +0 -191
  95. package/build/test/test-ci-variables.js +0 -309
  96. package/build/test/test-create-repository.js +0 -120
  97. package/build/test/test-dependency-proxy.js +0 -195
  98. package/build/test/test-deployment-tools.js +0 -463
  99. package/build/test/test-download-attachment.js +0 -190
  100. package/build/test/test-dynamic-project-scope.js +0 -524
  101. package/build/test/test-empty-toolsets.js +0 -535
  102. package/build/test/test-get-file-blame.js +0 -145
  103. package/build/test/test-get-file-contents.js +0 -128
  104. package/build/test/test-geteffectiveprojectid.js +0 -804
  105. package/build/test/test-health-check.js +0 -115
  106. package/build/test/test-issue-description-patch.js +0 -256
  107. package/build/test/test-job-artifacts.js +0 -275
  108. package/build/test/test-json-schema.js +0 -166
  109. package/build/test/test-list-group-members.js +0 -150
  110. package/build/test/test-list-group-merge-requests.js +0 -165
  111. package/build/test/test-list-issues.js +0 -170
  112. package/build/test/test-list-merge-requests.js +0 -201
  113. package/build/test/test-list-milestones.js +0 -145
  114. package/build/test/test-list-project-members.js +0 -132
  115. package/build/test/test-merge-request-approval-state-tools.js +0 -213
  116. package/build/test/test-merge-request-approvals.js +0 -187
  117. package/build/test/test-merge-request-pipelines.js +0 -106
  118. package/build/test/test-mr-diffs-filter.js +0 -132
  119. package/build/test/test-mr-file-diffs.js +0 -251
  120. package/build/test/test-oauth-proxy-rate-limit.js +0 -133
  121. package/build/test/test-orbit.js +0 -155
  122. package/build/test/test-permission-mode.js +0 -424
  123. package/build/test/test-pipeline-schedules.js +0 -484
  124. package/build/test/test-protected-branches.js +0 -174
  125. package/build/test/test-remote-downloads.js +0 -510
  126. package/build/test/test-search-code.js +0 -275
  127. package/build/test/test-snippets.js +0 -735
  128. package/build/test/test-tags.js +0 -220
  129. package/build/test/test-todos.js +0 -195
  130. package/build/test/test-token-optimizations.js +0 -691
  131. package/build/test/test-toolset-filtering.js +0 -499
  132. package/build/test/test-update-issue-slim.js +0 -141
  133. package/build/test/test-update-project.js +0 -112
  134. package/build/test/test-upload-markdown.js +0 -206
  135. package/build/test/test-vulnerabilities.js +0 -399
  136. package/build/test/test-webhooks.js +0 -218
  137. package/build/test/tool-description-quality.test.js +0 -50
  138. package/build/test/utils/bulk-publish-options.test.js +0 -32
  139. package/build/test/utils/download-token.test.js +0 -35
  140. package/build/test/utils/forwarded-public-base-url.test.js +0 -46
  141. package/build/test/utils/gitlab-instance-version.test.js +0 -32
  142. package/build/test/utils/gitlab-version-gate.test.js +0 -74
  143. package/build/test/utils/graphql-query.test.js +0 -168
  144. package/build/test/utils/helpers-path.test.js +0 -104
  145. package/build/test/utils/jmespath-tool-result.test.js +0 -91
  146. package/build/test/utils/masking.test.js +0 -384
  147. package/build/test/utils/merge-request-position.test.js +0 -57
  148. package/build/test/utils/mock-gitlab-server.js +0 -614
  149. package/build/test/utils/proxy-client-ip.test.js +0 -28
  150. package/build/test/utils/redact-sensitive.test.js +0 -32
  151. package/build/test/utils/safe-redirect-fetch.test.js +0 -463
  152. package/build/test/utils/server-launcher.js +0 -231
  153. package/build/test/utils/tool-args.test.js +0 -210
  154. package/build/test/utils/url.test.js +0 -141
  155. package/build/test/utils/version-check.test.js +0 -239
  156. package/build/test/utils/wiki-title.test.js +0 -21
  157. package/build/test-note.js +0 -54
  158. package/build/test-resolve-issue-note.js +0 -127
@@ -1,149 +0,0 @@
1
- /**
2
- * NO_PROXY Test Suite
3
- * Tests NO_PROXY pattern matching and proxy bypass functionality
4
- */
5
- import { describe, test } from 'node:test';
6
- import assert from 'node:assert';
7
- import { GitLabClientPool } from '../gitlab-client-pool.js';
8
- console.log('🚫 NO_PROXY Test Suite');
9
- console.log('');
10
- describe('NO_PROXY Pattern Matching', () => {
11
- test('should bypass proxy for exact hostname match', () => {
12
- const pool = new GitLabClientPool({
13
- httpProxy: 'http://proxy.example.com:8080',
14
- httpsProxy: 'http://proxy.example.com:8080',
15
- noProxy: 'gitlab.internal.com',
16
- });
17
- // Create agent for the NO_PROXY matched host
18
- const agent = pool.getOrCreateAgentForUrl('https://gitlab.internal.com/api/v4');
19
- // The agent should NOT be a proxy agent
20
- // It should be a standard HTTPS agent
21
- assert.ok(agent, 'Agent should be created');
22
- assert.strictEqual(agent.constructor.name, 'Agent', 'Should be a standard Agent, not a proxy agent');
23
- });
24
- test('should use proxy for non-matching hostname', () => {
25
- const pool = new GitLabClientPool({
26
- httpProxy: 'http://proxy.example.com:8080',
27
- httpsProxy: 'http://proxy.example.com:8080',
28
- noProxy: 'gitlab.internal.com',
29
- });
30
- // Create agent for a host that should use proxy
31
- const agent = pool.getOrCreateAgentForUrl('https://gitlab.external.com/api/v4');
32
- // The agent should be a proxy agent
33
- assert.ok(agent, 'Agent should be created');
34
- assert.notStrictEqual(agent.constructor.name, 'Agent', 'Should be a proxy agent, not standard Agent');
35
- });
36
- test('should bypass proxy for domain suffix match', () => {
37
- const pool = new GitLabClientPool({
38
- httpProxy: 'http://proxy.example.com:8080',
39
- httpsProxy: 'http://proxy.example.com:8080',
40
- noProxy: '.internal.com',
41
- });
42
- // Test multiple subdomains
43
- const agent1 = pool.getOrCreateAgentForUrl('https://gitlab.internal.com/api/v4');
44
- const agent2 = pool.getOrCreateAgentForUrl('https://api.internal.com/api/v4');
45
- const agent3 = pool.getOrCreateAgentForUrl('https://dev.gitlab.internal.com/api/v4');
46
- assert.strictEqual(agent1.constructor.name, 'Agent', 'gitlab.internal.com should bypass proxy');
47
- assert.strictEqual(agent2.constructor.name, 'Agent', 'api.internal.com should bypass proxy');
48
- assert.strictEqual(agent3.constructor.name, 'Agent', 'dev.gitlab.internal.com should bypass proxy');
49
- });
50
- test('should bypass proxy for localhost', () => {
51
- const pool = new GitLabClientPool({
52
- httpProxy: 'http://proxy.example.com:8080',
53
- httpsProxy: 'http://proxy.example.com:8080',
54
- noProxy: 'localhost,127.0.0.1',
55
- });
56
- const agent1 = pool.getOrCreateAgentForUrl('http://localhost:8080/api/v4');
57
- const agent2 = pool.getOrCreateAgentForUrl('http://127.0.0.1:8080/api/v4');
58
- assert.strictEqual(agent1.constructor.name, 'Agent', 'localhost should bypass proxy');
59
- assert.strictEqual(agent2.constructor.name, 'Agent', '127.0.0.1 should bypass proxy');
60
- });
61
- test('should bypass proxy for wildcard pattern', () => {
62
- const pool = new GitLabClientPool({
63
- httpProxy: 'http://proxy.example.com:8080',
64
- httpsProxy: 'http://proxy.example.com:8080',
65
- noProxy: '*',
66
- });
67
- const agent = pool.getOrCreateAgentForUrl('https://gitlab.com/api/v4');
68
- assert.strictEqual(agent.constructor.name, 'Agent', 'Wildcard should bypass all proxies');
69
- });
70
- test('should handle multiple NO_PROXY patterns', () => {
71
- const pool = new GitLabClientPool({
72
- httpProxy: 'http://proxy.example.com:8080',
73
- httpsProxy: 'http://proxy.example.com:8080',
74
- noProxy: 'localhost,.internal.com,192.168.1.1',
75
- });
76
- const agent1 = pool.getOrCreateAgentForUrl('http://localhost/api/v4');
77
- const agent2 = pool.getOrCreateAgentForUrl('https://gitlab.internal.com/api/v4');
78
- const agent3 = pool.getOrCreateAgentForUrl('http://192.168.1.1/api/v4');
79
- const agent4 = pool.getOrCreateAgentForUrl('https://gitlab.com/api/v4');
80
- assert.strictEqual(agent1.constructor.name, 'Agent', 'localhost should bypass proxy');
81
- assert.strictEqual(agent2.constructor.name, 'Agent', '.internal.com should bypass proxy');
82
- assert.strictEqual(agent3.constructor.name, 'Agent', '192.168.1.1 should bypass proxy');
83
- assert.notStrictEqual(agent4.constructor.name, 'Agent', 'gitlab.com should use proxy');
84
- });
85
- test('should handle NO_PROXY with whitespace', () => {
86
- const pool = new GitLabClientPool({
87
- httpProxy: 'http://proxy.example.com:8080',
88
- httpsProxy: 'http://proxy.example.com:8080',
89
- noProxy: ' localhost , .internal.com , 192.168.1.1 ',
90
- });
91
- const agent1 = pool.getOrCreateAgentForUrl('http://localhost/api/v4');
92
- const agent2 = pool.getOrCreateAgentForUrl('https://gitlab.internal.com/api/v4');
93
- assert.strictEqual(agent1.constructor.name, 'Agent', 'Should handle whitespace in NO_PROXY');
94
- assert.strictEqual(agent2.constructor.name, 'Agent', 'Should handle whitespace in NO_PROXY');
95
- });
96
- test('should work without NO_PROXY set', () => {
97
- const pool = new GitLabClientPool({
98
- httpProxy: 'http://proxy.example.com:8080',
99
- httpsProxy: 'http://proxy.example.com:8080',
100
- });
101
- const agent = pool.getOrCreateAgentForUrl('https://gitlab.com/api/v4');
102
- // Should use proxy when NO_PROXY is not set
103
- assert.notStrictEqual(agent.constructor.name, 'Agent', 'Should use proxy when NO_PROXY is not set');
104
- });
105
- test('should work with NO_PROXY set but empty', () => {
106
- const pool = new GitLabClientPool({
107
- httpProxy: 'http://proxy.example.com:8080',
108
- httpsProxy: 'http://proxy.example.com:8080',
109
- noProxy: '',
110
- });
111
- const agent = pool.getOrCreateAgentForUrl('https://gitlab.com/api/v4');
112
- // Should use proxy when NO_PROXY is empty
113
- assert.notStrictEqual(agent.constructor.name, 'Agent', 'Should use proxy when NO_PROXY is empty');
114
- });
115
- test('should handle port-specific patterns', () => {
116
- const pool = new GitLabClientPool({
117
- httpProxy: 'http://proxy.example.com:8080',
118
- httpsProxy: 'http://proxy.example.com:8080',
119
- noProxy: 'gitlab.internal.com:443',
120
- });
121
- const agent1 = pool.getOrCreateAgentForUrl('https://gitlab.internal.com/api/v4'); // HTTPS uses port 443 by default
122
- const agent2 = pool.getOrCreateAgentForUrl('http://gitlab.internal.com/api/v4'); // HTTP uses port 80 by default
123
- assert.strictEqual(agent1.constructor.name, 'Agent', 'Should bypass proxy for matching port');
124
- assert.notStrictEqual(agent2.constructor.name, 'Agent', 'Should use proxy for non-matching port');
125
- });
126
- test('should handle case-insensitive matching', () => {
127
- const pool = new GitLabClientPool({
128
- httpProxy: 'http://proxy.example.com:8080',
129
- httpsProxy: 'http://proxy.example.com:8080',
130
- noProxy: 'GitLab.Internal.COM',
131
- });
132
- const agent1 = pool.getOrCreateAgentForUrl('https://gitlab.internal.com/api/v4');
133
- const agent2 = pool.getOrCreateAgentForUrl('https://GITLAB.INTERNAL.COM/api/v4');
134
- assert.strictEqual(agent1.constructor.name, 'Agent', 'Should match case-insensitively (lowercase)');
135
- assert.strictEqual(agent2.constructor.name, 'Agent', 'Should match case-insensitively (uppercase)');
136
- });
137
- test('should re-evaluate NO_PROXY for redirect origins', () => {
138
- const pool = new GitLabClientPool({
139
- httpProxy: 'http://proxy.example.com:8080',
140
- httpsProxy: 'http://proxy.example.com:8080',
141
- noProxy: 'gitlab.internal.com',
142
- });
143
- const proxyToBypass = pool.getDispatcherForOrigin('https://gitlab.external.com/api/v4', 'https://gitlab.internal.com/api/v4');
144
- const bypassToProxy = pool.getDispatcherForOrigin('https://gitlab.internal.com/api/v4', 'https://gitlab.external.com/api/v4');
145
- assert.strictEqual(proxyToBypass.constructor.name, 'Agent', 'redirect onto NO_PROXY host should bypass');
146
- assert.notStrictEqual(bypassToProxy.constructor.name, 'Agent', 'redirect onto proxied host should use proxy');
147
- });
148
- });
149
- console.log('✅ NO_PROXY tests completed');
@@ -1,37 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { test } from "node:test";
3
- import { GitLabCiLintResultSchema, GitLabCompareResultSchema, GitLabProtectedBranchAccessLevelSchema, } from "../schemas.js";
4
- test("role-based protected-branch access levels accept null user_id/group_id", () => {
5
- // #575: GitLab returns null for role-based levels, not omitted fields
6
- const parsed = GitLabProtectedBranchAccessLevelSchema.parse({
7
- access_level: 40,
8
- access_level_description: "Maintainers",
9
- user_id: null,
10
- group_id: null,
11
- });
12
- assert.equal(parsed.user_id, null);
13
- assert.equal(parsed.group_id, null);
14
- });
15
- test("branch compare accepts null commit", () => {
16
- const parsed = GitLabCompareResultSchema.parse({
17
- commit: null,
18
- commits: [],
19
- diffs: [],
20
- });
21
- assert.equal(parsed.commit, null);
22
- });
23
- test("ci lint result accepts null merged_yaml/includes on an invalid config", () => {
24
- // #638: GitLab nulls both fields whenever the config is invalid — i.e. in
25
- // exactly the case validate_ci_lint exists to report on.
26
- const parsed = GitLabCiLintResultSchema.parse({
27
- valid: false,
28
- errors: ["image is defined in top-level and `default:` entry"],
29
- warnings: [],
30
- merged_yaml: null,
31
- includes: null,
32
- });
33
- assert.equal(parsed.valid, false);
34
- assert.equal(parsed.merged_yaml, null);
35
- assert.equal(parsed.includes, null);
36
- assert.deepEqual(parsed.errors, ["image is defined in top-level and `default:` entry"]);
37
- });
@@ -1,118 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { describe, test } from "node:test";
3
- import { CreateDraftNoteSchema, CreateLabelSchema, ExecuteGraphQLSchema, GetBranchDiffsSchema, UpdateMergeRequestDiscussionNoteSchema, UpdateMergeRequestSchema, } from "../schemas.js";
4
- import { sanitizeToolArguments } from "../utils/tool-args.js";
5
- const PROJECT_ID = "group/project";
6
- const MERGE_REQUEST_IID = "1";
7
- function parseAfterSanitize(toolName, raw, parse) {
8
- return parse(sanitizeToolArguments(toolName, raw));
9
- }
10
- describe("When validating tool arguments after sanitization", () => {
11
- describe("with create_draft_note", () => {
12
- test("should accept position with null SHAs after sanitize and schema preprocess", () => {
13
- const parsed = parseAfterSanitize("create_draft_note", {
14
- project_id: PROJECT_ID,
15
- merge_request_iid: MERGE_REQUEST_IID,
16
- body: "Test note",
17
- position: {
18
- base_sha: null,
19
- head_sha: null,
20
- start_sha: null,
21
- position_type: "text",
22
- },
23
- }, value => CreateDraftNoteSchema.parse(value));
24
- assert.equal(parsed.position, undefined);
25
- });
26
- test("should accept position with nullable old_line after sanitize", () => {
27
- const parsed = parseAfterSanitize("create_draft_note", {
28
- project_id: PROJECT_ID,
29
- merge_request_iid: MERGE_REQUEST_IID,
30
- body: "Test note",
31
- position: {
32
- base_sha: "base",
33
- head_sha: "head",
34
- start_sha: "start",
35
- position_type: "text",
36
- new_path: "file.ts",
37
- old_line: null,
38
- new_line: 10,
39
- },
40
- }, value => CreateDraftNoteSchema.parse(value));
41
- assert.equal(parsed.position?.old_line, null);
42
- assert.equal(parsed.position?.new_line, 10);
43
- });
44
- });
45
- describe("with update_merge_request", () => {
46
- test("should omit null milestone_id instead of coercing to string null", () => {
47
- const parsed = UpdateMergeRequestSchema.parse({
48
- project_id: PROJECT_ID,
49
- merge_request_iid: MERGE_REQUEST_IID,
50
- title: "keep",
51
- milestone_id: null,
52
- });
53
- assert.equal(parsed.milestone_id, undefined);
54
- });
55
- test("should keep 0 as unassign sentinel", () => {
56
- const parsed = UpdateMergeRequestSchema.parse({
57
- project_id: PROJECT_ID,
58
- merge_request_iid: MERGE_REQUEST_IID,
59
- milestone_id: 0,
60
- });
61
- assert.equal(parsed.milestone_id, "0");
62
- });
63
- });
64
- describe("with update_merge_request_discussion_note", () => {
65
- test("should accept body plus resolved null after sanitize", () => {
66
- const parsed = parseAfterSanitize("update_merge_request_discussion_note", {
67
- project_id: PROJECT_ID,
68
- merge_request_iid: MERGE_REQUEST_IID,
69
- discussion_id: "d1",
70
- note_id: "n1",
71
- body: "updated",
72
- resolved: null,
73
- }, value => UpdateMergeRequestDiscussionNoteSchema.parse(value));
74
- assert.equal(parsed.body, "updated");
75
- assert.equal(parsed.resolved, undefined);
76
- });
77
- test("should reject when only resolved null remains after sanitize", () => {
78
- assert.throws(() => parseAfterSanitize("update_merge_request_discussion_note", {
79
- project_id: PROJECT_ID,
80
- merge_request_iid: MERGE_REQUEST_IID,
81
- discussion_id: "d1",
82
- note_id: "n1",
83
- resolved: null,
84
- }, value => UpdateMergeRequestDiscussionNoteSchema.parse(value)), /At least one of 'body' or 'resolved'/);
85
- });
86
- });
87
- describe("with get_branch_diffs", () => {
88
- test("should ignore unknown commit null field from older clients", () => {
89
- const parsed = parseAfterSanitize("get_branch_diffs", {
90
- project_id: PROJECT_ID,
91
- from: "main",
92
- to: "dev",
93
- commit: null,
94
- }, value => GetBranchDiffsSchema.parse(value));
95
- assert.equal(Object.hasOwn(parsed, "commit"), false);
96
- });
97
- });
98
- describe("with execute_graphql", () => {
99
- test("should preserve explicit null variable values after sanitize", () => {
100
- const parsed = parseAfterSanitize("execute_graphql", {
101
- query: "mutation($id: ID) { updateProject(input: { id: $id }) { project { id } } }",
102
- variables: { id: null },
103
- }, value => ExecuteGraphQLSchema.parse(value));
104
- assert.equal(parsed.variables?.id, null);
105
- });
106
- });
107
- describe("with create_label", () => {
108
- test("should preserve explicit null priority after sanitize", () => {
109
- const parsed = parseAfterSanitize("create_label", {
110
- project_id: PROJECT_ID,
111
- name: "priority-null",
112
- color: "#112233",
113
- priority: null,
114
- }, value => CreateLabelSchema.parse(value));
115
- assert.equal(parsed.priority, null);
116
- });
117
- });
118
- });