-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor weekly financial reports workflow #47
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
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThe changes remove the previous financial data fetching stub and introduce a new workflow for retrieving project unit data from a Redmine database. New exports are added to the activities modules, and a function is implemented to fetch, serialize, and store project unit data, returning a file path to the saved JSON. Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant getProjectUnits
participant RedmineDB
participant TargetUnitRepository
participant FileSystem
Caller->>getProjectUnits: call()
getProjectUnits->>RedmineDB: initialize connection pool
getProjectUnits->>TargetUnitRepository: instantiate with pool
getProjectUnits->>TargetUnitRepository: getTargetUnits()
TargetUnitRepository-->>getProjectUnits: target units data
getProjectUnits->>FileSystem: write JSON file (timestamped path)
FileSystem-->>getProjectUnits: file path
getProjectUnits-->>Caller: { fileLink }
Possibly related PRs
Suggested reviewers
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
🔍 Vulnerabilities of
|
| digest | sha256:da30eca7154c7c4cb2616e31f7411021ea9146d5b15c68adf2a57df4c52b164c |
| vulnerabilities | |
| platform | linux/amd64 |
| size | 218 MB |
| packages | 358 |
📦 Base Image alpine:3
| also known as |
|
| digest | sha256:1c4eef651f65e2f7daee7ee785882ac164b02b78fb74503052a26dc061c90474 |
| vulnerabilities |
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description | ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
| ||||||||||||
Description
|
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: 1
🧹 Nitpick comments (2)
workers/main/src/activities/weeklyFinancialReports/getProjectUnits.ts (2)
2-2: Consider consistent import formatting.Mix of destructured and non-destructured imports. Consider using consistent formatting for better readability.
-import {TargetUnitRepository} from "../../services/TargetUnit/TargetUnitRepository"; +import { TargetUnitRepository } from "../../services/TargetUnit/TargetUnitRepository";
3-4: Consider consistent import formatting.Mix of destructured and non-destructured imports. Consider using consistent formatting for better readability.
-import {RedminePool} from "../../common/RedminePool"; -import {redmineDatabaseConfig} from "../../configs/redmineDatabase"; +import { RedminePool } from "../../common/RedminePool"; +import { redmineDatabaseConfig } from "../../configs/redmineDatabase";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
workers/main/src/activities/fetchFinancialData.ts(0 hunks)workers/main/src/activities/index.ts(1 hunks)workers/main/src/activities/weeklyFinancialReports/getProjectUnits.ts(1 hunks)workers/main/src/activities/weeklyFinancialReports/index.ts(1 hunks)
💤 Files with no reviewable changes (1)
- workers/main/src/activities/fetchFinancialData.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
workers/main/src/activities/weeklyFinancialReports/getProjectUnits.ts (3)
workers/main/src/common/RedminePool.ts (1)
RedminePool(4-46)workers/main/src/configs/redmineDatabase.ts (1)
redmineDatabaseConfig(3-8)workers/main/src/services/TargetUnit/TargetUnitRepository.ts (1)
TargetUnitRepository(9-52)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Docker Security Scanning (n8n, Dockerfile.n8n, n8n-test:latest)
- GitHub Check: Docker Security Scanning (temporal, Dockerfile.temporal, temporal-test:latest)
- GitHub Check: Service Availability Check
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
workers/main/src/activities/index.ts (1)
1-1: LGTM! Clean module organization.The export statement follows standard practices for organizing module hierarchies and centralizing exports.
workers/main/src/activities/weeklyFinancialReports/index.ts (1)
1-1: LGTM! Consistent module organization.The export statement maintains consistency with the module organization pattern.
workers/main/src/activities/weeklyFinancialReports/getProjectUnits.ts
Outdated
Show resolved
Hide resolved
d892308 to
dc4759d
Compare
killev
left a comment
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.
Looks good!
…l data fetching - Deleted the `fetchFinancialData.ts` file as it was no longer needed. - Introduced `getTargetUnits.ts` to fetch target units and return a file link for weekly financial reports. - Updated the `index.ts` files to export the new workflow structure. - Removed outdated tests related to the previous financial data fetching logic. These changes streamline the workflow for generating weekly financial reports by focusing on the retrieval of target units.
8391c68 to
2d86d7c
Compare
- Introduced a new test file `getTargetUnits.test.ts` to validate the functionality of the `getTargetUnits` function. - Implemented mocks for dependencies including `RedminePool`, `TargetUnitRepository`, and `writeJsonFile` to isolate tests. - Added test cases to ensure successful retrieval of target units, error handling for repository failures, and proper file writing. - Verified that the connection pool is always terminated after execution. These additions enhance test coverage for the weekly financial reports workflow and ensure robust error handling in the `getTargetUnits` function.
- Updated the `getTargetUnits.test.ts` file to improve test coverage and structure. - Introduced a mock setup for `TargetUnitRepository` and `RedminePool` to streamline testing. - Refactored test cases for better clarity and added checks for error handling scenarios. - Ensured that the connection pool is properly terminated after each test. These changes strengthen the reliability of the `getTargetUnits` function and ensure comprehensive testing of its behavior.
|



fetchFinancialData.tsfile as it was no longer needed.getProjectUnits.tsto fetch project units and return a file link for the weekly financial reports.weeklyFinancialReportsworkflow to utilize the newgetProjectUnitsfunction.