Skip to content

Commit

Permalink
fix: disable reviewflow comment creation before callback
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Jan 22, 2023
1 parent 51f3c0e commit ae1f7f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/events/pr-handlers/opened.test.ts
Expand Up @@ -39,6 +39,10 @@ describe('opened', (): void => {

test('edits the pull request when pull request is opened', async (): Promise<void> => {
const scope = nock('https://api.github.com')
.get('/repos/reviewflow/reviewflow-test/issues/30/comments')
.times(1)
.reply(200, [])

.post(
'/repos/reviewflow/reviewflow-test/issues/30/comments',
'{"body":"This will be auto filled by reviewflow."}',
Expand Down
20 changes: 11 additions & 9 deletions src/events/pr-handlers/opened.ts
Expand Up @@ -6,11 +6,11 @@ import { autoAssignPRToCreator } from './actions/autoAssignPRToCreator';
import { editOpenedPR } from './actions/editOpenedPR';
import { updateReviewStatus } from './actions/updateReviewStatus';
import { updateStatusCheckFromStepsState } from './actions/updateStatusCheckFromStepsState';
import { defaultCommentBody } from './actions/utils/body/updateBody';
// import { defaultCommentBody } from './actions/utils/body/updateBody';
import { calcStepsState } from './actions/utils/steps/calcStepsState';
import { syncLabels } from './actions/utils/syncLabel';
import { createPullRequestHandler } from './utils/createPullRequestHandler';
import { createReviewflowComment } from './utils/reviewflowComment';
// import { createReviewflowComment } from './utils/reviewflowComment';

export default function opened(app: Probot, appContext: AppContext): void {
createPullRequestHandler(
Expand Down Expand Up @@ -86,12 +86,14 @@ export default function opened(app: Probot, appContext: AppContext): void {
}),
]);
},
(pullRequest, context) => ({
reviewflowCommentPromise: createReviewflowComment(
pullRequest.number,
context,
defaultCommentBody,
),
}),
// https://sentry.io/organizations/chrp/issues/3888881569/?project=1243466&query=is%3Aunresolved&referrer=issue-stream
// https://github.com/christophehurpeau/reviewflow/pull/617
// (pullRequest, context) => ({
// reviewflowCommentPromise: createReviewflowComment(
// pullRequest.number,
// context,
// defaultCommentBody,
// ),
// }),
);
}

0 comments on commit ae1f7f9

Please sign in to comment.