Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4079 - Queue Monitoring - Schedulers Refactor (Part 6) #4177

Merged
merged 7 commits into from
Dec 26, 2024

Conversation

andrewsignori-aot
Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot commented Dec 24, 2024

Refactored the below schedulers and associated E2E tests.

  • assessment-workflow-enqueuer
  • assessment-workflow-queue-retry
  • application-changes-report-integration
  • process-notifications
  • student-application-notifications
  • atbc

@andrewsignori-aot andrewsignori-aot marked this pull request as ready for review December 24, 2024 23:47
@dheepak-aot dheepak-aot self-requested a review December 26, 2024 18:05
@@ -86,7 +90,7 @@ export class ATBCIntegrationProcessingService {
this.logger.log(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this logger?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

Comment on lines 51 to 56
processSummary.info(
`Total notifications processed ${processNotificationResponse.notificationsProcessed}.`,
);
processSummary.info(
`Total notifications successfully processed ${processNotificationResponse.notificationsSuccessfullyProcessed}.`,
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor. As this is a result, it can be part of return. As there is no E2E tests for this scheduler, there won't be further impacts in changing the return.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the result to the summary and result also.

Comment on lines +57 to +64
if (
processNotificationResponse.notificationsProcessed !==
processNotificationResponse.notificationsSuccessfullyProcessed
) {
processSummary.warn(
"Not all pending notifications were successfully processed.",
);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

"Found 0 application changes.",
`Application changes report with file name ${expectedFileName} has been uploaded successfully.`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// Mock the current date.
const now = new Date();
MockDate.set(now);
expectedFileName = `DPBC.EDU.APPCHANGES.${formatFileNameDate(now)}.csv`;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Job. Only 2 minor comments.

Recording our conversation regarding moving the code to add the message to queue inside the transaction here. workflow-enqueuer.service.ts
It is outside the scope of the PR.

expect(
mockedJob.containLogMessages([
"Retrieving all application changes which were not reported already.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor: maybe it could be rephrased to: "Retrieving all application changes that have not yet been reported."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated as suggested.

Copy link
Collaborator

@andrepestana-aot andrepestana-aot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just minor comments.

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.23% ( 3783 / 17020 )
Methods: 10.19% ( 219 / 2150 )
Lines: 25.67% ( 3278 / 12770 )
Branches: 13.62% ( 286 / 2100 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.59% ( 589 / 898 )
Methods: 59.63% ( 65 / 109 )
Lines: 68.72% ( 468 / 681 )
Branches: 51.85% ( 56 / 108 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 85.54% ( 1236 / 1445 )
Methods: 78.92% ( 131 / 166 )
Lines: 88.09% ( 1028 / 1167 )
Branches: 68.75% ( 77 / 112 )

Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 67.4% ( 5922 / 8787 )
Methods: 65.09% ( 729 / 1120 )
Lines: 71.33% ( 4647 / 6515 )
Branches: 47.4% ( 546 / 1152 )

@andrewsignori-aot andrewsignori-aot added this pull request to the merge queue Dec 26, 2024
Merged via the queue into main with commit f546f3d Dec 26, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants