From 38272138856044168d8bf97b245b0f4104b77b70 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Fri, 17 Oct 2025 22:13:11 +0700 Subject: [PATCH] Remove redundant question marks Signed-off-by: Andrey Sobolev --- services/github/pod-github/src/sync/comments.ts | 6 +++--- services/github/pod-github/src/sync/issues.ts | 14 +++++++------- .../github/pod-github/src/sync/pullrequests.ts | 6 +++--- .../github/pod-github/src/sync/reviewComments.ts | 8 ++++---- .../github/pod-github/src/sync/reviewThreads.ts | 6 +++--- services/github/pod-github/src/sync/reviews.ts | 6 +++--- services/github/pod-github/src/worker.ts | 2 +- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/services/github/pod-github/src/sync/comments.ts b/services/github/pod-github/src/sync/comments.ts index c5dfe2f39da..c435fa41f22 100644 --- a/services/github/pod-github/src/sync/comments.ts +++ b/services/github/pod-github/src/sync/comments.ts @@ -154,7 +154,7 @@ export class CommentSyncManager implements DocSyncManager { } }` if (isGHWriteAllowed()) { - await okit?.graphql(q, { + await okit.graphql(q, { commentID: id }) } @@ -353,7 +353,7 @@ export class CommentSyncManager implements DocSyncManager { const okit = (await this.provider.getOctokit(ctx, existing.modifiedBy)) ?? container.container.octokit const mdown = await this.provider.getMarkdown(existingComment.message) if (mdown.trim().length > 0) { - await okit?.rest.issues.updateComment({ + await okit.rest.issues.updateComment({ owner: repository.owner?.login as string, repo: repository.name, issue_number: parent.githubNumber, @@ -429,7 +429,7 @@ export class CommentSyncManager implements DocSyncManager { try { const mdown = await this.provider.getMarkdown(chatMessage.message) if (mdown.trim().length > 0) { - const result = await okit?.rest.issues.createComment({ + const result = await okit.rest.issues.createComment({ owner: repo.owner?.login as string, repo: repo.name, issue_number: parent.githubNumber, diff --git a/services/github/pod-github/src/sync/issues.ts b/services/github/pod-github/src/sync/issues.ts index 84d9ac68db1..d5faa06234c 100644 --- a/services/github/pod-github/src/sync/issues.ts +++ b/services/github/pod-github/src/sync/issues.ts @@ -135,7 +135,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan if (event.action !== 'deleted') { try { const response: any = await ctx.with('graphql', {}, (ctx) => - integration.octokit?.graphql( + integration.octokit.graphql( `query listIssue($name: String!, $owner: String!, $issue: Int!) { repository(name: $name, owner: $owner) { issue(number: $issue) { @@ -624,7 +624,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan // We should allow modification from user. const closeIssue = async (): Promise => { - await okit?.graphql( + await okit.graphql( ` mutation closeIssue($issue: ID!) { closeIssue(input: { @@ -642,7 +642,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan } const reopenIssue = async (): Promise => { - await okit?.graphql( + await okit.graphql( ` mutation reopenIssue($issue: ID!) { reopenIssue(input: { @@ -675,7 +675,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan // We need to call re-open issue await reopenIssue() } - await okit?.graphql( + await okit.graphql( ` mutation updateIssue($issue: ID!, $body: String! ) { updateIssue(input: { @@ -713,7 +713,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan await reopenIssue() } if (hasOtherChanges) { - await okit?.graphql( + await okit.graphql( ` mutation updateIssue($issue: ID!) { updateIssue(input: { @@ -780,7 +780,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan issue: IssueExternalData } } - | undefined = await okit?.graphql(q, { + | undefined = await okit.graphql(q, { repo: repoId, title: existingIssue.title, body, @@ -809,7 +809,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan } }` if (isGHWriteAllowed()) { - await okit?.graphql(q, { + await okit.graphql(q, { issueID: id }) } diff --git a/services/github/pod-github/src/sync/pullrequests.ts b/services/github/pod-github/src/sync/pullrequests.ts index c80983c9070..e4e22cf05bf 100644 --- a/services/github/pod-github/src/sync/pullrequests.ts +++ b/services/github/pod-github/src/sync/pullrequests.ts @@ -145,7 +145,7 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS let externalData: PullRequestExternalData try { const response: any = await ctx.with('graphql', {}, (ctx) => - integration.octokit?.graphql( + integration.octokit.graphql( `query listIssue($name: String!, $owner: String!, $issue: Int!) { repository(name: $name, owner: $owner) { pullRequest(number: $issue) { @@ -1000,7 +1000,7 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS workspace: this.provider.getWorkspaceId() }) if (isGHWriteAllowed()) { - await okit?.graphql( + await okit.graphql( ` mutation updatePullRequest($issue: ID!, $body: String!) { updatePullRequest(input: { @@ -1034,7 +1034,7 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS workspace: this.provider.getWorkspaceId() }) if (isGHWriteAllowed()) { - await okit?.graphql( + await okit.graphql( ` mutation updatePullRequest($issue: ID!) { updatePullRequest(input: { diff --git a/services/github/pod-github/src/sync/reviewComments.ts b/services/github/pod-github/src/sync/reviewComments.ts index 5685daf810f..c1c4a378d46 100644 --- a/services/github/pod-github/src/sync/reviewComments.ts +++ b/services/github/pod-github/src/sync/reviewComments.ts @@ -166,7 +166,7 @@ export class ReviewCommentSyncManager implements DocSyncManager { } }` if (isGHWriteAllowed()) { - await okit?.graphql(q, { + await okit.graphql(q, { reviewID: id }) } @@ -187,7 +187,7 @@ export class ReviewCommentSyncManager implements DocSyncManager { let externalData: ReviewCommentExternalData try { - const response: any = await integration.octokit?.graphql( + const response: any = await integration.octokit.graphql( ` query listReview($reviewID: ID!) { node(id: $reviewID) { @@ -445,7 +445,7 @@ export class ReviewCommentSyncManager implements DocSyncManager { } }` if (isGHWriteAllowed()) { - await okit?.graphql(q, { + await okit.graphql(q, { threadID: reviewComment.id, body }) @@ -532,7 +532,7 @@ export class ReviewCommentSyncManager implements DocSyncManager { comment: ReviewCommentExternalData } } - | undefined = await okit?.graphql(q, { + | undefined = await okit.graphql(q, { prID: existingReview.reviewThreadId, body: (await this.provider.getMarkdown(existingReview.body)) ?? '' }) diff --git a/services/github/pod-github/src/sync/reviewThreads.ts b/services/github/pod-github/src/sync/reviewThreads.ts index 762392f159d..fbc48a80e11 100644 --- a/services/github/pod-github/src/sync/reviewThreads.ts +++ b/services/github/pod-github/src/sync/reviewThreads.ts @@ -181,7 +181,7 @@ export class ReviewThreadSyncManager implements DocSyncManager { let externalData: ReviewThreadExternalData try { - const response: any = await integration.octokit?.graphql( + const response: any = await integration.octokit.graphql( ` query listReview($reviewID: ID!) { node(id: $reviewID) { @@ -385,7 +385,7 @@ export class ReviewThreadSyncManager implements DocSyncManager { }` try { if (isGHWriteAllowed()) { - await okit?.graphql(q, { + await okit.graphql(q, { threadID: review.id }) } @@ -474,7 +474,7 @@ export class ReviewThreadSyncManager implements DocSyncManager { thread: ReviewThreadExternalData } } - | undefined = await okit?.graphql(q, { + | undefined = await okit.graphql(q, { prID: (parent.external as PullRequestExternalData).id, body: EmptyMarkup // TODO: Need to replace with first comment on comment sync. }) diff --git a/services/github/pod-github/src/sync/reviews.ts b/services/github/pod-github/src/sync/reviews.ts index 53614807876..1c5496b51dd 100644 --- a/services/github/pod-github/src/sync/reviews.ts +++ b/services/github/pod-github/src/sync/reviews.ts @@ -161,7 +161,7 @@ export class ReviewSyncManager implements DocSyncManager { } }` if (isGHWriteAllowed()) { - await okit?.graphql(q, { + await okit.graphql(q, { reviewID: id }) } @@ -178,7 +178,7 @@ export class ReviewSyncManager implements DocSyncManager { let externalData: ReviewExternalData try { - const response: any = await integration.octokit?.graphql( + const response: any = await integration.octokit.graphql( ` query listReview($reviewID: ID!) { node(id: $reviewID) { @@ -456,7 +456,7 @@ export class ReviewSyncManager implements DocSyncManager { pullRequestReview: ReviewExternalData } } - | undefined = await okit?.graphql(q, { + | undefined = await okit.graphql(q, { prID: (parent.external as PullRequestExternalData).id, body: (await this.provider.getMarkdown(existingReview.body)) ?? '', state: existingReview.state diff --git a/services/github/pod-github/src/worker.ts b/services/github/pod-github/src/worker.ts index 54725d87e8a..7f6c7e82fbc 100644 --- a/services/github/pod-github/src/worker.ts +++ b/services/github/pod-github/src/worker.ts @@ -528,7 +528,7 @@ export class GithubWorker implements IntegrationManager { }) if (info?.id === undefined) { // We need to retrieve info for login - const response: any = await container.octokit?.graphql( + const response: any = await container.octokit.graphql( `query($login: String!) { user(login: $login) { id