fix: HIGH quality-debt batch — logic bugs, exit codes, path typo, arg guards#3947
Conversation
… guards - model-registry-helper.sh: merge duplicate if-blocks that made the print_info message unreachable (GH#3737) - email-batch-convert-helper.sh: return 1 when all conversions fail instead of always returning 0 (GH#3697) - system-cleanup.sh: fix AGENT_DIR typo .agent -> .agents to match LOG_DIR and TMP_DIR paths (GH#3466) - verify-brief.sh: guard --repo-path against missing value under set -u to prevent unbound variable crash (GH#3253)
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis pull request addresses four high-priority quality debt items identified in code reviews across shell automation scripts: adding failure detection when all email conversions fail, tightening numeric comparison logic with informational logging in provider syncing, standardizing the AGENT_DIR path constant, and adding argument validation to prevent silent empty parameter assignment. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.agents/scripts/email-batch-convert-helper.sh:
- Around line 102-105: The summary currently calls print_success before checking
the all-failed condition so a run can emit both success and failure; move the
print_success call so it occurs only after the all-failed check (i.e., check if
[[ "$count" -gt 0 && "$success" -eq 0 ]] then call print_error and return 1), or
change the prior summary print to a neutral status, ensuring print_success is
only invoked when conversions actually succeeded; update the section that uses
the count and success variables and the print_success / print_error calls
accordingly.
In @.agents/scripts/verify-brief.sh:
- Around line 81-85: The current arity check allows flag-like tokens as values
(e.g., "--repo-path --json") and sets REPO_PATH to a flag; update the validation
around the REPO_PATH assignment: after confirming $# >= 2, verify that the
candidate value ($2) is not a flag (does not start with '-') and if it is, call
log_fail "Missing value for --repo-path" and return 2; ensure REPO_PATH is only
assigned when the value passes this non-flag check so the parser is not left in
a broken state.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 079e458b-7b44-40c3-b786-56c44a317a85
📒 Files selected for processing (4)
.agents/scripts/email-batch-convert-helper.sh.agents/scripts/model-registry-helper.sh.agents/scripts/system-cleanup.sh.agents/scripts/verify-brief.sh
💤 Files with no reviewable changes (1)
- .agents/scripts/model-registry-helper.sh
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
… suppression, array safety
|
@coderabbitai review Added 4 commits:
|
|
🧠 Learnings used✅ Actions performedReview triggered.
|
Summary
print_infomessage unreachable — the first block (!= "0") always matched before the second (-gt 0) could runcmd_batchfrom proceeding with stale/missing dataAGENT_DIRtypo.agent→.agentsto matchLOG_DIRandTMP_DIRpaths--repo-pathagainst missing value underset -uto prevent unbound variable crashCloses #3737
Closes #3697
Closes #3466
Closes #3253
Summary by CodeRabbit
Bug Fixes
Chores