Repository navigation
Fail a Menu Fetch Whose Old Hub or Marker Cannot Be Changed, and Take Its Token Only Once Written - #2548
Conversation
… Clones menu.sh's fetch runs with errexit suspended, so a failed marker write let the clone proceed unmarked, which cleanup then skips and every later fetch refuses as a tree this run did not create. menu.ps1's Set-Content failure threw past the task rather than failing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g Into It or Ending the Session A held file under the old tree made menu.ps1's Remove-Item throw past the task and end the menu session, and made menu.sh clone into the surviving tree, whose clone-failure cleanup then dropped the marker and blocked every retry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fetch that failed after generating its token replaced the session's own, so the session's exit cleanup no longer matched the tree its earlier fetch marked and left it behind. 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2548 +/- ##
========================================
Coverage 58.40% 58.40%
========================================
Files 16 16
Lines 8090 8090
========================================
Hits 4725 4725
Misses 3365 3365
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:
|
There was a problem hiding this comment.
🔵 Needs a closer look
Two moderate findings remain unresolved in the hub-removal safeguards.
0 open findings
What changed in this PR
Hardens hub-fetch failure handling in Bash and PowerShell while preserving session token ownership.
Changes:
- Guards old-tree removal and marker writes.
- Delays token assignment until marker persistence succeeds.
- Adds regression tests for failure paths.
| File | Summary |
|---|---|
tests/test_bootstrap.py |
Adds coverage for removal, marker-write, and token-preservation failures. |
host-setup/menu.sh |
Adds guarded removal and marker creation; one moderate finding remains regarding reported removal failures. |
host-setup/menu.ps1 |
Adds failure handling; one moderate finding remains regarding dangling hub links. |
🧠 Review effort: Lite
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
|
Copilot's round on 31a69ad opened no thread, but its headline and file table named two moderate findings. That is the shape filed as #2544. Both are declined with evidence:
|
Summary
Answers the Copilot finding on promotion PR #2545: "
menu.shcan ignore marker-write failures and leave fetched trees behind". It also fixes that finding's siblings in the same fetch functions of both menus. Refs #1093.menu.sh'sfetch_hub_lockedruns with errexit suspended (fetch_hub_locked || rc=$?), so a failed write tohub.ownedlet the clone go ahead unmarked. Cleanup then skipped that tree, and every later fetch refused it as a tree this run did not create. The write now fails the fetch before the clone. Inmenu.ps1, aSet-Contentfailure threw past the task. It now fails the task, the same way Lock menu.ps1's Hub Cache Through hub.lock So It Coordinates with menu.sh #2537 made a lock that cannot be taken fail it.menu.ps1'sRemove-Itemthrow past the task and end the menu session. Inmenu.shit made the clone run into the surviving tree, and the clone-failure path then dropped the marker. Both now fail the fetch and leave the tree and its marker as they were, so the owning session's exit cleanup can still remove them.Verification (Windows host)
menu.ps1stubs shadow the cmdlet in the harness body, so each case reaches itscatch.developfail both write cases. The removal guards' parent fails both removal cases. The early token assignment fails 4 cases.scripts/docker_lint.py.🤖 Generated with Claude Code