Skip to content

rack env is the way #47

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

Merged
merged 2 commits into from
Jun 13, 2025
Merged

rack env is the way #47

merged 2 commits into from
Jun 13, 2025

Conversation

GrantBirki
Copy link
Member

This pull request introduces updates to improve environment configuration handling in the Hooks framework, primarily by standardizing the use of the RACK_ENV environment variable.

@Copilot Copilot AI review requested due to automatic review settings June 13, 2025 18:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 environment keys
  • Revise docs and examples to recommend RACK_ENV, and bump version to 0.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

@GrantBirki GrantBirki merged commit 900161a into main Jun 13, 2025
22 checks passed
@GrantBirki GrantBirki deleted the rack-env branch June 13, 2025 18:08
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.

1 participant