diff --git a/infrastructure/modules/cosmos-module.bicep b/infrastructure/modules/cosmos-module.bicep index a889a9a..201a251 100644 --- a/infrastructure/modules/cosmos-module.bicep +++ b/infrastructure/modules/cosmos-module.bicep @@ -58,11 +58,11 @@ resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2021-06-15' = { } networkAclBypassResourceIds: [] } - resource repostDatabase 'sqlDatabases@2021-06-15' = { - name: 'Repost' + resource database 'sqlDatabases@2021-06-15' = { + name: 'AnnouncementDrafter' properties: { resource: { - id: 'Repost' + id: 'AnnouncementDrafter' } } diff --git a/web-app/src/eventHandlers/pullRequestEventHandler.ts b/web-app/src/eventHandlers/pullRequestEventHandler.ts index 3a50a7c..b5ec2ba 100644 --- a/web-app/src/eventHandlers/pullRequestEventHandler.ts +++ b/web-app/src/eventHandlers/pullRequestEventHandler.ts @@ -187,25 +187,25 @@ Please fix the issues and recreate a new PR: }); // Our app will skip it if our comment has been edited (for security) - const repostComments = pullRequestComments.filter( + const botComments = pullRequestComments.filter( (comment) => comment.user.login === appLogin && !comment.in_reply_to_id && comment.path && !comment.body.includes(this.errorIcon) ); - if (repostComments.length == 0) { + if (botComments.length == 0) { logger.info(`No ${appLogin} comments found on this PR`); return; } // Get new tokens for all the users only once using their refresh tokens const userTokenCache: { [login: string]: string } = {}; - const users = repostComments.map((comment) => this.getAuthorLogin(comment.body)); + const users = botComments.map((comment) => this.getAuthorLogin(comment.body)); const usersDistinct = Array.from(new Set(users)); for (const userLogin of usersDistinct) { userTokenCache[userLogin] = await this._tokenService.refreshUserToken(userLogin); } // 2. Check for the approval reaction made by the author - for (const fileToPostComment of repostComments) { + for (const fileToPostComment of botComments) { const authorLogin = this.getAuthorLogin(fileToPostComment.body); const reactions = await appGitHubService.getPullRequestCommentReaction({ ...pullInfo, diff --git a/web-app/src/services/configService.ts b/web-app/src/services/configService.ts index ebd57bc..1604082 100644 --- a/web-app/src/services/configService.ts +++ b/web-app/src/services/configService.ts @@ -54,7 +54,7 @@ export class ConfigService { private static getDefaultConfig(): AppConfig { return { - cosmos_database_id: 'Repost', + cosmos_database_id: 'AnnouncementDrafter', cosmos_uri: process.env['COSMOS_URI'] || '', cosmos_primary_key: process.env['COSMOS_PRIMARY_KEY'] || '', github_callback_url: process.env['CALLBACK_URL'] || '',