Skip to content

fix(bootstrap): allow Windows bootstrap without system files - #12003

Merged
jdx merged 2 commits into
mainfrom
agent/fix-windows-bootstrap-empty-files
Aug 14, 2026
Merged

jdx merged 2 commits into
mainfrom
agent/fix-windows-bootstrap-empty-files

Conversation

@jdx

@jdx jdx commented Aug 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • allow Windows bootstrap validation to pass when no managed system files or directories are configured
  • preserve the Unix-only error when managed system resources are present
  • add Windows regression coverage for aggregate bootstrap, status, and plan with a repo-only configuration

Root cause

The non-Unix validate_principals implementation always returned an error. Aggregate bootstrap paths call it whenever the files phase is enabled, including when the configured file and directory collections are empty. This caused unrelated bootstrap configuration such as [bootstrap.repos] to fail on Windows.

Fixes the regression reported in #12002.

Verification

  • cargo fmt --all -- --check
  • cargo test --bin mise system::managed_files (13 passed)
  • hk run check --safe --format json scoped to the Rust change (cargo-fmt, cargo-check passed)
  • Windows Pester regression coverage added; local cross-check could not link native dependencies because the Linux host lacks the MSVC/Visual Studio toolchain

AI-assisted — Tool: Codex; model: openai/gpt-5; version: unavailable.


Note

Low Risk
Narrow platform-specific guard change with explicit regression tests; managed system files on Windows remain rejected.

Overview
Windows bootstrap no longer fails when only non-file bootstrap config (e.g. [bootstrap.repos]) is present. Non-Unix validate_principals used to always error; it now returns success when there are no managed files or directories, and still errors with managed system files are only supported on Unix when those resources are configured.

Adds Windows Pester coverage (e2e-win/bootstrap.Tests.ps1) for bootstrap, bootstrap status, and bootstrap plan on repo-only config, plus a case that managed [bootstrap.files] still fails as expected.

Reviewed by Cursor Bugbot for commit 56d004d. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows bootstrap behavior for aggregate commands when no system-file configuration is provided.
    • Added clear rejection of unsupported managed system-file requests on Windows.
    • Bootstrap operations now correctly succeed when no managed files or directories are requested.
    • Added Windows end-to-end coverage for successful and rejected bootstrap scenarios.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: f2cd58ac-b299-4696-9abb-3fc93167ec67

📥 Commits

Reviewing files that changed from the base of the PR and between e01a2cb and 56d004d.

📒 Files selected for processing (1)
  • e2e-win/bootstrap.Tests.ps1
🚧 Files skipped from review as they are similar to previous changes (1)
  • e2e-win/bootstrap.Tests.ps1

📝 Walkthrough

Walkthrough

Non-Unix managed-resource validation now permits empty requests. Windows end-to-end tests verify successful bootstrap commands without system files and rejection when system files are configured.

Changes

Bootstrap validation

Layer / File(s) Summary
Non-Unix managed-resource validation
src/system/managed_files.rs
validate_principals now checks file and directory requests. Empty requests return success. Non-empty requests return the unsupported-platform error.
Windows bootstrap command tests
e2e-win/bootstrap.Tests.ps1
Pester tests isolate temporary configuration and environment state. Tests verify mise bootstrap --dry-run, status, and plan, plus rejection of configured system files.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 56d00

This localized change allows repo-only Windows bootstrap configurations to succeed while preserving the existing error for managed system resources; no actionable merge-blocking risk remains after normal checks and review.

Poem

A rabbit checks the bootstrap trail,
Empty system files make commands sail.
Windows tests hop from plan to run,
Configured files stop the fun.
Clean paths restored when tests are done.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: allowing Windows bootstrap operations without managed system files.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR allows aggregate Windows bootstrap validation when no managed system files or directories are configured while preserving the platform error when either collection is non-empty.

  • Adds an empty-resource fast path to the non-Unix principal validator.
  • Adds Windows regression coverage for aggregate bootstrap, status, plan, and unsupported managed files.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/system/managed_files.rs The non-Unix validator now accepts empty managed-resource collections and retains the existing error for configured files or directories.
e2e-win/bootstrap.Tests.ps1 Adds isolated Pester coverage for repo-only aggregate bootstrap operations and the retained managed-file rejection on Windows.

Reviews (2): Last reviewed commit: "test(bootstrap): fix Windows repo fixtur..." | Re-trigger Greptile

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e01a2cb. Configure here.

Comment thread e2e-win/bootstrap.Tests.ps1 Resolved
@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
env ▃▂▁▁▃███▆ 81,001,834 → 80,939,307 -0.08% 17.88 → 17.68ms -1.12%
hook-env ▄▂▁▃▂▇█▇▅ 82,487,466 → 82,450,286 -0.05% 18.92 → 18.71ms -1.12%
ls ▁▃▃▂▃███▇ 73,547,069 → 73,528,153 -0.03% 16.96 → 16.09ms -5.09%
registry ▇█▅▆█▄▄▅▁ 43,321,991 → 43,279,402 -0.10% 11.65 → 11.72ms +0.59%
startup ▇▇▂▂▁▇▇█▄ 15,583,457 → 15,569,903 -0.09% 9.60 → 9.53ms -0.66%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

56d004d244d1 vs 11d5eb2a1318 · measured on the runner, not pushed to the history.

@jdx
jdx enabled auto-merge (squash) August 14, 2026 13:25
@jdx
jdx merged commit 1837ebc into main Aug 14, 2026
31 checks passed
@jdx
jdx deleted the agent/fix-windows-bootstrap-empty-files branch August 14, 2026 13:30
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.

1 participant