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

#4076 - Queue Monitoring - Schedulers Refactor (SFAS Integration) #4097

Merged
merged 8 commits into from
Dec 16, 2024

Conversation

andrewsignori-aot
Copy link
Collaborator

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

  • Refactored SFAS-related schedulers, SFAS to SIMS and vice-versa.
    • Adjusted E2E tests.
    • Replaced SFASProcessingResult with the processSummary. This refactor is not expected to be done for every scheduler.

@andrewsignori-aot andrewsignori-aot changed the title #4076 - Queue Monitoring - Schedulers Refactor (sfas-integration) #4076 - Queue Monitoring - Schedulers Refactor (SFAS Integration) Dec 16, 2024
@andrewsignori-aot andrewsignori-aot marked this pull request as ready for review December 16, 2024 18:57
Copy link
Collaborator

@bidyashish bidyashish left a comment

Choose a reason for hiding this comment

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

Running test in local gives error, any extra step need to be taken?
on file apps/queue-consumers/src/processors/schedulers/sfas-integration/tests/sfas-integration.scheduler.e2e-spec.ts

image

* @param job job.
* @returns process summary.
* @param _job process job.
* @param processSummary process summary for logging.
*/
@Process()
Copy link
Collaborator

Choose a reason for hiding this comment

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

The decorator is expected to be removed right?

Copy link
Collaborator

@bidyashish bidyashish 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, nice refactor of scheduler.

// Execute the import of all files records.
await processInParallel(
(record) =>
this.importRecord(record, downloadResult.header.creationDate, result),
(record) => this.importRecord(record, downloadResult.header.creationDate),
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 pass the processSummary to the importRecord method? So that the errors logged inside that method will have both job and console logs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

By doing further review I understood that when error is thrown the parent method will take care of the cross-cutting concerns so you can ignore the comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did not believe it was necessary since the first error should interrupt the import and it will logged either way.

const mockedJob = mockBullJob<void>();

// Act/Assert
await expect(processor.processQueue(mockedJob.job)).rejects.toThrow(
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@dheepak-aot
Copy link
Collaborator

Good job @andrewsignori-aot. Just one comment on the decorator.

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 start. Looks good. Please remove the un-used import here sims-to-sfas-integration.scheduler.ts

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22% ( 3786 / 17207 )
Methods: 10.01% ( 219 / 2187 )
Lines: 25.38% ( 3281 / 12930 )
Branches: 13.68% ( 286 / 2090 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.43% ( 583 / 891 )
Methods: 59.26% ( 64 / 108 )
Lines: 68.54% ( 464 / 677 )
Branches: 51.89% ( 55 / 106 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 80.48% ( 1328 / 1650 )
Methods: 64.59% ( 135 / 209 )
Lines: 83.83% ( 1115 / 1330 )
Branches: 70.27% ( 78 / 111 )

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 16, 2024
Merged via the queue into main with commit abef161 Dec 16, 2024
21 checks passed
@andrewsignori-aot andrewsignori-aot deleted the feature/#4076-schedulers-refactor-part-1 branch December 17, 2024 17:11
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