rack env is the way#47
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR standardizes environment handling by leveraging the RACK_ENV variable throughout the Hooks framework.
- Switch to
ENV.fetch("RACK_ENV")in scripts and core loader - Update acceptance tests and example configs to comment out manual
environmentkeys - Revise docs and examples to recommend
RACK_ENV, and bump version to0.1.0
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| spec/acceptance/docker-compose.yml | Add RACK_ENV env var for service |
| spec/acceptance/config/hooks.yaml | Comment out environment key and note RACK_ENV recommendation |
| script/hooks | Use ENV.fetch("RACK_ENV") for environment and update thread range |
| lib/hooks/version.rb | Bump version from 0.0.7 to 0.1.0 |
| lib/hooks/core/config_loader.rb | Load default environment from RACK_ENV |
| docs/instrument_plugins.md | Replace RAILS_ENV with RACK_ENV in instrument examples |
| docs/configuration.md | Add note on RACK_ENV precedence and recommendation |
| README.md | Annotate example configs to reflect RACK_ENV override |
Comments suppressed due to low confidence (3)
docs/configuration.md:90
- [nitpick] Consider replacing the informal "TL;DR" header with a more formal note or heading (e.g., "Note:") to maintain consistency and professional tone in documentation.
**TL;DR**: If you want to use `RACK_ENV`, just don't set the `environment` key in your `hooks.yaml` file.
README.md:45
- Inline comments inside YAML code blocks can break when copying into actual config files; consider moving this note out of the code block or documenting it separately to avoid parsing issues.
environment: development # will be overridden by the RACK_ENV environment variable if set
spec/acceptance/config/hooks.yaml:19
- [nitpick] Rephrase the comment to remove subjective language (e.g., replace 'it is better to use' with 'use' or 'recommended to use') for clarity and professionalism.
# environment: development # it is better to use the environment variable RACK_ENV to control the environment
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.
This pull request introduces updates to improve environment configuration handling in the Hooks framework, primarily by standardizing the use of the
RACK_ENVenvironment variable.