Skip to content

Auto-trust mise config files in workspace (#328)#331

Merged
mensfeld merged 3 commits intomasterfrom
feature/mise-trust-workspace
Apr 14, 2026
Merged

Auto-trust mise config files in workspace (#328)#331
mensfeld merged 3 commits intomasterfrom
feature/mise-trust-workspace

Conversation

@mensfeld
Copy link
Copy Markdown
Owner

@mensfeld mensfeld commented Apr 14, 2026

Summary

  • Sets MISE_TRUSTED_CONFIG_PATHS to the container workspace path via /etc/profile.d/coi-mise-trust.sh during session setup
  • Eliminates the need for manual mise trust when a workspace contains mise.toml, .tool-versions, or other mise config files
  • Non-fatal: logs a warning and continues if the profile.d file cannot be created

Closes #328

Test plan

  • go vet ./internal/session/... — compiles cleanly
  • go test ./internal/session/... -count=1 — unit tests pass
  • Manual: coi shell into a workspace with mise.toml, verify echo $MISE_TRUSTED_CONFIG_PATHS shows the workspace path
  • Manual: verify mise install / mise x work without prompting to trust

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.
@mensfeld mensfeld merged commit 339d854 into master Apr 14, 2026
14 checks passed
@mensfeld mensfeld deleted the feature/mise-trust-workspace branch April 14, 2026 17:24
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.

auto-trust mise

1 participant