-
Notifications
You must be signed in to change notification settings - Fork 520
Add mise install hook and docs #513
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds mise integration: a new Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant Mise as mise (runner)
participant Script as .mise/tasks/install.sh
participant Bundler as bundle
participant NPM as npm
participant Rails as bin/rails
rect rgb(230, 248, 255)
Dev->>Mise: run "mise install"
Mise->>Script: execute install.sh
end
rect rgb(240,255,230)
Script->>Bundler: check `bundle` in PATH
alt bundle missing
Script-->>Dev: exit with install guidance
else bundle present
Script->>Bundler: run `bundle check`
alt gems missing
Script->>Bundler: run `bundle install`
end
end
end
rect rgb(255,245,230)
Script->>NPM: check `npm` in PATH
alt npm missing
Script-->>Dev: exit with install guidance
else
Script->>NPM: run `npm install`
end
end
rect rgb(245,230,255)
alt SKIP_DB_SETUP != 1
Script->>Rails: run `bin/rails db:prepare`
Rails-->>Script: db prepared
else SKIP_DB_SETUP = 1
Script-->>Dev: skip DB setup
end
end
Script-->>Mise: exit status
Mise-->>Dev: completion result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
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. 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.
Actionable comments posted: 1
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.mise/tasks/install.shREADME.mdmise.toml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-24T16:54:59.198Z
Learnt from: CR
Repo: we-promise/sure PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:54:59.198Z
Learning: Start development server using `bin/dev` for Rails, Sidekiq, and Tailwind CSS watcher
Applied to files:
.mise/tasks/install.shREADME.md
🔇 Additional comments (3)
README.md (1)
69-78: LGTM!The documentation clearly explains the new
mise installworkflow while preserving the legacybin/setupoption for users who prefer it. Good balance of brevity and informativeness..mise/tasks/install.sh (1)
14-19: LGTM!Good implementation:
- The
bundle check || bundle installpattern avoids unnecessary reinstalls.- The
SKIP_DB_SETUPenvironment variable provides useful flexibility for CI or containerized environments.- Using
bin/railsensures the correct Rails binstub is invoked.mise.toml (1)
1-8: No issues identified. Ruby 3.4.7 is a valid released version and all tool versions in the configuration are current and appropriate.
| if ! command -v bundle >/dev/null 2>&1; then | ||
| echo "bundle not found in PATH; run 'mise install' first." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! command -v npm >/dev/null 2>&1; then | ||
| echo "npm not found in PATH; run 'mise install' first." | ||
| exit 1 | ||
| fi |
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.
Error messages are misleading.
These error messages tell the user to run mise install, but this script is the install task triggered by mise install. If bundle or npm aren't available, it means mise hasn't activated the Ruby/Node tools yet—not that the user forgot to run mise install.
Consider rewording to clarify the actual issue:
🔎 Proposed fix
if ! command -v bundle >/dev/null 2>&1; then
- echo "bundle not found in PATH; run 'mise install' first."
+ echo "Error: bundle not found. Ensure mise has activated Ruby (mise trust && mise install)."
exit 1
fi
if ! command -v npm >/dev/null 2>&1; then
- echo "npm not found in PATH; run 'mise install' first."
+ echo "Error: npm not found. Ensure mise has activated Node (mise trust && mise install)."
exit 1
fi🤖 Prompt for AI Agents
.mise/tasks/install.sh lines 4-12: the current error messages incorrectly tell
the user to "run 'mise install' first" even though this script is the install
task; update the messages to clearly state that the required executables
("bundle" and "npm") were not found and instruct the user to either install the
appropriate runtime/toolchain or ensure the tools are available on PATH (for
example by activating the environment or reloading their shell), so replace the
misleading lines with concise guidance to install the missing tool or make it
accessible in PATH.
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.
This does feel a little recursive, no @pepicrft?
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.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
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.
Thoughts, @pepicrft?
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: 0
🧹 Nitpick comments (1)
.mise/tasks/install.sh (1)
18-19: Consider checking npm dependencies before installing.The
bundle checkpattern efficiently skips installation when dependencies are satisfied. For consistency, you could apply a similar check for npm:🔎 Proposed refactor
bundle check >/dev/null 2>&1 || bundle install -npm install +npm list --depth=0 >/dev/null 2>&1 || npm install
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.mise/tasks/install.shREADME.md
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-11-24T16:54:59.198Z
Learnt from: CR
Repo: we-promise/sure PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:54:59.198Z
Learning: Start development server using `bin/dev` for Rails, Sidekiq, and Tailwind CSS watcher
Applied to files:
.mise/tasks/install.sh
📚 Learning: 2025-11-24T16:54:59.198Z
Learnt from: CR
Repo: we-promise/sure PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T16:54:59.198Z
Learning: Use `bin/rubocop -f github -a` for Ruby linting and `bundle exec erb_lint ./app/**/*.erb -a` for ERB templates before opening PR
Applied to files:
.mise/tasks/install.sh
🔇 Additional comments (2)
.mise/tasks/install.sh (2)
1-2: LGTM!The strict error handling flags ensure the script fails fast on errors, undefined variables, or pipe failures.
21-23: LGTM!The conditional DB setup with
SKIP_DB_SETUPprovides a clean escape hatch for environments where database preparation isn't needed or desired.
| cd sure | ||
| cp .env.local.example .env.local | ||
| bin/setup | ||
| mise install |
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.
What if we make mise install the first (and only?) line in bin/setup?
Is is equivalent to all the steps bin/setup used to carry out?
#!/usr/bin/env ruby
require "fileutils"
# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)
def system!(*args)
system(*args, exception: true)
end
FileUtils.chdir APP_ROOT do
# This script is a way to set up or update your development environment automatically.
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
# Add necessary setup steps to this file.
puts "== Installing dependencies =="
system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install")
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end
puts "\n== Preparing database =="
system! "bin/rails db:prepare"
puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"
puts "\n== Restarting application server =="
system! "bin/rails restart"
end
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.
Thoughts, @pepicrft?
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.
For instance: keeping the bin/rails restart sounds like a nice thing, right?
| if ! command -v bundle >/dev/null 2>&1; then | ||
| echo "bundle not found in PATH; run 'mise install' first." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! command -v npm >/dev/null 2>&1; then | ||
| echo "npm not found in PATH; run 'mise install' first." | ||
| exit 1 | ||
| fi |
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.
This does feel a little recursive, no @pepicrft?
| @@ -0,0 +1,8 @@ | |||
| [tools] | |||
| ruby = "3.4.7" | |||
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.
Can this be read from .ruby-version?

Fixes #492
Adds a mise config with a postinstall task that installs Ruby/Node deps and prepares the DB, plus quick-start docs for using mise.
Summary by CodeRabbit
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.