resume_arm_time.py emits a crontab line naming whatever checkout ran it, so arming from a worktree pins a path that will be deleted - #361
Conversation
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Warning Review limit reached
Next review available in: 4 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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 |
|
|
||
|
|
||
| def _is_under_temp(path): | ||
| temp_roots = ("/tmp", "/var/tmp", "/private/var/folders", "/var/folders") |
There was a problem hiding this comment.
WARNING: _is_under_temp misses resolved macOS temp paths
_HELPER_PATH is computed with os.path.realpath(__file__), but the temp-root list only contains the unresolved paths. On macOS, /tmp and /var/tmp are symlinks to /private/tmp and /private/var/tmp respectively. After realpath, a checkout under /tmp would resolve to /private/tmp/..., which is not in the check list, so the guard silently fails to detect it.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| while parent and parent != os.path.dirname(parent): | ||
| git_dir = os.path.join(parent, ".git") | ||
| if os.path.exists(git_dir): | ||
| if os.path.isfile(git_dir): |
There was a problem hiding this comment.
WARNING: _is_in_linked_worktree false-positives on git submodules
Git submodules also have .git as a file (containing gitdir: ...), but they are not ephemeral like linked worktrees. The script would refuse to run from a submodule checkout, which is overly broad and could block legitimate non-ephemeral use cases.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| " something in the SYSTEM crontab, outside the component that failed.\n" | ||
| " If instead you write these lines into a crontab, durability is fine but\n" | ||
| " recurring=false does not exist there, so re-read the ONE-SHOT line.") | ||
| _validate_helper_path() |
There was a problem hiding this comment.
SUGGESTION: _validate_helper_path() is called late in main()
This validation runs after all the crontab derivation computation. If the script is invoked from an ephemeral location, it still performs the full derivation before refusing to emit the block. Moving the call to the very start of main() would fail fast and avoid unnecessary work.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
|
|
||
| def test_guard_refuses_linked_worktree(tmp_path, monkeypatch, capsys): | ||
| """A _HELPER_PATH inside a linked worktree is refused with a named reason.""" | ||
| fake_wt = Path("/home/jay/Development/fake-wt-for-test") |
There was a problem hiding this comment.
SUGGESTION: test_guard_refuses_linked_worktree uses a hardcoded absolute path
Path("/home/jay/Development/fake-wt-for-test") may not exist or be writable in all test environments (e.g., CI containers, different users). Using tmp_path would make the test hermetic and avoid leaving directories behind.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Reviewed by step-3.7-flash · Input: 69.4K · Output: 20.3K · Cached: 753.5K |
|
BLOCKED, and the guard itself is the right idea. Refusing to emit a crontab block when the helper resolves under a temp directory or a linked worktree is a real safety property, it is the only genuinely new thing in this PR, and I want it to land. The changelog fragment is present and all three files end in Revision card: 1. The central change already landed in #354
So the PR re-adds a constant that exists and re-fixes three call sites that are already fixed. That is why the trial merge conflicts: This is worth saying plainly because the card title describes the OLD behaviour, where the script emitted a hardcoded 2. The test half would revert two assertions master already has in a stronger formThis is the part that matters, and it is the third time in this repo that a branch built from a stale base has quietly given back a win master already held. The last one was #360 dropping the README newline that #358 had won.
SCRIPT = REPO / "scripts" / "resume_arm_time.py" # computed by the test file
...
return f"{SCRIPT}#{fire_type}-{ts}" # masterThis PR rewrites it to read the value back out of the thing being tested: return f"{resume_arm_time._HELPER_PATH}#{fire_type}-{ts}" # this PRBoth sides of the comparison then come from the same source, so the assertion passes whatever path the module computes, including a wrong one. It cannot fail. That is precisely the defect card
Neither revert is visible in the PR's own diff, because against the stale base both edits read as improvements. Only the trial merge shows it. 3.
|
|
Correction to point 2 above, and a collision the revision lane needs to know about. I called both of master's versions "strictly stronger". That is right for I measured master against an API-preserving mutant, So master's What does not change: this PR's combination is still weaker overall, because it rewrites The collision. |
CARD TITLE (intent, not commit subject): resume_arm_time.py emits a crontab line naming whatever checkout ran it, so arming from a worktree pins a path that will be deleted
Autonomous build of board card tsk-bxdfvz.
Files:
changelog.d/tsk-bxdfvz-helper-path-guard.md | 3 ++
scripts/resume_arm_time.py | 47 +++++++++++++++++++++--
tests/test_resume_arm_time.py | 59 +++++++++++++++++++++++++++--
3 files changed, 102 insertions(+), 7 deletions(-)