Skip to content
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

feat: add hot reloading on dev mode #33

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

zulkhair
Copy link
Collaborator

@zulkhair zulkhair commented Feb 1, 2024

Closes: WORLD-757

Overview

Adding hot reload on world cardinal dev command

Brief Changelog

  • Modify a way to run cardinal from using plain go run to wrapped using fresh library

Testing and Verifying

  • Run the binary in linux(ubuntu)
  • Run the binary in windows

Summary by CodeRabbit

  • Refactor
    • Enhanced development environment setup for better efficiency.
  • Chores
    • Integrated a subproject update to ensure the latest features and fixes are included.
  • New Features
    • Added import for github.com/gravityblast/fresh/runner.
  • Bug Fixes
    • Removed the runCardinal function call and related error handling.
    • Changed directory to "cardinal" and set environment variable "RUNNER_IGNORED" before starting runner.Start().

Copy link
Collaborator Author

zulkhair commented Feb 1, 2024

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

Copy link

coderabbitai bot commented Feb 1, 2024

Walkthrough

This update introduces hot reloading to the World CLI's development mode, streamlining the development process by automatically refreshing the code upon file changes. By incorporating the fresh runner and modifying the development environment setup, developers can now enjoy a more efficient workflow with instant feedback on their changes, eliminating the need for manual restarts.

Changes

File Path Change Summary
cmd/world/cardinal/dev.go - Added import for github.com/zulkhair/fresh/runner
- Removed the runCardinal function call and related error handling
- Changed directory to "cardinal" and set environment variable "RUNNER_IGNORED" before starting runner.Start()

Assessment against linked issues

Objective Addressed Explanation
Add hot reloading to World CLI dev mode (WORLD-757)

Poem

In the realm where code rabbits hop,
A fresh breeze flows, no need for a stop.
🌟 With each change, anew,
🔄 Our world renews, on cue.

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

codecov bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (384b929) 47.97% compared to head (bcb810b) 47.97%.

❗ Current head bcb810b differs from pull request most recent head 125ed24. Consider uploading reports for the commit 125ed24 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #33   +/-   ##
=======================================
  Coverage   47.97%   47.97%           
=======================================
  Files           8        8           
  Lines         469      469           
=======================================
  Hits          225      225           
  Misses        229      229           
  Partials       15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zulkhair zulkhair marked this pull request as ready for review February 1, 2024 23:33
@zulkhair zulkhair requested a review from a team February 1, 2024 23:33
Copy link

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 384b929 and 5697e54.
Files ignored due to path filters (2)
  • go.mod is excluded by: !**/*.mod
  • go.sum is excluded by: !**/*.sum
Files selected for processing (2)
  • cmd/world/cardinal/dev.go (3 hunks)
  • sttt (1 hunks)
Files skipped from review due to trivial changes (1)
  • sttt
Additional comments: 2
cmd/world/cardinal/dev.go (2)
  • 16-16: The import of github.com/gravityblast/fresh/runner is correctly added to enable hot reloading functionality. Ensure that the fresh library version used is compatible with the project's Go version and other dependencies to avoid conflicts.
  • 73-81: The removal of the runCardinal function and its error handling, as mentioned in the PR summary, shifts the execution responsibility to the fresh runner. This is a significant architectural change. Ensure that all functionalities and error handling previously covered by runCardinal are adequately addressed or are no longer necessary with the new hot reloading setup.

cmd/world/cardinal/dev.go Outdated Show resolved Hide resolved
@zulkhair zulkhair force-pushed the daim/world-757-add_hot_reloading_on_dev_mode branch from 5697e54 to 04487c0 Compare February 4, 2024 11:18
Copy link

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 384b929 and 04487c0.
Files ignored due to path filters (2)
  • go.mod is excluded by: !**/*.mod
  • go.sum is excluded by: !**/*.sum
Files selected for processing (1)
  • cmd/world/cardinal/dev.go (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • cmd/world/cardinal/dev.go

@zulkhair zulkhair force-pushed the daim/world-757-add_hot_reloading_on_dev_mode branch from 04487c0 to 94b6df6 Compare February 4, 2024 15:00
Copy link

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 384b929 and 94b6df6.
Files ignored due to path filters (2)
  • go.mod is excluded by: !**/*.mod
  • go.sum is excluded by: !**/*.sum
Files selected for processing (1)
  • cmd/world/cardinal/dev.go (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • cmd/world/cardinal/dev.go

cmd/world/cardinal/dev.go Outdated Show resolved Hide resolved
@jerargus
Copy link
Contributor

jerargus commented Feb 5, 2024

Holy cow, this is great!

@zulkhair zulkhair force-pushed the daim/world-757-add_hot_reloading_on_dev_mode branch 2 times, most recently from c95b668 to 66b2b6f Compare February 6, 2024 13:14
Copy link

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 384b929 and c95b668.
Files ignored due to path filters (2)
  • go.mod is excluded by: !**/*.mod
  • go.sum is excluded by: !**/*.sum
Files selected for processing (1)
  • cmd/world/cardinal/dev.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • cmd/world/cardinal/dev.go

@zulkhair zulkhair force-pushed the daim/world-757-add_hot_reloading_on_dev_mode branch from 66b2b6f to bcb810b Compare February 6, 2024 13:22
Copy link

graphite-app bot commented Feb 7, 2024

Merge activity

Closes: WORLD-757

## Overview

Adding hot reload on `world cardinal dev` command

## Brief Changelog

- Modify a way to run cardinal from using plain `go run` to wrapped using `fresh` library

## Testing and Verifying

- Run the binary in linux(ubuntu)
- Run the binary in windows

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Refactor**
	- Enhanced development environment setup for better efficiency.
- **Chores**
	- Integrated a subproject update to ensure the latest features and fixes are included.
- **New Features**
	- Added import for `github.com/gravityblast/fresh/runner`.
- **Bug Fixes**
	- Removed the `runCardinal` function call and related error handling.
	- Changed directory to "cardinal" and set environment variable "RUNNER_IGNORED" before starting `runner.Start()`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@zulkhair zulkhair force-pushed the daim/world-757-add_hot_reloading_on_dev_mode branch from bcb810b to 125ed24 Compare February 7, 2024 10:26
Copy link

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 384b929 and 125ed24.
Files ignored due to path filters (2)
  • go.mod is excluded by: !**/*.mod
  • go.sum is excluded by: !**/*.sum
Files selected for processing (1)
  • cmd/world/cardinal/dev.go (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • cmd/world/cardinal/dev.go

@graphite-app graphite-app bot merged commit 125ed24 into main Feb 7, 2024
5 checks passed
@zulkhair zulkhair deleted the daim/world-757-add_hot_reloading_on_dev_mode branch May 30, 2024 02:25
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