Skip to content

Commit de9002a

Browse files
committed
fix: make create_layer3_issues.sh idempotent
Check for existing issues before creating new ones to prevent duplicates when script is re-run. Changes: - Fetch existing Layer 3 issues at startup - Skip creation if issue with matching title already exists - Update messaging to indicate idempotency Fixes the issue where re-running the script creates duplicate tracking issues, leading to inconsistent progress tracking. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 92e1360 commit de9002a

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

scripts/create_layer3_issues.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ if ! gh auth status &> /dev/null; then
2424
exit 1
2525
fi
2626

27+
# Fetch existing issues to check for duplicates
28+
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"
31+
echo ""
32+
2733
# Array of statement proofs to create issues for
2834
declare -a statements=(
2935
"1:Variable Assignment:assign_equiv:Low:1h:None:70"
@@ -48,6 +54,14 @@ create_issue() {
4854

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

57+
# Check if issue already exists
58+
if echo "$EXISTING_ISSUES" | grep -qF "$title"; then
59+
echo "⊘ Issue already exists: ${title}"
60+
echo " Skipping..."
61+
echo ""
62+
return 0
63+
fi
64+
5165
local body=$(cat <<EOF
5266
## Statement Type
5367
@@ -138,7 +152,9 @@ for stmt in "${statements[@]}"; do
138152
sleep 2
139153
done
140154

141-
echo "All issues created successfully!"
155+
echo "Done!"
156+
echo ""
157+
echo "Summary: Script is idempotent - existing issues are skipped."
142158
echo ""
143159
echo "Next steps:"
144160
echo "1. Review created issues on GitHub"

0 commit comments

Comments
 (0)