Repository navigation
Cover the Bootstrap Upgrade Handoff and Name a Failed Agent Report on Windows - #3035
Conversation
… Windows Run bootstrap.sh --upgrade whole against stub tools, asserting the package upgrade runs before the agent tools upgrade, that a failed package upgrade stops before it, and that a root run skips it and says so. Run bootstrap.ps1's Invoke-Upgrade and Show-Report through its own functions the same way, with the elevation check split into Test-Elevated so both branches run on any host. Show-Report now prints a line when install-agents.ps1 -Report exits non-zero, as the skills step above it and bootstrap.sh's report already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add an elevated Show-Report case, so a report that stops skipping the agent tools step when elevated fails a test. Say in TestKeptTreeEndToEnd's docstring that its upgrade cases assert the recorded steps rather than a kept tree, and split the new docstrings' long sentences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
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.
🔵 Needs a closer look
Unresolved moderate findings require direct elevation-predicate coverage and shared probe relocation.
0 open findings
What changed in this PR
Adds regression coverage for Linux and Windows bootstrap upgrade/report handoffs and improves failed Windows agent-report diagnostics.
Changes:
- Tests upgrade ordering, failure handling, and elevated-session skips.
- Adds Windows agent-report failure messaging.
- Refactors shared PowerShell test harness setup.
| File | Summary |
|---|---|
tests/test_bootstrap.py |
Adds Linux and PowerShell handoff coverage. Findings remain for exercising the production elevation predicate and relocating host capability probes. |
host-setup/bootstrap.ps1 |
Adds elevation helper reuse and agent-report failure messaging. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Every handoff case stands in for Test-Elevated, so a predicate that read every host as elevated, or none, passed them all. Run the real one once and compare it with the shell API's own answer on Windows, and with not elevated on any other host, where the check reads $IsWindows first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
A recorded local strict-review pass covers head |
|
Answering the headline of Copilot's round on 8c66f1d4. That round opened on
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3035 +/- ##
===========================================
+ Coverage 60.98% 61.00% +0.01%
===========================================
Files 17 17
Lines 9010 9014 +4
===========================================
+ Hits 5495 5499 +4
Misses 3515 3515
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:
|
|
@coderabbitai review |
|
…ng, and backlog-burndown Re-Dispatch Rules to Main (#3030) - #2997 adds an updater that keeps the coding-agent tools already installed on a host current, without installing a tool the maintainer has not chosen - #3017 brings the agent-safety READMEs up to the write guard's #3011 readings: `--admin` read inside a quoted `eval` argument, clustered and cut-short push options, `--branches` as `--all`, `refs/` pattern destinations, and a double-quoted list expansion as a directory or commit value failing closed - #3022 pairs a Copilot overview-table or `Review findings:` entry with a review thread by the file it names, replacing word overlap, compares the headline count against everything the round and the pull request account for, and makes `pr_review.py cleanup` read every page of the head pull requests, counting only this repository's own - #3018 has `backlog-burndown` name a new branch when an issue is dispatched again, name the open pull request a pushed branch still heads when cleanup reports it, and splits the long cleanup sentence - #3028 keeps an abandoned group's issue out of the `backlog-burndown` ranking while that group is stopped for the maintainer, and records the release on the claim comment - #3023 makes `gh-write-guard` read a `heads/` push destination as the branch git completes it to, read `--prune` beside a pattern, `:`, `--all`, or bare push as a delete of each branch matched, read `--mirror` as a force and a delete, and read the `@{push}` target against the configured remote names. A differential against the previous guard found no deny-to-allow flip - #3032 subtracts every thread id an open entry links, back-references included, from the earlier threads `pr_review.py`'s headline shortfall counts, so a back-referenced thread is no longer counted twice - #3035 covers the bootstrap upgrade handoff on Linux and Windows, the root and elevated skips included, and has `bootstrap.ps1` say when the agent tools report fails - #3037 makes `gh-write-guard` fail closed when a push target resolves but the remote names cannot be read After this merges, the host-safety installer payload changes, so the maintainer runs the installer after promotion. Fixes #3009 Fixes #2985 Fixes #3003 Fixes #2993 Fixes #3016 Fixes #3005 Fixes #3007 Fixes #2973 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Answers the three review findings Copilot raised on the promotion pull request #3030, all on the bootstrap upgrade handoff #2997 introduced.
Changes
host-setup/bootstrap.sh:317finding).TestKeptTreeEndToEndnow also runsbootstrap.sh --upgradewhole against the stub download and stub tools. It asserts thatupgrade-host.sh --packagesruns beforeinstall-agents.sh --upgrade, and that a failed package upgrade stops before the agent tools step. A run underunshare -r(EUID 0 in a user namespace, skipped where the host refuses one) asserts that the agent tools step is skipped and the "Running as root" line printed.host-setup/bootstrap.ps1:473finding). A newTestPowerShellToolHandoffrunsbootstrap.ps1's ownInvoke-UpgradeandShow-Report, extracted by AST through the existing harness, against stub.ps1tools that record each step. It assertsupgrade-host.ps1 -Packagestheninstall-agents.ps1 -Upgrade, the stop on a failed package step, and the elevated skip for both the upgrade and the report. The elevation check moves into its ownTest-Elevatedfunction, which every case stands in for. A case then reads the same on an elevated Windows runner as on a user's session. One case runs the realTest-Elevatedand holds it to the host's own answer,IsUserAnAdminon Windows, after Copilot's first round noted that no case ran it.Show-Reportfinding).Show-Reportnow prints "The agent tools step did not report, and the output above says why" wheninstall-agents.ps1 -Reportexits non-zero. That matches the skills step above it andbootstrap.sh'sreport(). A test covers the line, and a second asserts it is absent on success.TestPowerShellKeptTreeHandlinginto a module-levelpowershell_harness_command, so both PowerShell classes share it.Verification
python3 -m unittest discover -s testson Linux withpwshpresent: 2810 tests, OK (7 skipped). Ruff format and check, mypy,prose_lint.py --diff,repo_gate.py,spec/validate.py,build_dist.py --check, editorconfig-checker, and PSScriptAnalyzer 1.23.0 onbootstrap.ps1are all clean.pwshonly. The Windows path is proven by the requiredWindows unit test jobon this head, not claimed before it passes.Local review
Three
local-strict-reviewpasses ran. The first raised five findings, and the second and third, on the fixed heads, raised none. Three were fixed here: the end-to-end class docstring now describes its upgrade cases, the elevated report case was added, and two long docstring sentences were split. Two were filed as their own issues, since this change may not touch the files they need. #3033 coversbootstrap.sh's untestedreport()agent gate and line. #3034 covers moving the unprivileged-root probe intotests/host_capability.py.🤖 Generated with Claude Code