Repository navigation
Release the Bootstrap Lock When a bootstrap.ps1 Run Ends - #3139
Conversation
A run typed at an interactive prompt runs inside the caller's own process, so the lock stream left for the process to release outlived the run and refused the next one in that session. main's finally now disposes it after the cleanup, which also covers die's exit, since exit runs the finally on its way out. Fixes #3137 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain.
0 open findings
What changed in this PR
Releases the PowerShell bootstrap directory lock after each run, including interactive sessions.
Changes:
- Adds lock cleanup in
finally. - Adds regression coverage for consecutive runs in one process.
| File | Summary |
|---|---|
tests/test_bootstrap.py |
Tests lock release across consecutive runs. |
host-setup/bootstrap.ps1 |
Releases the directory lock after cleanup or failure. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3139 +/- ##
==========================================
Coverage ? 63.97%
==========================================
Files ? 17
Lines ? 9151
Branches ? 0
==========================================
Hits ? 5854
Misses ? 3297
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… Fixes to Main (#3146) - #3135 makes `gh-write-guard` read a gh write's subcommand and target the way gh parses them: the subcommand is found past flags before the command and before the subcommand, an `R` inside a short-option cluster is read as a target, `GH_REPO` is read as a target, a run-time repository owner on a write fails closed, and a run-time word where `pr` or `merge` goes fails closed beside `--admin` or where word splitting may split it - #3139 releases the bootstrap lock when a `bootstrap.ps1` run ends rather than when its process does, so a second run typed at the same pwsh prompt is no longer refused the lock - #3130 matches tool names and the `all` keyword by case in the Windows agents loaders, as the Linux loaders already do - #3128 reads CodeRabbit's rate limit on a reply to an explicit review command in `pr_review.py` - #3126 reconciles VSCode-Server-DotNetCore in the hub after its resync - #3124 logs the Docker task's build-base leg in to Docker Hub - #3122 names the carried skill and the skipped review correctly - #3120 states the subprocess encoding rule in `CODESTYLE.md`, where carriers read Python style - #3118 and #3111 move the release-guard tests' workflow-command checks onto `runner_commands`, and test the alternatives wiring at the `audit_repo` and `fidelity_pass` call sites - #3116 stops the doc gates' printed names forging workflow commands - #3113 adds a catalog snippet for the release-with-smoke caller - #3109 moves the `workflow_reuse` fetch onto `audit.contents_text` - #3105 accepts `.codecov.yml` as an alternative to `codecov.yml` - #3103 adds a pip ecosystem to the carried Dependabot snippet - #3100 prefers the venv's ruff and pyright for a declared pip directory - #3098 tracks composite action pins in Dependabot - #3096 reads an uppercase Markdown suffix as Markdown at every prose gate branch After this merges, the host-safety installer payload changes, so the maintainer runs the installer after promotion. Closes #1416 Closes #1425 Closes #1578 Closes #1874 Closes #1892 Closes #1899 Closes #2804 Closes #2850 Closes #2852 Closes #2854 Closes #2996 Closes #3065 Closes #3067 Closes #3069 Closes #3079 Closes #3080 Closes #3089 Closes #3093 Closes #3101 Closes #3106 Closes #3107 Closes #3137 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a pull-request smoke build that runs when relevant release files change and reports the combined validation and build status. * Repository audits now recognize `.codecov.yml` as an alternative to `codecov.yml`. * **Improvements** * Python linting and type checks use tools from declared project environments when available, with fallbacks for missing tools. * Workflow and lint reports safely display unusual filenames and command-like text. * GitHub write-target checks now account for additional command forms and fail closed when targets cannot be verified. * Rate-limit detection now recognizes another CodeRabbit response format. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Fixes #3137. A
bootstrap.ps1run typed at an interactive pwsh prompt runs inside the caller's own process, so the lock streamLock-Directoryopened was left for the process to release and outlived the run. The next run in that session was refused the lock, with an error blaming "another bootstrap run".Unlock-Directorydisposes$script:LOCKand clears it.main'sfinallycalls it after the cleanup, astry { Invoke-Cleanup } finally { Unlock-Directory }, so the cleanup still runs under the lock and the release happens even if the cleanup throws.die's path is covered by the samefinally, since PowerShell runs afinallyonexitfrom inside a function (checked under pwsh 7.6 and Windows PowerShell 5.1). EveryexitbeforeLock-Directoryholds no lock.$LOCKcomment ("lasts until this process ends") is removed.bootstrap.shtakes its flock in its own process and is unaffected.Test
test_a_run_ending_inside_its_callers_process_releases_the_directory_lockdrives two runs in one pwsh process through a driver script, the first through the loader's ownmainending indie, the second takingLock-Directoryin the same mode. It fails against the pre-fix loader with the issue's "Could not lock" error, and passes with the fix. The harness's extracted function list gainsUnlock-Directoryandmain.Verified on Windows:
test_bootstrapandtest_cli_usagepass, PSScriptAnalyzer and ruff are clean, and the local strict review pass is recorded at the head.Comments
This carries the
commentslabel for the two new comment lines aboveUnlock-Directoryand the one inmain'sfinally, each stating a reason the code alone does not show.🤖 Generated with Claude Code