Skip to content

fix(workflows): correct pagination break condition and HTTP 2xx status check#68681

Closed
AZERDSQ131 wants to merge 1 commit into
anthropics:mainfrom
AZERDSQ131:fix/workflow-pagination-and-http-status
Closed

fix(workflows): correct pagination break condition and HTTP 2xx status check#68681
AZERDSQ131 wants to merge 1 commit into
anthropics:mainfrom
AZERDSQ131:fix/workflow-pagination-and-http-status

Conversation

@AZERDSQ131

Copy link
Copy Markdown

Summary

Two workflow bugs fixed in this PR:

1. lock-closed-issues.yml — Pagination break condition (line 44)

Before:

if (issues.length === 0) {
  hasMore = false;
  break;
}

After:

if (issues.length < 100) {
  hasMore = false;
  break;
}

When the last page returns N < 100 issues, the loop would previously not break, making one extra API call that returns 0 results before stopping. With < 100, the loop exits as soon as we receive a partial page — the standard pagination pattern used throughout the codebase.


2. claude-dedupe-issues.yml — HTTP status check (line 90)

Before:

if [ "$HTTP_CODE" -eq 200 ] || [ "$HTTP_CODE" -eq 202 ]; then

After:

if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then

The Statsig event endpoint may return other 2xx codes (e.g. 201, 204). The original check hardcoded only 200 and 202, causing valid successes to be logged as failures. The corrected check accepts the entire 2xx range per HTTP semantics.

Test plan

  • Verify lock-closed-issues.yml exits the pagination loop correctly on a final partial page
  • Verify claude-dedupe-issues.yml success branch is taken for any 2xx response from Statsig

🤖 Generated with Claude Code

- lock-closed-issues.yml: change `issues.length === 0` to `issues.length < 100`
  so the last partial page terminates the loop immediately instead of
  making an extra empty API call first
- claude-dedupe-issues.yml: replace explicit `200 || 202` check with
  `>= 200 && < 300` to accept any 2xx success code (e.g. 201, 204)
  from the Statsig event endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@AZERDSQ131

Copy link
Copy Markdown
Author

Closing: absorbed by #68682 which is a superset covering the same files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant