Auto-trust mise config files in workspace (#328)#331
Merged
Conversation
Set MISE_TRUSTED_CONFIG_PATHS to the container workspace path via /etc/profile.d/coi-mise-trust.sh so mise doesn't prompt or error when the workspace contains mise.toml / .tool-versions.
The /etc/profile.d/ approach only works for login shells, but the bash session inside containers (via tmux) is a non-login shell that only sources ~/.bashrc. mise activate in ~/.bashrc runs before the env var is set, causing trust errors. Fix: also prepend MISE_TRUSTED_CONFIG_PATHS to /etc/bash.bashrc which is sourced before ~/.bashrc for all interactive shells. Extract SetupMiseTrust into a shared function and call it from both coi shell (setup.go) and coi run (run.go). Add integration tests verifying the env var is set in both login and non-login shell contexts.
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
MISE_TRUSTED_CONFIG_PATHSto the container workspace path via/etc/profile.d/coi-mise-trust.shduring session setupmise trustwhen a workspace containsmise.toml,.tool-versions, or other mise config filesCloses #328
Test plan
go vet ./internal/session/...— compiles cleanlygo test ./internal/session/... -count=1— unit tests passcoi shellinto a workspace withmise.toml, verifyecho $MISE_TRUSTED_CONFIG_PATHSshows the workspace pathmise install/mise xwork without prompting to trust