Repository navigation
Conversation
Update run.sh and run.py to ensure files produced during an incomplete or failed backup run do not count as proof of completion. Pre-existing .complete markers are cleared at the start of run.py, and run.sh requires both an explicit .complete marker and matching backup files before skipping the initial backup. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
| os.makedirs(backup_dir, exist_ok=True) | ||
| success_marker = os.path.join(backup_dir, ".complete") | ||
| try: | ||
| if os.path.exists(success_marker): | ||
| os.remove(success_marker) |
There was a problem hiding this comment.
Early failures leave success behind
main() clears .complete only after opening the database and checking settings. If a scheduled run cannot open the database, lacks a required setting, or has invalid configuration, it exits before clearing the previous marker. On restart, run.sh sees that marker and its matching archive and skips the initial backup despite the failed attempt.
Move marker clearing ahead of these failure paths so early failures also invalidate the previous success.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/run.py
Line: 103-107
Comment:
**Early failures leave success behind**
`main()` clears `.complete` only after opening the database and checking settings. If a scheduled run cannot open the database, lacks a required setting, or has invalid configuration, it exits before clearing the previous marker. On restart, `run.sh` sees that marker and its matching archive and skips the initial backup despite the failed attempt.
Move marker clearing ahead of these failure paths so early failures also invalidate the previous success.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| if [ -f "$BACKUP_DIR/.complete" ]; then | ||
| marker_ts=$(tr -d '[:space:]' < "$BACKUP_DIR/.complete" 2>/dev/null || true) | ||
| if [ -n "$marker_ts" ]; then | ||
| for f in "$BACKUP_DIR"/backup_"${marker_ts}"*.enc; do |
There was a problem hiding this comment.
The new test covers marker removal in Python, but no shell test exercises the changed skip logic in run.sh. Add focused cases for a matching timestamp, an unrelated archive, an empty marker, and a missing marker. Without them, a later change could make startup skip failed backups or rerun valid backups without a test catching it.
Prompt To Fix With AI
This is a comment left during a code review.
Path: run.sh
Line: 70-73
Comment:
**Skip decisions lack tests**
The new test covers marker removal in Python, but no shell test exercises the changed skip logic in `run.sh`. Add focused cases for a matching timestamp, an unrelated archive, an empty marker, and a missing marker. Without them, a later change could make startup skip failed backups or rerun valid backups without a test catching it.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Updated run.sh and run.py to enforce proper backup completion checks and prevent skipping initial backups when prior runs failed.
PR created automatically by Jules for task 12770655799394862431 started by @mvfc
Move marker clearing ahead of early failure paths before merging.
Findings
Fix with agent prompt
Summary
This PR ties startup skipping to the timestamp in
.completeand clears the marker before exporting.Reviews (1) · Last reviewed commit: "Require success marker for initial backu..." · Reviewed by Greptile