-
Notifications
You must be signed in to change notification settings - Fork 199
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
Ongoing cron - not running for incomplete reports #2783
Ongoing cron - not running for incomplete reports #2783
Conversation
|
WalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
services/workflows-service/src/workflow/cron/ongoing-monitoring.cron.intg.test.ts (2)
70-99
: LGTM: New test case added for incomplete business reports.The new test case effectively verifies that an ongoing report is not created when the last business report is incomplete. This aligns well with the new functionality to handle different report statuses.
A minor suggestion for improved clarity:
Consider adding a comment explaining the significance of the 30-day difference in the mock data's createdAt and updatedAt dates. This would help other developers understand the test setup more quickly.
createdAt: new Date(new Date().setDate(new Date().getDate() - 31)), updatedAt: new Date(new Date().setDate(new Date().getDate() - 30)), +// Comment: These dates simulate a report created 31 days ago and last updated 30 days ago
143-154
: LGTM: Mock implementation updated to support new test case.The changes to the
BusinessReportService
mock, including the updatedfindMany
implementation and the addition ofcreateBusinessReportAndTriggerReportCreation
, align well with the new test case for handling incomplete reports.A minor suggestion for consistency:
Consider using the
BusinessReportStatus
enum for the status field in the mock data to maintain consistency with the imported types:-status: BusinessReportStatus.in_progress, +status: BusinessReportStatus.IN_PROGRESS,This assumes that the enum values are in uppercase, which is a common convention. Please adjust accordingly if the actual enum values are different.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- services/workflows-service/src/workflow/cron/ongoing-monitoring.cron.intg.test.ts (7 hunks)
🧰 Additional context used
🔇 Additional comments (4)
services/workflows-service/src/workflow/cron/ongoing-monitoring.cron.intg.test.ts (4)
7-7
: LGTM: Import statement updated to support new functionality.The addition of
BusinessReportStatus
andBusinessReportType
imports aligns with the new functionality for handling different report statuses and types in the OngoingMonitoringCron service.
23-23
: LGTM: Test setup updated to include BusinessReportService.The addition of
businessReportService
and its initialization in the beforeEach setup is consistent with the new functionality for handling business reports. This ensures that the service is properly mocked and available for all test cases.Also applies to: 43-43
118-121
: LGTM: Mock implementation simplified, but clarification needed.The mock implementation for
createOrUpdateWorkflowRuntime
has been simplified to always resolve withtrue
. While this change is acceptable, it's not immediately clear how it relates to the new functionality for handling business reports.Could you please clarify the reasoning behind this change? Is it related to the new business report functionality, or is it a separate improvement?
Line range hint
1-248
: Overall assessment: Well-implemented changes with good test coverage.The changes to this test file effectively support the new functionality for handling business reports and their statuses in the OngoingMonitoringCron service. The addition of a new test case for incomplete reports and the updates to mock implementations enhance the overall test coverage.
A few minor suggestions have been made for improved clarity and consistency, but these are not critical issues. The code changes appear to be well-thought-out and align with the intended functionality described in the AI-generated summary.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Tests