Skip to content

fix(release): adds notifications to docker setup#1368

Merged
ygrishajev merged 1 commit intomainfrom
feature/notifications
May 26, 2025
Merged

fix(release): adds notifications to docker setup#1368
ygrishajev merged 1 commit intomainfrom
feature/notifications

Conversation

@ygrishajev
Copy link
Contributor

@ygrishajev ygrishajev commented May 26, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a new notifications service across development and production environments, now available as part of the Docker Compose setup.
    • Added environment variables and database configurations to support the notifications service.
  • Chores

    • Updated and streamlined npm scripts for development and production workflows.
    • Adjusted dependencies by adding and removing packages as necessary for improved reliability and performance.

@ygrishajev ygrishajev requested a review from a team as a code owner May 26, 2025 15:49
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 26, 2025

"""

Walkthrough

A notifications service was integrated into the Docker Compose environment, including development, production, and build configurations. The notifications app's package.json was updated with new scripts and dependencies. Environment variables and database configuration were adjusted to support the new service, and related dependencies were cleaned up from the root package.json.

Changes

File(s) Change Summary
apps/notifications/package.json Added/modified npm scripts for migrations; added "express" dependency.
package.json Removed "@akashnetwork/notifications" and "@b12k/mvm" dependencies.
packages/docker/.env.sandbox.docker-compose-dev Fixed env syntax; added DB_HOST, NOTIFICATIONS_API_BASE_URL; extended POSTGRES_DBS with new databases.
packages/docker/docker-compose.build.yml Added notifications service with image, build context, Dockerfile, target, and build args.
packages/docker/docker-compose.dev.yml Added notifications service with development build target and volume mounts.
packages/docker/docker-compose.prod-with-db.yml Added notifications service with dependency on db health.
packages/docker/docker-compose.prod.yml Added notifications service; updated deploy-web dependencies; removed DB_HOST from api service.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Docker as Docker Compose
    participant Notifications as Notifications Service
    participant DB as Database

    Dev->>Docker: Start environment
    Docker->>DB: Start DB service
    Docker->>Notifications: Start notifications service (waits for DB health)
    Notifications->>DB: Run migrations (predev/preprod)
    Notifications->>Dev: Service ready on port 3000
Loading

Possibly related PRs

Suggested reviewers

  • stalniy

Poem

In Docker’s warren, a new friend hops in,
Notifications now join, let the service begin!
With scripts all prepared and the database near,
Compose brings them close, their mission is clear.
🐇✨
The stack grows together, with a hop and a cheer!
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b80ad6 and 19280e2.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • apps/notifications/package.json (2 hunks)
  • package.json (0 hunks)
  • packages/docker/.env.sandbox.docker-compose-dev (1 hunks)
  • packages/docker/docker-compose.build.yml (1 hunks)
  • packages/docker/docker-compose.dev.yml (1 hunks)
  • packages/docker/docker-compose.prod-with-db.yml (1 hunks)
  • packages/docker/docker-compose.prod.yml (2 hunks)
💤 Files with no reviewable changes (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/docker/docker-compose.prod-with-db.yml
  • packages/docker/.env.sandbox.docker-compose-dev
  • packages/docker/docker-compose.dev.yml
  • packages/docker/docker-compose.build.yml
  • packages/docker/docker-compose.prod.yml
  • apps/notifications/package.json
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: test-deploy-web-build
  • GitHub Check: validate-notifications
  • GitHub Check: test-provider-console-build
  • GitHub Check: validate-api
  • GitHub Check: test-api-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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • 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.

@codecov
Copy link

codecov bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.22%. Comparing base (a246391) to head (19280e2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #1368    +/-   ##
========================================
  Coverage   35.22%   35.22%            
========================================
  Files         805      805            
  Lines       19592    19592            
  Branches     3621     3611    -10     
========================================
  Hits         6901     6901            
+ Misses      12104    11958   -146     
- Partials      587      733   +146     
Flag Coverage Δ
api 64.26% <ø> (ø)
deploy-web 14.77% <ø> (ø)
notifications 88.67% <ø> (ø)
provider-proxy 80.09% <ø> (ø)

see 47 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (2)
packages/docker/.env.sandbox.docker-compose-dev (1)

27-27: Normalize POSTGRES_DBS assignment
If you decide to switch all entries to KEY=VALUE, also update this line:

- POSTGRES_DBS: console-users,console-akash-sandbox,notification_service,events
+ POSTGRES_DBS=console-users,console-akash-sandbox,notification_service,events
packages/docker/docker-compose.prod.yml (1)

42-42: Enhance startup ordering with a healthcheck

The deploy-web service now depends on notifications, but Compose v3’s depends_on only waits for containers to start, not for services to be ready. Consider adding a healthcheck to the notifications service and using condition: service_healthy to ensure deploy-web doesn’t start before notifications is fully up.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a246391 and 0b80ad6.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • apps/notifications/package.json (2 hunks)
  • package.json (0 hunks)
  • packages/docker/.env.sandbox.docker-compose-dev (2 hunks)
  • packages/docker/docker-compose.build.yml (1 hunks)
  • packages/docker/docker-compose.dev.yml (1 hunks)
  • packages/docker/docker-compose.prod-with-db.yml (1 hunks)
  • packages/docker/docker-compose.prod.yml (2 hunks)
💤 Files with no reviewable changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: validate-api
  • GitHub Check: test-provider-console-build
  • GitHub Check: test-deploy-web-build
  • GitHub Check: validate-notifications
🔇 Additional comments (4)
packages/docker/docker-compose.dev.yml (1)

11-19:

Details

✅ Verification successful

Dev build block for notifications looks correct
The service follows the same pattern as other dev services (target=development, code mounts). Ensure your default Dockerfile in packages/docker supports this build context and stage.

You can verify the Dockerfile’s presence with:


🏁 Script executed:

#!/bin/bash
# Verify the default Dockerfile is reachable
fd Dockerfile.node | grep -q 'packages/docker/Dockerfile.node' && echo "✔ Dockerfile found"

Length of output: 109


🏁 Script executed:

#!/bin/bash
# Verify the Dockerfile.node has a 'development' build stage
if grep -i -q -E 'FROM .+ as development' packages/docker/Dockerfile.node; then
  echo "✔ development stage found"
else
  echo "✖ 'development' stage missing"
fi

Length of output: 133


Dev build block for notifications confirmed

  • Verified packages/docker/Dockerfile.node exists
  • Confirmed it includes a development build stage

No further changes needed.

apps/notifications/package.json (2)

10-11: Added predev script to run migrations before development
This guarantees your schema is up-to-date when running npm run dev. Nice improvement!


16-17: Added preprod script and streamlined prod
Separating migrations into pre-scripts keeps the startup commands focused. Well done.

packages/docker/docker-compose.build.yml (1)

12-20: Build configuration for notifications aligns with other services
The image, build context, Dockerfile, target, and args match the established pattern. No issues found here.

@ygrishajev ygrishajev force-pushed the feature/notifications branch from 0b80ad6 to 19280e2 Compare May 26, 2025 16:10
@ygrishajev ygrishajev merged commit 6951faf into main May 26, 2025
30 of 31 checks passed
@ygrishajev ygrishajev deleted the feature/notifications branch May 26, 2025 16:28
@coderabbitai coderabbitai bot mentioned this pull request Oct 27, 2025
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.

2 participants

Comments