Skip to content

Conversation

@NebraskaCoder
Copy link
Member

@NebraskaCoder NebraskaCoder commented Nov 26, 2025

Summary

  • Added retry logic for URLs that timeout during download checks
  • Up to 10 retry attempts with exponential backoff (1s, 2s, 4s, 8s, 16s, 32s, then capped at 60s)
  • Only retries timeouts - actual 404s and other errors fail immediately
  • Shows progress during retry attempts

This helps avoid false CI failures from transient network issues while still catching real broken links.

Test plan

  • Run npm run check:downloads locally to verify script works
  • Verify retry logic triggers correctly when timeouts occur
  • Confirm non-timeout errors (404s) are not retried

🤖 Generated with Claude Code

When URLs timeout during the download check, the script now retries
up to 10 times with exponential backoff (1s, 2s, 4s, 8s... capped at 60s).
This helps avoid false failures from transient network issues while
not retrying actual 404s or other real errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings November 26, 2025 05:45
@NebraskaCoder NebraskaCoder self-assigned this Nov 26, 2025
@vercel
Copy link

vercel bot commented Nov 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rockylinux-org Ready Ready Preview Comment Nov 26, 2025 5:51am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds retry logic with exponential backoff specifically for URL timeout failures during download URL validation. The implementation separates timeout errors from other failures and retries only timeouts, helping avoid false CI failures from transient network issues while maintaining quick failure for actual broken links.

Key changes:

  • Refactored the original checkUrl function into checkUrlOnce for single attempts
  • Added retryTimeouts function with exponential backoff (up to 10 retries, capped at 60s delay)
  • Modified main logic to separate timeouts from other failures and retry only timeouts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Addresses Copilot review feedback - removed the misleading wrapper
function and call checkUrlOnce directly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@NebraskaCoder NebraskaCoder merged commit c7e83e1 into develop Nov 26, 2025
8 checks passed
@NebraskaCoder NebraskaCoder deleted the feature/url-check-timeout-retry branch November 26, 2025 05:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +106 to +115
const stillTimedOut = [];
for (const result of retryResults) {
if (result.status === "TIMEOUT") {
stillTimedOut.push(result);
} else {
successful.push(result);
console.log(
` ${colors.green}${colors.reset} ${result.url} - ${result.status === "OK" ? "OK" : result.status}`
);
}
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Non-timeout failures during retries are incorrectly treated as successful. When a previously timed-out URL is retried and returns "FAILED" or "ERROR" status (not "TIMEOUT"), it gets added to the successful array and is logged with a success checkmark. This means these failed URLs won't be reported as failures in the final results.

The logic should only add results with status === "OK" to the successful array. Failed and error results should be tracked separately and returned as failures.

Copilot uses AI. Check for mistakes.
const maxRetries = 10;
const baseDelay = 1000; // Start with 1 second
let remaining = [...timedOutResults];
const successful = [];
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misleading variable name: successful contains all non-timeout results (including "FAILED" and "ERROR" statuses), not just successful results. Consider renaming to retried or completed to better reflect its actual content.

Copilot uses AI. Check for mistakes.
Comment on lines +121 to +123
console.log(
`${colors.green}All timed out URLs recovered after ${attempt} retry attempt(s)!${colors.reset}`
);
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misleading success message: The message claims "All timed out URLs recovered" but this isn't accurate. A URL that was retried and returned "FAILED" or "ERROR" status hasn't truly "recovered" - it just didn't timeout again. The message should distinguish between URLs that became accessible (status "OK") versus those that simply returned a different failure status.

Suggested change
console.log(
`${colors.green}All timed out URLs recovered after ${attempt} retry attempt(s)!${colors.reset}`
);
const okCount = successful.filter(r => r.status === "OK").length;
const nonOkCount = successful.length - okCount;
let msg = `${colors.green}${okCount} timed out URL(s) recovered (status OK) after ${attempt} retry attempt(s).${colors.reset}`;
if (nonOkCount > 0) {
msg += ` ${colors.yellow}${nonOkCount} URL(s) returned non-timeout failure status (e.g. FAILED, ERROR).${colors.reset}`;
}
console.log(msg);

Copilot uses AI. Check for mistakes.
Comment on lines +112 to +114
console.log(
` ${colors.green}${colors.reset} ${result.url} - ${result.status === "OK" ? "OK" : result.status}`
);
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misleading success indicator: A green checkmark is displayed for retried URLs even when they return "FAILED" or "ERROR" status. This gives the false impression that these URLs are now working. Only URLs with status === "OK" should receive a success checkmark.

Suggested change
console.log(
` ${colors.green}${colors.reset} ${result.url} - ${result.status === "OK" ? "OK" : result.status}`
);
if (result.status === "OK") {
console.log(
` ${colors.green}${colors.reset} ${result.url} - OK`
);
} else if (result.status === "FAILED" || result.status === "ERROR") {
console.log(
` ${colors.red}${colors.reset} ${result.url} - ${result.status}`
);
} else {
console.log(
` ${colors.yellow}!${colors.reset} ${result.url} - ${result.status}`
);
}

Copilot uses AI. Check for mistakes.
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.

2 participants