Skip to content

Harden release workflow with retry/backoff for release ID resolution#31236

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-release-failing-action
May 9, 2026
Merged

Harden release workflow with retry/backoff for release ID resolution#31236
pelikhan merged 3 commits into
mainfrom
copilot/fix-release-failing-action

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 9, 2026

Bug Fix

The release workflow failed in run 25562543881 (job 75053678651) when resolving the newly created release’s databaseId immediately after gh release create. This change makes release ID resolution resilient to transient post-create API inconsistency.

What was the bug?

After creating a release, the workflow immediately called:

gh release view "$RELEASE_TAG" --json databaseId --jq '.databaseId'

In the failing job, that lookup intermittently failed at step 6:12, causing the release job to exit.

How did you fix it?

  • Release ID resolution retry
    • Added bounded retry logic (MAX_ATTEMPTS=5) for release ID lookup.
  • Backoff strategy
    • Added exponential backoff (2^attempt seconds) between retries.
  • Error classification
    • Retries only on expected not-found/404 style responses.
    • Fails fast on non-retryable errors (e.g., auth/network/systemic failures).
  • Workflow artifact update
    • Recompiled the lock workflow so the runtime definition includes the new retry behavior.
MAX_ATTEMPTS=5
RELEASE_ID=""
for attempt in $(seq 1 "$MAX_ATTEMPTS"); do
  set +e
  release_view_output=$(gh release view "$RELEASE_TAG" --json databaseId --jq '.databaseId' 2>&1)
  release_view_status=$?
  set -e

  if [ "$release_view_status" -eq 0 ] && [ -n "$release_view_output" ]; then
    RELEASE_ID="$release_view_output"
    break
  fi

  if ! echo "$release_view_output" | grep -qiE "not found|404"; then
    echo "Error: Failed to resolve release ID for $RELEASE_TAG"
    echo "$release_view_output"
    exit 1
  fi

  [ "$attempt" -lt "$MAX_ATTEMPTS" ] && sleep $((2 ** attempt))
done

Testing

This change specifically targets the failure mode observed in job 75053678651: release creation succeeds, but immediate ID resolution may be transiently unavailable. The new logic preserves fast success when available and retries when the ID is not yet visible.

Copilot AI and others added 3 commits May 9, 2026 16:19
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Fix release workflow by retrying release ID resolution Harden release workflow with retry/backoff for release ID resolution May 9, 2026
Copilot AI requested a review from pelikhan May 9, 2026 16:26
@pelikhan pelikhan marked this pull request as ready for review May 9, 2026 16:29
Copilot AI review requested due to automatic review settings May 9, 2026 16:29
Copy link
Copy Markdown
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

Hardens the release workflow by making post-gh release create release ID resolution resilient to transient API eventual-consistency issues.

Changes:

  • Add bounded retry logic (max 5 attempts) when resolving a newly-created release’s databaseId.
  • Implement exponential backoff between attempts and classify errors to retry only on “not found/404”-style failures.
  • Regenerate the compiled workflow (release.lock.yml) so the runtime workflow includes the new behavior.
Show a summary per file
File Description
.github/workflows/release.md Adds retry + exponential backoff around gh release view ... databaseId resolution after release creation.
.github/workflows/release.lock.yml Updates the compiled workflow to include the same retry/backoff logic in the runnable definition.

Copilot's findings

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@pelikhan pelikhan merged commit 0a35bff into main May 9, 2026
4 checks passed
@pelikhan pelikhan deleted the copilot/fix-release-failing-action branch May 9, 2026 16:38
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.

3 participants