Skip to content

Update Dockerfile.n8n to use n8n version 1.109.2 and install additional packages - #101

Closed
anatolyshipitz wants to merge 4 commits into
mainfrom
issue/docker-build
Closed

Update Dockerfile.n8n to use n8n version 1.109.2 and install additional packages#101
anatolyshipitz wants to merge 4 commits into
mainfrom
issue/docker-build

Conversation

@anatolyshipitz

@anatolyshipitz anatolyshipitz commented Sep 3, 2025

Copy link
Copy Markdown
Collaborator
  • Upgraded base image from n8nio/n8n:1.89.2 to n8nio/n8n:1.109.2.
  • Added installation of showdown and slackify-markdown packages with specified versions.
  • Combined package installations into a single layer for efficiency.
  • Configured external modules allowlist for Code/Function nodes.

These changes enhance the n8n environment by ensuring compatibility with newer package versions and improving the installation process.

Summary by CodeRabbit

  • New Features

    • Weekly financial reports now include and display contract type per group, derived from historical data as of the report date.
    • Financial data models now support contract type history to improve reporting accuracy.
  • Chores

    • Upgraded the n8n base image to a newer version.
    • Parameterized external module versions and enabled required external modules in the runtime container.
  • Tests

    • Added comprehensive tests for contract type date resolution.
    • Updated existing tests to reflect the new contract type support and project naming in mocks.

- Updated `FinAppRepository` to include `contractType` in data retrieval for employees and projects.
- Introduced `getContractTypeByDate` utility function to fetch contract types based on date.
- Modified `WeeklyFinancialReportRepository` and formatter to incorporate contract type in report generation.
- Updated tests to reflect changes in data structure and report formatting.

These enhancements improve the accuracy and detail of financial reports, providing clearer insights into contract types alongside revenue metrics.
- Replace string date comparison with timestamp comparison
- Add validation to handle invalid dates gracefully
- Filter out invalid dates from contract type history
- Ensure reliable contract type determination using numeric timestamps
- Introduced comprehensive tests for the getContractTypeByDate utility function.
- Covered various scenarios including handling of undefined and empty inputs, invalid dates, and correct contract type retrieval based on date.
- Ensured robustness by testing edge cases and filtering out invalid entries in contractTypeHistory.

These tests enhance the reliability of the contract type determination logic and improve overall code quality.
…al packages

- Upgraded base image from n8nio/n8n:1.89.2 to n8nio/n8n:1.109.2.
- Added installation of showdown and slackify-markdown packages with specified versions.
- Combined package installations into a single layer for efficiency.
- Configured external modules allowlist for Code/Function nodes.

These changes enhance the n8n environment by ensuring compatibility with newer package versions and improving the installation process.
@coderabbitai

coderabbitai Bot commented Sep 3, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

Adds contractType support across FinApp schemas, repository projections, utilities, and weekly financial report formatting/aggregation. Introduces getContractTypeByDate utility with tests. Updates related tests and project mock data to include name. Upgrades Dockerfile.n8n base image and installs showdown and slackify-markdown with external module allowance.

Changes

Cohort / File(s) Summary
Docker runtime updates
Dockerfile.n8n
Bumps base to n8nio/n8n:1.109.2; adds build args for showdown/slackify-markdown; installs git and global npm deps with flags; sets NODE_FUNCTION_ALLOW_EXTERNAL to "showdown,slackify-markdown".
FinApp schema and types
workers/main/src/services/FinApp/FinAppSchemas.ts, workers/main/src/services/FinApp/types.ts
Adds history.contractType map to schema and History interface.
FinApp repository projections
workers/main/src/services/FinApp/FinAppRepository.ts, workers/main/src/services/FinApp/FinAppRepository.test.ts
Extends Mongo projections to include history.contractType; updates tests to expect the new projection field.
FinApp utility (new) + tests
workers/main/src/services/FinApp/FinAppUtils.ts, workers/main/src/services/FinApp/FinAppUtils.test.ts
Adds exported getContractTypeByDate(date-history lookup); comprehensive Vitest coverage for edge cases and formats.
Weekly report aggregation + formatting
workers/main/src/services/WeeklyFinancialReport/WeeklyFinancialReportRepository.ts, workers/main/src/services/WeeklyFinancialReport/WeeklyFinancialReportFormatter.ts
Computes contractType per group via getContractTypeByDate; plumbs through group data and details; formatter displays “contract type: …”; footer note adjusted.
Weekly report tests
workers/main/src/services/WeeklyFinancialReport/WeeklyFinancialReportRepository.test.ts, workers/main/src/services/WeeklyFinancialReport/WeeklyFinancialReportSorting.test.ts
Removes assertion expecting “Contract Type” placeholder; updates project test data to include name while keeping sorting logic.
Slack report test data
workers/main/src/activities/weeklyFinancialReports/sendReportToSlack.test.ts
Extends mock project object to include name alongside redmine_id and history; no logic changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Scheduler as Scheduler
  participant WFRRepo as WeeklyFinancialReportRepository
  participant FinRepo as FinAppRepository
  participant Util as getContractTypeByDate
  participant Formatter as WeeklyFinancialReportFormatter

  Scheduler->>WFRRepo: generateWeeklyReport(targetDate)
  WFRRepo->>FinRepo: getProjectsByRedmineIds(ids, projection includes history.contractType)
  FinRepo-->>WFRRepo: Projects with history.rate and history.contractType

  loop For each group/project
    WFRRepo->>Util: getContractTypeByDate(contractTypeHistory, targetDate)
    Util-->>WFRRepo: contractType | undefined
    WFRRepo->>Formatter: formatDetail({... , contractType})
    Formatter-->>WFRRepo: formatted detail line(s)
  end

  WFRRepo-->>Scheduler: Aggregated report with contractType in details
  note over WFRRepo,Formatter: New/updated interactions for contractType computation and rendering
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • killev

Poem

I nibble logs and hop through code,\n> New contract trails now well-encode.\n> A date, a type—I stitch the thread,\n> From schema roots to reports spread.\n> Docker’s warmed, Slack’s lines align—\n> Thump-thump! This bunny’s build is fine. 🐇✨


📜 Recent review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 54060c0 and b0d69d6.

📒 Files selected for processing (12)
  • Dockerfile.n8n (1 hunks)
  • workers/main/src/activities/weeklyFinancialReports/sendReportToSlack.test.ts (1 hunks)
  • workers/main/src/services/FinApp/FinAppRepository.test.ts (2 hunks)
  • workers/main/src/services/FinApp/FinAppRepository.ts (2 hunks)
  • workers/main/src/services/FinApp/FinAppSchemas.ts (1 hunks)
  • workers/main/src/services/FinApp/FinAppUtils.test.ts (1 hunks)
  • workers/main/src/services/FinApp/FinAppUtils.ts (1 hunks)
  • workers/main/src/services/FinApp/types.ts (1 hunks)
  • workers/main/src/services/WeeklyFinancialReport/WeeklyFinancialReportFormatter.ts (3 hunks)
  • workers/main/src/services/WeeklyFinancialReport/WeeklyFinancialReportRepository.test.ts (0 hunks)
  • workers/main/src/services/WeeklyFinancialReport/WeeklyFinancialReportRepository.ts (8 hunks)
  • workers/main/src/services/WeeklyFinancialReport/WeeklyFinancialReportSorting.test.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue/docker-build

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant