feat(makefile): docker_network/docker_volumes + rspec-rails detection (#46, #48)#49
Merged
matthew-on-git merged 1 commit intoMay 29, 2026
Conversation
Bundles two downstream Rails-sync fixes surfaced from tipsyhive. #48 (Added): new optional .devrail.yml keys `docker_network` (single network name -> --network) and `docker_volumes` (list -> repeated -v), injected into DOCKER_RUN. Lets projects reach a sibling service container (e.g. Postgres at `myapp-pg`) and mount extra data during `make test`. Mirrors the existing `env:` -> DEVRAIL_ENV_FLAGS pattern; no-ops when absent. #46 (Fixed): RUBY_EXEC_FOR now keys rspec detection on `rspec-core` (the runner gem) instead of a bare `rspec` lock entry. Rails apps declare only `rspec-rails`, so the old pattern skipped `bundle exec` and ran the container's bundled rspec, activating Ruby 3.4's default cgi 0.4.2 before bundler/setup (Gem::LoadError vs lock-pinned 0.5.1). Preserves the "only bundle exec when the project pins the tool" behaviour for non-Rails projects. Regression coverage added to tests/smoke-rails.sh (sections 5 and 6) via `make --eval` probes against the mounted Makefile. README and CHANGELOG updated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
matthew-on-git
added a commit
to devrail-dev/devrail-standards
that referenced
this pull request
May 29, 2026
…rail.yml Three top-level keys that the reference Makefile already (or now) reads were previously undocumented in the canonical schema reference: - env: project-specific environment variables passed into the toolchain container via -e KEY=value (DEVRAIL_ENV_FLAGS). Existing feature, documented for the first time. - docker_network: attaches the container to a user-defined Docker network via --network <name>, so it can reach sibling service containers (e.g. a Postgres at hostname `myapp-pg` during `make test`). New in dev-toolchain #48. - docker_volumes: additional `docker -v` mounts. New in dev-toolchain #48. The Single-Language Project (Ruby on Rails) example is extended to show the sibling-Postgres pattern that motivated #48. Companion to devrail-dev/dev-toolchain#49. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bundles two downstream Rails-sync fixes surfaced from tipsyhive into one PR.
.devrail.ymlkeys for customizing the toolchain container'sdocker run:docker_network— a single user-defined network name, rendered as--network <name>, so the container can reach a sibling service container (e.g. a Postgres at hostnamemyapp-pgduringmake test).docker_volumes— a list ofhost:container(orvolume:container) mount specs, each rendered as-v <spec>.DOCKER_RUN, mirror the existingenv:→DEVRAIL_ENV_FLAGSpattern, and are no-ops when absent.RUBY_EXEC_FORnow keys rspec detection onrspec-core(the runner gem) instead of a barerspeclock entry. Rails apps declare onlyrspec-rails, so the old pattern skippedbundle execand ran the container's bundled rspec — activating Ruby 3.4's defaultcgi 0.4.2before bundler/setup could switch to the lock-pinnedcgi 0.5.1(Gem::LoadError). The fix preserves the "onlybundle execwhen the project pins the tool" behaviour for non-Rails projects.Design notes (#48 open questions, resolved)
docker_network, not a list —docker runonly honors one--networkat launch; additional networks require a separatedocker network connect. A single value matches Docker's actual behaviour.docker_volumesincluded alongsidedocker_network(list of-vspecs;docker rundoes honor multiple-v)..devrail.yml, mirroringenv:— declarative and in-band, rather than a newMakefile.localinclude hook.Test plan
make checkpasses (lint/format/scan/docs; test/security skip for the bash-only repo)tests/smoke-rails.shextended with section 5 (Ruby: RUBY_EXEC_FOR,rspec macro fails to detect rspec-rails-based projects #46) and section 6 (make test fails locally for Rails projects with a sibling Postgres container #48), run green against:local:Gemfile.lock(no barerspec) →bundle exec✔bundle exec) ✔docker_network/docker_volumes→ correct--network/-vflags ✔make --evalagainst the mounted Makefile (no bundle install / DB needed)Closes #46
Closes #48
🤖 Generated with Claude Code