ci: retry bazel build on transient CDN flakes#294
Conversation
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.
|
@codex review |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
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.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #294 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 41 41
Lines 7043 7043
=========================================
Hits 7043 7043 🚀 New features to boost your workflow:
|
Mirrors what the
./.github/actions/retrycomposite already does forxcrun swift package resolve/xcrun xcodebuild -resolvePackageDependencies: 6 attempts with exponential backoff (15s → 240s).Why
Hit a
502 Bad Gatewayonmain's post-merge CI for #293. Bazel was fetchingMobileNativeFoundation/index-import/releases/download/6.1.0.1/index-import.tar.gz(a transitiverules_swiftdependency) 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— bothbazelisk buildsteps in thebazeljob now go through./.github/actions/retry.Build Example'sworking-directory: Examples/ExampleBazelIntegrationbecomes acd …inside the retry action'scommand(composite-actionuses:ignoresworking-directory).Test plan
🤖 Generated with Claude Code