Skip to content

Reload the development server when application code changes - #5

Merged
dblock merged 1 commit into
masterfrom
fix-development-reloading
Oct 27, 2026
Merged

dblock merged 1 commit into
masterfrom
fix-development-reloading

Conversation

@dblock

@dblock dblock commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Fixes #1.

Add Rerun only to the development dependencies and configure it to watch app.rb and Ruby files under api/, app/, and config/. Document bundle exec rerun -- ruby app.rb -sv -e development, with a polling option for shared filesystems. The ordinary server command remains unchanged.

Restart the whole process deliberately: Grape compiles routes and retains references to mounted API classes, so Rack::Reloader can reload a file without updating the mounted routes. This avoids relying on obsolete ActiveSupport autoloading APIs or clearing constants while concurrent requests are running. Development restarts can interrupt requests, as documented.

Add an isolated regression test that starts the actual watcher/server, waits for watcher readiness, edits a copied API file, verifies the new route and JSON response over HTTP, and confirms the old route returns 404. Temporary files and the watcher/server process group are cleaned up afterward.

Local validation passes on Ruby 3.3/Goliath 1.0 and Ruby 2.7/Goliath 0.9 (two examples each), with RuboCop clean. All five hosted Ruby/Goliath matrix jobs, RuboCop, and Coveralls pass: https://github.com/ruby-grape/grape-on-goliath/actions/runs/40505201217 (tests and coverage), https://github.com/ruby-grape/grape-on-goliath/actions/runs/40505201256 (lint).

AI-authored on behalf of @dblock.

Use a development-only Rerun watcher to rebuild mounted Grape routes in a fresh server process. Document the command and verify changed routes and responses over real HTTP on modern and legacy Goliath.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dblock
dblock merged commit 2aa40fe into master Oct 27, 2026
14 checks passed
@dblock
dblock deleted the fix-development-reloading branch October 27, 2026 12:39
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.

doesn't autoload in development mode

1 participant