Skip to content

ci: retry bazel build on transient CDN flakes#294

Merged
dfed merged 2 commits intomainfrom
dfed--bazel-retry
May 4, 2026
Merged

ci: retry bazel build on transient CDN flakes#294
dfed merged 2 commits intomainfrom
dfed--bazel-retry

Conversation

@dfed
Copy link
Copy Markdown
Owner

@dfed dfed commented May 4, 2026

Mirrors what the ./.github/actions/retry composite already does for xcrun swift package resolve / xcrun xcodebuild -resolvePackageDependencies: 6 attempts with exponential backoff (15s → 240s).

Why

Hit a 502 Bad Gateway on main's post-merge CI for #293. Bazel was fetching MobileNativeFoundation/index-import/releases/download/6.1.0.1/index-import.tar.gz (a transitive rules_swift dependency) and GitHub's CDN flaked. Our other download-flavored CI steps already wrap retry around it; the bazel job didn't.

What changes

  • .github/workflows/ci.yml — both bazelisk build steps in the bazel job now go through ./.github/actions/retry.
  • Build Example's working-directory: Examples/ExampleBazelIntegration becomes a cd … inside the retry action's command (composite-action uses: ignores working-directory).

Test plan

  • Retry action's behavior unchanged from existing usage; new wiring is identical.
  • CI green on this PR's first run (no need to deliberately trigger a flake — the change just adds tolerance).

🤖 Generated with Claude Code

Hit a transient `502 Bad Gateway` from GitHub's CDN on
`MobileNativeFoundation/index-import` (a transitive `rules_swift`
download) on `main`'s post-merge CI for #293. Same pattern we
already handle for SPM resolution via `./.github/actions/retry`.

Apply the existing retry action to both `bazelisk build` steps —
the action retries up to 6 times with exponential backoff (15s →
240s), so a single CDN flake doesn't fail the whole job.

The `Build Example` step was using `working-directory:`; folded
the `cd` into the retry action's `command` since the composite
action runs from the parent's cwd.
@dfed
Copy link
Copy Markdown
Owner Author

dfed commented May 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c35f9e261

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c35f9e261

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Outdated
Codex P1: the original `cd Examples/ExampleBazelIntegration && ...`
mutated the shell's cwd inside the retry loop. On a first-attempt
failure (the exact case this change targets), the second attempt
would run `cd Examples/ExampleBazelIntegration` from inside that
directory and fail at the cd, never retrying Bazel. Wrap the
command in a subshell `(cd … && …)` so each attempt starts from
the repo root.

Also add a comment block explaining why we retry the whole build
rather than isolating dependency resolution like the SPM jobs do —
Bazel resolves external repos lazily during the build, with no
equivalent of `swift package resolve` to wrap separately.
@dfed
Copy link
Copy Markdown
Owner Author

dfed commented May 4, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (93990aa) to head (201875b).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #294   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           41        41           
  Lines         7043      7043           
=========================================
  Hits          7043      7043           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dfed dfed merged commit dc5ab3f into main May 4, 2026
20 checks passed
@dfed dfed deleted the dfed--bazel-retry branch May 4, 2026 22:51
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