Skip to content

Add retry logic for transient GitHub API errors in live integration test - #14799

Merged
pelikhan merged 4 commits into
pinsupdatefrom
copilot/fix-github-actions-workflow-7c7fc6ca-f667-439e-8f7f-a9e9f7b783a8
Feb 10, 2026
Merged

Add retry logic for transient GitHub API errors in live integration test#14799
pelikhan merged 4 commits into
pinsupdatefrom
copilot/fix-github-actions-workflow-7c7fc6ca-f667-439e-8f7f-a9e9f7b783a8

Conversation

CopilotAI commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

The js-integration-live-api workflow was failing on transient GitHub API errors: "No server is currently available to service your request". These errors should be retried automatically.

Changes

  • Extended transient error detection (error_recovery.cjs)

    • Added "no server is currently available" pattern to isTransientError()
  • Wrapped API calls with retry logic (frontmatter_hash_github_api.test.cjs)

    • Created createRetryableFileReader() wrapper with 3 retries, 1s initial delay, exponential backoff
    • Applied to live GitHub API file reader
  • Added test coverage (error_recovery.test.cjs)

    • Verified "no server" errors are identified as transient
// Before: Direct API callconstfileReader=createGitHubFileReader(octokit,owner,repo,ref);// After: Wrapped with retry logicconstbaseFileReader=createGitHubFileReader(octokit,owner,repo,ref);constfileReader=createRetryableFileReader(baseFileReader);

The test now handles temporary GitHub API unavailability without masking real failures.

Original prompt

Fix the failing GitHub Actions workflow js-integration-live-api
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 63124286802
Job URL: https://github.com/github/gh-aw/actions/runs/21870586097/job/63124286802


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

CopilotAIand others added 2 commits February 10, 2026 15:27
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…e core mock
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
CopilotAI changed the title [WIP] Fix failing GitHub Actions workflow js-integration-live-apiAdd retry logic for transient GitHub API errors in live integration testFeb 10, 2026
CopilotAI requested a review from pelikhanFebruary 10, 2026 15:31
@pelikhan
pelikhan marked this pull request as ready for review February 10, 2026 15:33
CopilotAI review requested due to automatic review settings February 10, 2026 15:33
@pelikhan
pelikhan merged commit 9a35668 into pinsupdateFeb 10, 2026
54 checks passed
@pelikhan
pelikhan deleted the copilot/fix-github-actions-workflow-7c7fc6ca-f667-439e-8f7f-a9e9f7b783a8 branch February 10, 2026 15:35

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves resilience of the js-integration-live-api workflow/tests by expanding transient GitHub API error detection and adding retry/backoff around live API file reads.

Changes:

  • Extended isTransientError() to treat “no server is currently available” GitHub API failures as transient.
  • Wrapped the live GitHub API file reader in frontmatter_hash_github_api.test.cjs with withRetry() using an exponential backoff configuration.
  • Added unit coverage confirming the new transient-error pattern is detected.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

FileDescription
actions/setup/js/frontmatter_hash_github_api.test.cjsAdds retry wrapper + config for live API reads; injects global.core for retry logging.
actions/setup/js/error_recovery.test.cjsAdds assertions that “no server is currently available” is treated as transient.
actions/setup/js/error_recovery.cjsAdds the new transient error substring pattern to isTransientError().

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

// Retry configuration for live API tests
const LIVE_API_RETRY_CONFIG = {
maxRetries: 3,
initialDelayMs: 1000,

CopilotAIFeb 10, 2026

Copy link

Choose a reason for hiding this comment

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

LIVE_API_RETRY_CONFIG.initialDelayMs is likely not the actual delay before the first retry with the current withRetry implementation: withRetry multiplies delay at the end of the first failure, so the first retry sleeps initialDelayMs * backoffMultiplier (default 2). If the intent is a 1s first backoff, either pass backoffMultiplier: 1 / adjust initialDelayMs, or change withRetry to increase the delay after sleeping so initialDelayMs is honored for the first retry.

Suggested change
initialDelayMs: 1000,
initialDelayMs: 1000,
backoffMultiplier: 1,

Copilot uses AI. Check for mistakes.
Comment on lines 34 to +38
beforeAll(() => {
// Mock @actions/core for retry logging in test environment
global.core = {
info: vi.fn((...args) => console.log(...args)),
warning: vi.fn((...args) => console.warn(...args)),

CopilotAIFeb 10, 2026

Copy link

Choose a reason for hiding this comment

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

This test sets global.core in beforeAll but never restores the previous value. Since Vitest may execute multiple test files in the same worker, this can leak logging mocks into other suites. Please save the prior global.core value and restore it in an afterAll/afterEach (or delete global.core if it was unset).

Copilot uses AI. Check for mistakes.
pelikhan added a commit that referenced this pull request Feb 10, 2026
* updated pins
* [WIP] Fix integration tests for updated pins (#14791)
* Initial plan
* Initial plan for fixing integration tests
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Update integration tests with new action pins
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* [WIP] Fix failing GitHub Actions workflow Integration: Workflow Compiler (#14792)
* Initial plan
* Update action pin SHAs in runtime integration tests
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* [WIP] Fix failing GitHub Actions workflow runtime and setup (#14796)
* Initial plan
* Fix TestRuntimeSetupIntegration by updating setup-node SHA
Update the test expectation to use the current SHA for actions/setup-node@v6.2.0
(6044e13b5dc448c55e2357c09f80417699197238) instead of the outdated SHA
(395ad3262231945c25e8478fd5baf05154b1d79f). The action_pins.json file was
recently updated with newer action SHAs, and this test needed to be synchronized.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Add retry logic for transient GitHub API errors in live integration test (#14799)
* Initial plan
* Add retry logic for transient GitHub API errors in frontmatter hash test
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
* Address code review feedback: extract retry config constants and scope core mock
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
---------
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Sign up for freeto 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.

3 participants

@pelikhan