Repository navigation
feat(mise): bootstrap WSL environment - #3702
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
dotfiles-worker | 4457db3 | Jul 14 2026, 10:23 PM |
Reviewer's GuideThis PR refactors WSL bootstrap to delegate most user-space setup (APT packages, dotfiles, and mise tools) to File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- The new
bootstraptask intasks.tomlassumes bash semantics (e.g.,[[ ... ]]), but doesn’t setshell = "bash", which will cause failures if the default shell is/bin/sh; consider either declaringshell = "bash"for this task or rewriting the conditionals in POSIX[ ]form.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `bootstrap` task in `tasks.toml` assumes bash semantics (e.g., `[[ ... ]]`), but doesn’t set `shell = "bash"`, which will cause failures if the default shell is `/bin/sh`; consider either declaring `shell = "bash"` for this task or rewriting the conditionals in POSIX `[ ]` form.
## Individual Comments
### Comment 1
<location path="wsl/install.sh" line_range="210-211" />
<code_context>
-
- run_git_setup_script "${dotfiles_dir}"
+ log_info "Bootstrapping packages, dotfiles, and tools with mise..."
+ mise trust --yes "${dotfiles_dir}/mise.toml"
+ mise --cd "${dotfiles_dir}" bootstrap --yes --update --force-dotfiles --locked
+ log_info "mise bootstrap completed."
</code_context>
<issue_to_address>
**issue (bug_risk):** The new `mise bootstrap` call does not invoke the bootstrap task you added in `tasks.toml`, so the post-setup steps are no longer executed.
Those post-setup actions were moved into the `[bootstrap]` task in `tasks.toml`, but `mise ... bootstrap` calls the built-in subcommand (using `mise.toml`), not that task. As a result, your new post-bootstrap steps won’t run. You likely want to invoke the task runner instead, e.g. `mise --cd "${dotfiles_dir}" run bootstrap`, or move all bootstrap behavior into `mise.toml` so there’s a single, correctly executed source of truth.
</issue_to_address>
### Comment 2
<location path="tasks.toml" line_range="17-26" />
<code_context>
"""
description = "Run hk linters and formatters."
+[bootstrap]
+description = "Finish idempotent WSL user setup after packages, dotfiles, and tools are installed."
+run = '''
+mkdir --parents "${HOME}/.gnupg"
+chmod 700 "${HOME}/.gnupg"
+
+username=$(whoami)
+if ! groups "${username}" | grep --quiet --word-regexp docker; then
+ sudo usermod --append --groups docker "${username}"
+fi
+
+sudo update-desktop-database
+
+# Installing this before the tools phase makes Git use gh before gh is installed.
+ln --symbolic --no-dereference --force \
+ "${MISE_PROJECT_ROOT}/wsl/home/.gitconfig" "${HOME}/.gitconfig"
+
+if [[ -t 0 && -t 1 ]]; then
+ if ! bash --interactive -c "${MISE_PROJECT_ROOT}/wsl/setup-git.ts"; then
+ echo "Git setup failed; run wsl/setup-git.ts manually if needed." >&2
</code_context>
<issue_to_address>
**issue (bug_risk):** The bootstrap task script uses bash-specific features but does not specify `shell = "bash"`, which can break when run under the default shell.
This script uses bash-specific constructs (`[[ -t 0 && -t 1 ]]` and `bash --interactive -c ...`) but the task doesn’t set `shell` in `tasks.toml`, so it will run under mise’s default `/bin/sh`, where `[[ ... ]]` is invalid. Please either set `shell = "bash"` for this task or rewrite the conditionals to be POSIX-compliant (e.g., `test -t 0`, `test -t 1`, and `[ ]`).
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| mise trust --yes "${dotfiles_dir}/mise.toml" | ||
| mise --cd "${dotfiles_dir}" bootstrap --yes --update --force-dotfiles --locked |
There was a problem hiding this comment.
issue (bug_risk): The new mise bootstrap call does not invoke the bootstrap task you added in tasks.toml, so the post-setup steps are no longer executed.
Those post-setup actions were moved into the [bootstrap] task in tasks.toml, but mise ... bootstrap calls the built-in subcommand (using mise.toml), not that task. As a result, your new post-bootstrap steps won’t run. You likely want to invoke the task runner instead, e.g. mise --cd "${dotfiles_dir}" run bootstrap, or move all bootstrap behavior into mise.toml so there’s a single, correctly executed source of truth.
| [bootstrap] | ||
| description = "Finish idempotent WSL user setup after packages, dotfiles, and tools are installed." | ||
| run = ''' | ||
| mkdir --parents "${HOME}/.gnupg" | ||
| chmod 700 "${HOME}/.gnupg" | ||
|
|
||
| username=$(whoami) | ||
| if ! groups "${username}" | grep --quiet --word-regexp docker; then | ||
| sudo usermod --append --groups docker "${username}" | ||
| fi |
There was a problem hiding this comment.
issue (bug_risk): The bootstrap task script uses bash-specific features but does not specify shell = "bash", which can break when run under the default shell.
This script uses bash-specific constructs ([[ -t 0 && -t 1 ]] and bash --interactive -c ...) but the task doesn’t set shell in tasks.toml, so it will run under mise’s default /bin/sh, where [[ ... ]] is invalid. Please either set shell = "bash" for this task or rewrite the conditionals to be POSIX-compliant (e.g., test -t 0, test -t 1, and [ ]).
Summary
mise bootstrap/etcsetup in the minimal WSL launcherWhy
Mise now has first-class bootstrap packages and dotfile convergence. Using those facilities removes duplicated installer logic, adds status and dry-run support, and lets mise reload the newly installed global configuration before installing its tools.
.gitconfigremains a final task step because applying it in the dotfile phase would configure theghcredential helper beforeghis installed.Validation
mise fmt --checkmise task validateshellcheck --external-sources wsl/install.shshfmt --diff --simplify wsl/install.shmise bootstrap --only dotfiles, followed bymise bootstrap dotfiles status --missingThe full local lint suite also passed all changed-file checks. Its unrelated Worker TypeScript tasks currently resolve
worker/tsconfig.*.jsonfromdir = "worker", resulting in nonexistentworker/worker/tsconfig.*.jsonpaths. The WSL container integration test could not start locally because the CI-downloadedwsl-amd64.wslartifact was absent; the PR CI job will download and exercise that image.Summary by Sourcery
Use mise bootstrap as the primary WSL environment installer, delegating package, dotfile, and tool setup to mise while keeping the launcher minimal.
New Features:
Enhancements:
Documentation: