Fix chamber exec failing on --trace flag#11660
Merged
Merged
Conversation
Two fixes for the deployment/release-command flow: 1. Remove --trace from the release_command in fly.toml. Chamber uses cobra for CLI parsing, and cobra consumes --trace even after the -- separator, causing "Error: unknown flag: --trace" on every release. 2. Replace the su --preserve-environment approach in drop_to_www() with gosu. gosu exec's directly without an intermediate shell layer, which is cleaner and avoids any argument-mangling when passing commands through the privilege drop. Install gosu via apt in the Dockerfile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
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.
Purpose
Two more fixes for the deployment/release-command flow, following on from the OIDC token work.
Chamber 3.1.5 uses cobra for CLI parsing, and cobra has a known quirk where it consumes
--traceeven after the--argument separator. Sochamber exec SERVICE -- bundle exec rails release:perform --tracewas failing withError: unknown flag: --trace. The fix is just to drop--tracefrom therelease_commandinfly.toml— it's a Rails debug flag that's not useful in production anyway.While in here, I also replaced the
su --preserve-environmentapproach indrop_to_www()withgosu.gosuexec's directly without spawning an intermediate shell, which is cleaner and sidesteps any argument-mangling in the shell invocation layer. This also removes the need to install gosu separately — it's in the Debian package repos.Changes
fly.toml: remove--tracefromrelease_commandbin/entrypoint.sh: replacesu --preserve-environmentwithexec gosu www "$@"Dockerfile: addgosuto theapt-get installline🤖 Generated with Claude Code