Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions services/github/pod-github/src/sync/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class CommentSyncManager implements DocSyncManager {
}
}`
if (isGHWriteAllowed()) {
await okit?.graphql(q, {
await okit.graphql(q, {
commentID: id
})
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions services/github/pod-github/src/sync/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -624,7 +624,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
// We should allow modification from user.

const closeIssue = async (): Promise<void> => {
await okit?.graphql(
await okit.graphql(
`
mutation closeIssue($issue: ID!) {
closeIssue(input: {
Expand All @@ -642,7 +642,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
}

const reopenIssue = async (): Promise<void> => {
await okit?.graphql(
await okit.graphql(
`
mutation reopenIssue($issue: ID!) {
reopenIssue(input: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -809,7 +809,7 @@ export class IssueSyncManager extends IssueSyncManagerBase implements DocSyncMan
}
}`
if (isGHWriteAllowed()) {
await okit?.graphql(q, {
await okit.graphql(q, {
issueID: id
})
}
Expand Down
6 changes: 3 additions & 3 deletions services/github/pod-github/src/sync/pullrequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down
8 changes: 4 additions & 4 deletions services/github/pod-github/src/sync/reviewComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class ReviewCommentSyncManager implements DocSyncManager {
}
}`
if (isGHWriteAllowed()) {
await okit?.graphql(q, {
await okit.graphql(q, {
reviewID: id
})
}
Expand All @@ -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) {
Expand Down Expand Up @@ -445,7 +445,7 @@ export class ReviewCommentSyncManager implements DocSyncManager {
}
}`
if (isGHWriteAllowed()) {
await okit?.graphql(q, {
await okit.graphql(q, {
threadID: reviewComment.id,
body
})
Expand Down Expand Up @@ -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)) ?? ''
})
Expand Down
6 changes: 3 additions & 3 deletions services/github/pod-github/src/sync/reviewThreads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -385,7 +385,7 @@ export class ReviewThreadSyncManager implements DocSyncManager {
}`
try {
if (isGHWriteAllowed()) {
await okit?.graphql(q, {
await okit.graphql(q, {
threadID: review.id
})
}
Expand Down Expand Up @@ -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.
})
Expand Down
6 changes: 3 additions & 3 deletions services/github/pod-github/src/sync/reviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class ReviewSyncManager implements DocSyncManager {
}
}`
if (isGHWriteAllowed()) {
await okit?.graphql(q, {
await okit.graphql(q, {
reviewID: id
})
}
Expand All @@ -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) {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion services/github/pod-github/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading