feat: make TOWER_ENVIRONMENT ordinary passthrough in local runs#289
Merged
Conversation
make_env_vars injected TOWER_ENVIRONMENT as the last step of building a run's env, unconditionally, so it overwrote any value a caller had already set in the env map. Drop the special case and let the value pass through like any other env var. The local run path now supplies it explicitly from the resolved --environment arg, which defaults to "default" — so a local run with no flag still gets TOWER_ENVIRONMENT=default, as before. The now-unused env parameter and its threading through execute_bash_program go with it.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
bradhe
approved these changes
Jun 8, 2026
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.
make_env_varsinjectedTOWER_ENVIRONMENTas the last step of building a run's env, unconditionally. Because it ran last it overwrote any value a caller had already put in the env map — the hardcoded value always won.This drops the special case so the var passes through like everything else.
make_env_varsno longer injects it, and loses its now-unusedenvparam along with the dead threading throughexecute_bash_program. The local run path inrun.rssupplies it explicitly from the resolved--environmentarg instead, next to the existingTOWER__RUNTIME__IS_LOCAL. The arg defaults todefault, so a local run with no flag still getsTOWER_ENVIRONMENT=defaultlike before.