MCPcopy Create free account
hub / github.com/angular/dev-infra / createPullRequestMergeTool

Function createPullRequestMergeTool

ng-dev/pr/merge/merge-pull-request.ts:126–148  ·  view source on GitHub ↗

* Creates the pull request merge tool using the given configuration options. * * Explicit configuration options can be specified when the merge script is used * outside of an `ng-dev` configured repository.

(flags: PullRequestMergeFlags)

Source from the content-addressed store, hash-verified

124 * outside of an `ng-dev` configured repository.
125 */
126async function createPullRequestMergeTool(flags: PullRequestMergeFlags) {
127 try {
128 const config = await getConfig();
129
130 assertValidGithubConfig(config);
131 assertValidPullRequestConfig(config);
132
133 /** The singleton instance of the authenticated git client. */
134 const git = await AuthenticatedGitClient.get();
135 return new MergeTool(config, git, flags);
136 } catch (e) {
137 if (e instanceof ConfigValidationError) {
138 if (e.errors.length) {
139 Log.error('Invalid merge configuration:');
140 e.errors.forEach((desc) => Log.error(` - ${desc}`));
141 } else {
142 Log.error(e.message);
143 }
144 process.exit(1);
145 }
146 throw e;
147 }
148}
149
150/**
151 * Parses the pull request number from either the number or url string

Callers 1

mergePullRequestFunction · 0.85

Calls 5

getConfigFunction · 0.85
assertValidGithubConfigFunction · 0.85
getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected