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

Method commitPrs

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

Source from the content-addressed store, hash-verified

103 }
104
105 async commitPrs(opts = {}) {
106 const { commitSha } = opts;
107
108 const projectPath = await this.projectPath();
109
110 const endpoint = `/projects/${projectPath}/repository/commits/${commitSha}/merge_requests`;
111 const prs = await this.request({ endpoint, method: 'GET' });
112
113 return prs
114 .filter((pr) => pr.state === 'opened')
115 .map((pr) => {
116 const {
117 web_url: url,
118 source_branch: source,
119 target_branch: target
120 } = pr;
121 return {
122 url,
123 source,
124 target
125 };
126 });
127 }
128
129 async checkCreate() {
130 throw new Error('Gitlab does not support check!');

Callers 1

parseCommentTargetFunction · 0.45

Calls 2

projectPathMethod · 0.95
requestMethod · 0.95

Tested by

no test coverage detected