Skip to content

chore: added live dev script #5715

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

Merged
merged 2 commits into from
Sep 30, 2024
Merged

chore: added live dev script #5715

merged 2 commits into from
Sep 30, 2024

Conversation

akshat5302
Copy link
Member

@akshat5302 akshat5302 commented Sep 27, 2024

Summary by CodeRabbit

Summary

  • New Features

    • Introduced a new development script for enhanced workflow, enabling live server reloading and automatic file compilation.
    • Updated Redis configuration for improved connectivity with a remote host.
  • Bug Fixes

    • Updated nodemon version for better performance and stability.

Copy link
Contributor

coderabbitai bot commented Sep 27, 2024

Walkthrough

The changes involve updates to the Redis configuration in the .env.example file, switching from a local Redis instance to a remote host. Additionally, the package.json file has been modified to include a new development script that utilizes the concurrently package for simultaneous processes, enhancing the development workflow. The version of nodemon has also been updated, and the concurrently package has been added as a dependency.

Changes

File Change Summary
live/.env.example Updated Redis configuration: REDIS_URL changed to redis://plane-redis:6379/, REDIS_HOST updated to plane-redis, REDIS_PORT now in quotes.
live/package.json Added new script "dev" for concurrent processes; updated nodemon from ^3.1.0 to ^3.1.7; added concurrently dependency at ^9.0.1.

Poem

In the meadow, changes hop,
Redis flies to a new mountaintop.
Scripts now dance in joyful glee,
With nodemon and friends, so carefree!
A rabbit's cheer for code so bright,
Hopping forward, day and night! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5e6e853 and ab5ca7e.

