mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-04-25 16:16:22 +02:00
Fix issues from Copilot review: 403 retry, comments pagination, backfill pagination
- Only retry 403 when rate-limit headers indicate throttling, not permission errors - Add fetchAllComments() with pagination for issues with 100+ comments - Add pagination loop in backfill workflow to handle repos with 200+ open issues
This commit is contained in:
parent
7df8510bde
commit
5fa180744d
2 changed files with 50 additions and 9 deletions
16
.github/workflows/backfill-dedupe.yml
vendored
16
.github/workflows/backfill-dedupe.yml
vendored
|
|
@ -37,9 +37,19 @@ jobs:
|
|||
SINCE=$(date -u -d "$DAYS_BACK days ago" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u -v-${DAYS_BACK}d +%Y-%m-%dT%H:%M:%SZ)
|
||||
echo "Fetching open issues since $SINCE"
|
||||
|
||||
# Get open issues, filter out PRs and already-labeled ones
|
||||
ISSUES=$(gh issue list --repo "$REPO" --state open --limit 200 --json number,title,labels,createdAt \
|
||||
--jq "[.[] | select(.createdAt >= \"$SINCE\") | select([.labels[].name] | index(\"duplicate\") | not)] | .[].number")
|
||||
# Get open issues with pagination, filter out PRs and already-labeled ones
|
||||
ISSUES=""
|
||||
PAGE=1
|
||||
while true; do
|
||||
BATCH=$(gh issue list --repo "$REPO" --state open --limit 100 --page "$PAGE" --json number,labels,createdAt \
|
||||
--jq "[.[] | select(.createdAt >= \"$SINCE\") | select([.labels[].name] | index(\"duplicate\") | not)] | .[].number")
|
||||
|
||||
[ -z "$BATCH" ] && break
|
||||
ISSUES="$ISSUES $BATCH"
|
||||
[ $(echo "$BATCH" | wc -w) -lt 100 ] && break
|
||||
PAGE=$((PAGE + 1))
|
||||
done
|
||||
ISSUES=$(echo "$ISSUES" | xargs)
|
||||
|
||||
if [ -z "$ISSUES" ]; then
|
||||
echo "No issues to process"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue