MCPcopy
hub / github.com/conwnet/github1s / checkCodeReviewExists

Function checkCodeReviewExists

extensions/github1s/src/commands/code-review.ts:25–39  ·  view source on GitHub ↗
(repo: string, codeReviewId: string)

Source from the content-addressed store, hash-verified

23};
24
25const checkCodeReviewExists = async (repo: string, codeReviewId: string) => {
26 const adapter = adapterManager.getCurrentAdapter();
27 const dataSoruce = await adapter.resolveDataSource();
28 try {
29 return !!(await dataSoruce.provideCodeReview(repo, codeReviewId));
30 } catch (error) {
31 const typeName = CodeReviewTypeName[adapter.codeReviewType || CodeReviewType.CodeReview];
32 const errorMessage =
33 (error as any)?.response?.status === 404
34 ? `No ${typeName} found for id: ${codeReviewId}`
35 : error?.response?.data?.message;
36 vscode.window.showErrorMessage(errorMessage || `Get ${typeName} ${codeReviewId} error`);
37 return false;
38 }
39};
40
41const commandSwitchToCodeReview = async (codeReviewItemOrId?: string | CodeReviewTreeItem) => {
42 let codeReviewId: string | undefined = codeReviewItemOrId

Callers 1

Calls 3

getCurrentAdapterMethod · 0.80
resolveDataSourceMethod · 0.65
provideCodeReviewMethod · 0.45

Tested by

no test coverage detected