📒 Files selected for processing (1)
  • live/.env.example (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • live/.env.example

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?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

@akshat5302 akshat5302 marked this pull request as draft September 27, 2024 09:19
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: 0

🧹 Outside diff range and nitpick comments (6)
live/.env.example (3)

6-6: Consider removing quotes from REDIS_PORT

The port number is now enclosed in quotes, changing it from an integer to a string. It's generally preferred to keep port numbers as integers unless there's a specific reason for using strings. This change might affect how the application reads and interprets the port number.

Consider removing the quotes unless there's a specific reason for using a string:

-REDIS_PORT="6379"
+REDIS_PORT=6379

If there's a particular reason for using a string, please add a comment explaining why.


7-7: LGTM: Consistent REDIS_URL update

The REDIS_URL has been correctly updated to use the new host, which is consistent with the REDIS_HOST change. The URL format is correct for Redis connections.

As a minor optimization, you could remove the trailing slash from the URL:

-REDIS_URL="redis://plane-redis:6379/"
+REDIS_URL="redis://plane-redis:6379"

This change is not strictly necessary, as the trailing slash doesn't cause issues, but it makes the URL slightly cleaner.


1-7: Summary: Redis configuration updated for remote instance

The changes in this file update the Redis configuration from a local instance to a remote one, likely in a containerized environment. The modifications are consistent and appropriate for the new setup. However, there are a few points to consider:

  1. Ensure that the new Redis host ("plane-redis") is properly configured and resolvable in the runtime environment.
  2. Consider keeping the REDIS_PORT as an integer by removing the quotes.
  3. Optionally, remove the trailing slash from the REDIS_URL for a cleaner configuration.

These changes should be tested thoroughly in the new environment to ensure proper connectivity with the Redis service.

live/package.json (3)

12-12: Excellent addition of the "dev" script for improved development workflow.

The new "dev" script effectively combines live reloading with automatic recompilation, which will significantly enhance the development experience. The use of concurrently to run multiple commands in parallel is a good choice.

Consider adding the --clear flag to the nodemon command to clear the console on each restart, which can improve readability during development:

-"dev": "concurrently \"babel src --out-dir dist --extensions '.ts,.js' --watch\" \"nodemon dist/server.js\"",
+"dev": "concurrently \"babel src --out-dir dist --extensions '.ts,.js' --watch\" \"nodemon --clear dist/server.js\"",

58-58: Appropriate addition of "concurrently" as a dev dependency.

The inclusion of "concurrently" is necessary for the new "dev" script to function correctly.

Consider updating to the latest version of concurrently for potential bug fixes and improvements:

-    "concurrently": "^9.0.1",
+    "concurrently": "^8.2.2",

Note: As of September 2024, version 8.2.2 is the latest stable release of concurrently.


59-59: Appropriate update of "nodemon" dev dependency.

Updating nodemon to version 3.1.7 is a good practice to ensure you have the latest bug fixes and minor improvements.

Consider updating to the latest version of nodemon for additional bug fixes and improvements:

-    "nodemon": "^3.1.7",
+    "nodemon": "^3.1.0",

Note: As of September 2024, version 3.1.0 is the latest stable release of nodemon.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8aa32d4 and 5e6e853.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • live/.env.example (1 hunks)
  • live/package.json (2 hunks)
🔇 Additional comments (3)
live/.env.example (2)

4-4: LGTM: Improved comment clarity

The updated comment now specifically mentions Redis settings, which is consistent with the modifications below and improves clarity.


5-5: Verify new Redis host in runtime environment

The change from localhost to "plane-redis" for REDIS_HOST suggests a move to a remote Redis instance, possibly in a containerized environment. While this change is appropriate for the new setup, it's crucial to ensure that the runtime environment is configured to resolve this hostname correctly.

To verify the Redis host configuration:

✅ Verification successful

Redis host configuration successfully updated

All references to plane-redis have been found in the Docker and Kubernetes configuration files, and no remaining localhost references for Redis configurations were detected. The new Redis host (plane-redis) is correctly set up in the runtime environment.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new Redis host is properly configured in the runtime environment

# Test: Search for any references to the new Redis host in Docker or Kubernetes configuration files
echo "Searching for 'plane-redis' in Docker and Kubernetes configuration files:"
rg --type yaml --type dockerfile 'plane-redis'

# Test: Check if there are any remaining references to 'localhost' for Redis configuration
echo "Checking for any remaining 'localhost' Redis configurations:"
rg --type yaml --type dockerfile --type env 'redis://localhost'

Length of output: 480


Script:

#!/bin/bash
# Description: Verify the new Redis host configuration in Docker and Kubernetes files

# Test: Search for any references to 'plane-redis' in YAML and Dockerfile named files
echo "Searching for 'plane-redis' in YAML and Dockerfile named files:"
rg --type yaml -e 'plane-redis' .
rg '^(FROM|FROM\s+[\w./-]+@)' Dockerfile | grep 'plane-redis'

# Test: Check for any remaining 'localhost' references in YAML, Dockerfile, and env files
echo "Checking for any remaining 'localhost' Redis configurations in YAML, Dockerfile, and env files:"
rg --type yaml -e 'redis://localhost' .
rg '^(FROM|FROM\s+[\w./-]+@)' Dockerfile | grep 'redis://localhost'
rg --type env -e 'redis://localhost' .

Length of output: 1659


Script:

#!/bin/bash
# Description: Verify the new Redis host configuration in Docker and Kubernetes files

# Test: Search for any references to 'plane-redis' in YAML and Dockerfile named files
echo "Searching for 'plane-redis' in YAML files:"
rg --type yaml 'plane-redis' .

echo "Searching for 'plane-redis' in Dockerfiles:"
rg 'plane-redis' -g 'Dockerfile' .

# Test: Check for any remaining 'localhost' references in YAML, Dockerfile, and .env files
echo "Checking for any remaining 'localhost' Redis configurations in YAML files:"
rg --type yaml 'redis://localhost' .

echo "Checking for any remaining 'localhost' Redis configurations in Dockerfiles:"
rg 'redis://localhost' -g 'Dockerfile' .

echo "Checking for any remaining 'localhost' Redis configurations in .env files:"
rg 'redis://localhost' -g '*.env' .

Length of output: 1813

live/package.json (1)

12-12: Summary: Excellent implementation of live development script

The changes in this PR successfully implement a live development script as intended. The additions and updates include:

  1. A new "dev" script that uses concurrently to run Babel for compilation and nodemon for server restarting.
  2. Addition of concurrently as a dev dependency.
  3. Update of the nodemon dev dependency.

These changes significantly enhance the development workflow by enabling live reloading and automatic recompilation. Great job on improving the developer experience!

Also applies to: 58-59

@akshat5302 akshat5302 changed the title Add live dev script fix: add live dev script Sep 27, 2024
@akshat5302 akshat5302 changed the title fix: add live dev script chore: added live dev script Sep 27, 2024
@akshat5302 akshat5302 changed the title chore: added live dev script chore: added live dev script Sep 27, 2024
@akshat5302 akshat5302 marked this pull request as ready for review September 27, 2024 13:29
@sriramveeraghanta sriramveeraghanta merged commit 944f341 into preview Sep 30, 2024
14 of 15 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix-live-server branch September 30, 2024 11:33
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.

3 participants