MCPcopy
hub / github.com/iterative/cml / prCreate

Method prCreate

src/drivers/gitlab.js:295–316  ·  view source on GitHub ↗
(opts = {})

Source from the content-addressed store, hash-verified

293 }
294
295 async prCreate(opts = {}) {
296 const projectPath = await this.projectPath();
297 const { source, target, title, description, skipCi, autoMerge } = opts;
298
299 const prTitle = skipCi ? title + ' [skip ci]' : title;
300 const endpoint = `/projects/${projectPath}/merge_requests`;
301 const body = new URLSearchParams();
302 body.append('source_branch', source);
303 body.append('target_branch', target);
304 body.append('title', prTitle);
305 body.append('description', description);
306
307 const { web_url: url, iid } = await this.request({
308 endpoint,
309 method: 'POST',
310 body
311 });
312
313 if (autoMerge)
314 await this.prAutoMerge({ pullRequestId: iid, mergeMode: autoMerge });
315 return url;
316 }
317
318 /**
319 * @param {{ pullRequestId: string }} param0

Callers

nothing calls this directly

Calls 3

projectPathMethod · 0.95
requestMethod · 0.95
prAutoMergeMethod · 0.95

Tested by

no test coverage detected