Skip to content

Commit c10356e

Browse files
committed
fix: address Bugbot review findings
Fixes three issues identified in code review: 1. High Severity: Prevent script abort when no issues exist - Use `|| echo "0"` fallback when grep -c returns non-zero - Ensures script continues even with empty issue list 2. Medium Severity: Fetch all issues, not just first page - Add `--limit 1000` to gh issue list command - Prevents missing older issues beyond default pagination 3. Low Severity: Use exact title matching - Change from `grep -qF` to `grep -qFx` for exact match - Prevents false positives from substring matches Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent de9002a commit c10356e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/create_layer3_issues.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ fi
2626

2727
# Fetch existing issues to check for duplicates
2828
echo "Fetching existing Layer 3 issues..."
29-
EXISTING_ISSUES=$(gh issue list --repo "$REPO" --label "layer-3" --state all --json title --jq '.[].title')
30-
echo "Found $(echo "$EXISTING_ISSUES" | grep -c .) existing Layer 3 issues"
29+
EXISTING_ISSUES=$(gh issue list --repo "$REPO" --label "layer-3" --state all --limit 1000 --json title --jq '.[].title')
30+
ISSUE_COUNT=$(echo "$EXISTING_ISSUES" | grep -c . || echo "0")
31+
echo "Found $ISSUE_COUNT existing Layer 3 issues"
3132
echo ""
3233

3334
# Array of statement proofs to create issues for
@@ -54,8 +55,8 @@ create_issue() {
5455

5556
local title="[Layer 3] Prove ${name,,} statement equivalence"
5657

57-
# Check if issue already exists
58-
if echo "$EXISTING_ISSUES" | grep -qF "$title"; then
58+
# Check if issue already exists (exact match)
59+
if echo "$EXISTING_ISSUES" | grep -qFx "$title"; then
5960
echo "⊘ Issue already exists: ${title}"
6061
echo " Skipping..."
6162
echo ""

0 commit comments

Comments
 (0)