Skip to content

fix(ci): show the failed build attempt's exit code, and time-box each attempt - #1824

Open
ralphstodomingo wants to merge 2 commits into
mainfrom
fix/1694-release-build-retry-followups
Open

ralphstodomingo wants to merge 2 commits into
mainfrom
fix/1694-release-build-retry-followups

Conversation

@ralphstodomingo

@ralphstodomingo ralphstodomingo commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #1694

Follow-up to #1823: the two non-blocking notes from its review, both in the release build step's retry.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  1. A failed attempt now says why: its exit code, or that it timed out (warning on attempt 1, error on attempt 2).
  2. Each attempt gets 5 minutes, then 30s before a hard kill, and counts as timed out only if it ran that long. Builds take 12–26s, so this only bites a hang: before, a hung attempt 1 ran into the job's 15-minute timeout and never got its retry; now attempt 2 still fits (the rest of the job took under 2 minutes in each of the last six releases).

It also fixes the matrix comment's out-of-date "~5 min each".

How did you verify your code works?

The step's script, extracted from the YAML, run under bash -e and -eo pipefail with a stub bun (shortened limits for hangs):

attempt 1 attempt 2 exit annotation
passes – 0 none
exits 3 passes 0 warning: exited with code 3
exits 1 exits 1 1 warning, then error
exits 124 passes 0 warning: exited with code 124
hangs passes 0 warning: timed out after 300s
hangs hangs 1 warning, then error: timed out

Claims, residuals and Codex review log: #1824 (comment).

Cost side effects

None.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR
  • I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"

🤖 Generated with Claude Code

https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi


Summary by cubic

Fixes the release build retry so a failed or hung first attempt actually gets retried instead of silently eating the job's timeout.

  • Failed attempts now report the reason (exit code or timeout) as a warning on the first attempt and an error on the second.
  • A timeout is reported only when the attempt ran its full 5-minute limit; a build that exits 124 on its own is reported as an exit code.
  • Each attempt is capped at 5 minutes with a 30s kill grace, so a hung first attempt still leaves room for the retry inside the job's 15-minute limit.
  • Corrects the out-of-date ~5 min each build-time comment in the matrix.

Written for commit 0ccaed6. Summary will update on new commits.

View guided diff Turn on auto-fix

Summary by CodeRabbit

  • Chores
    • Release builds now have a five-minute time limit and may retry once after a failure. Build failures report whether the attempt timed out or exited unsuccessfully, and the release job stops with an error if the retry also fails. These changes affect the release process; no end-user-facing product changes are included.

… attempt

The release build retry now prints why attempt 1 failed (exit code, or a 5-minute timeout), and caps each attempt at 5 minutes so a hung build still leaves room for the retry inside the job's 15 minutes. Follow-up to #1823.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The release workflow updates its stated per-target build time and adds a timeout to each build attempt. It reports timeouts and exit codes, warns after the first failed attempt, and reports an error after the second.

Changes: Release build attempts

Layer / File(s) Summary
Timed build attempts and retry reporting
.github/workflows/release.yml
The matrix comment now states that each target builds in under 30 seconds. Each attempt has a 300-second timeout and runs in a fresh bun run process. The workflow reports timeout or exit-code details, warns after the first failure, and reports an error after the second.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Suggested reviewers: anandgupta42, sahrizvi

Merge Risk: Minimal · up to 0ccae

The release build retry step now reports why each attempt failed and limits each attempt to five minutes. No actionable merge-blocking risk was identified. A legitimate build that runs longer than five minutes would be killed and reported as a timeout.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the retry step now reports each failed attempt's exit code, and each attempt is time-boxed. Its scope matches the release.yml diff, which adds timeout handling and fai…
Linked Issues check Passed The only directly linked issue, #1694, is closed and marked as historical context only. No active directly linked target remains, so no linked-issue coding requirements apply. The PR states it follows…
Out of Scope Changes check Passed The whole-PR file list and the change summary show changes only in .github/workflows/release.yml (+18/-4 lines). The changes cover the release build step's retry: a 5-minute timeout per attempt with a…
Description check Passed The description states the issue (follow-up to #1823, non-blocking review notes on the release build retry), lists the behavior changes (failure reasons as warning/error annotations, 5-minute per-atte…
Full details: Title check

Explanation

The title names the main change: the retry step now reports each failed attempt's exit code, and each attempt is time-boxed. Its scope matches the release.yml diff, which adds timeout handling and failure annotations. The title uses the conventional fix(ci) prefix. The title is 77 characters, slightly long, but it is specific and readable.

Full details: Linked Issues check

Explanation

The only directly linked issue, #1694, is closed and marked as historical context only. No active directly linked target remains, so no linked-issue coding requirements apply. The PR states it follows up on #1823, not #1694. The 'Closes #1694' line does not create an active requirement. The issue's suggestions (investigate the Babel EISDIR race, add a build-step retry) are not objectives for this PR. Its retry work is judged only as an out-of-scope question.

Full details: Out of Scope Changes check

Explanation

The whole-PR file list and the change summary show changes only in .github/workflows/release.yml (+18/-4 lines). The changes cover the release build step's retry: a 5-minute timeout per attempt with a 30s kill-after, exit-code or timeout reasons in warning (first attempt) and error (second attempt) annotations, and a corrected build-time comment in the matrix. The later commit that limits the timeout reason to attempts that ran their full time is also within the same step. These changes match the PR description. Hunk-level confirmation was not possible: the diff read returned that changed blobs are missing from the checkout. The assessment therefore rests on the supplied summary, which is consistent with the stated scope.

Full details: Description check

Explanation

The description states the issue (follow-up to #1823, non-blocking review notes on the release build retry), lists the behavior changes (failure reasons as warning/error annotations, 5-minute per-attempt limit plus 30s hard kill, matrix comment correction), and gives a cost side-effects statement of "None." It fills in the Type of change (Bug fix) and the checklist. The description includes a test table of six cases run under bash with a stub bun, so verification is documented. The template's 'Closes' issue line is filled with #1694. Minor gaps: the 'Screenshots' section is marked not applicable, which is acceptable. The description also refers to an external Codex review log, but the core template sections are complete and substantive, and the author explains why the changes work.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the build-time clock,
Then bounds through one more build attempt.
A timeout gets a clear report,
An exit code is noted too.
First failure: warning for the run.
Second failure: error, then done.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 70dd9a67-535d-44d9-b600-3927ebbcb750
Commits

Reviewing files that changed from the base of the PR and between 81578f8 and 0ccaed6.

Files selected for processing: 1

  • .github/workflows/release.yml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@ralphstodomingo

ralphstodomingo commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex review log

Claims (each falsifiable by a concrete trace):

  • C1. The build step runs at most two attempts, each a new bun run process, and exits 0 if and only if an attempt exits 0 within its time limit; otherwise it exits non-zero.
  • C2. Each attempt is bounded. GNU timeout sends SIGTERM to the attempt's whole process group at attempt_timeout (300s), and SIGKILL 30s later if bun itself is still running, so bun never runs past 5.5 minutes.
  • C3. After a failed attempt 1 the ::warning:: reports that attempt's real exit status: "timed out after <attempt_timeout>s" only when timeout stopped it (status 124 and the attempt ran its full limit, counted in whole seconds), else "exited with code N". After a failed attempt 2 the ::error:: does the same. (Reworded at 0ccaed6.)
  • C4. A failed or hung attempt never aborts the step early under bash -e or -eo pipefail: the loop always reaches attempt 2.
  • C5. Two worst-case attempts plus the job's other steps fit inside the job's 15-minute timeout, given the observed durations.
  • C6. Nothing else changes: matrix, env, permissions, the other steps and the upload are as on main; the only other edit is the matrix comment's build-time figure.

Disclosed residuals (accepted, not findings):

  • R1. A hang that ignores SIGTERM ends with SIGKILL and is reported as "exited with code 137", the same as an out-of-memory kill.
  • R2. A deterministic failure is retried once, costing one more build before the step fails (unchanged from main).
  • R3. The 5-minute bound assumes builds stay far below it; a build that legitimately grew past 5 minutes would be killed and reported as a timeout.
  • R4. If bun exits on the SIGTERM but one of its descendants ignores SIGTERM, timeout returns 124 without sending SIGKILL, and that descendant can outlive attempt 1. Nothing build.ts starts ignores SIGTERM (its bun install children and the bundler exit on it); closing this fully would need process-group bookkeeping in the step.
  • R5. The elapsed check counts whole seconds (bash SECONDS), so a build that exits 124 by itself in the last second before the limit is reported as a timeout. Builds take 12–26s and nothing in build.ts exits 124.

Rounds

  • Round 1, 81578f8, local Codex CLI (read-only; it ran the extracted loop with stand-in builds under bash -e and -eo pipefail): C1, C3, C4, C5 (2 × 330 + 109 = 769s < 900s) and C6 verified. It falsified C2 as first written ("nothing from attempt 1 is still running when attempt 2 starts") with a stand-in whose child ignores SIGTERM after its parent exits. That is real timeout behaviour but not a state this build reaches, so C2 is narrowed to what holds and the case is recorded as R4. No code change. Review ends here.
  • cubic and Kilo on 81578f8 (after the ready flip): fixed in 0ccaed6, cubic P2 (a build exiting 124 by itself was called a timeout; now "timed out" also needs the full limit to have run) and cubic P3 / Kilo (the limit is set once and the message reads it). Declined with timings: cubic P2 on the 15-minute job budget (a hung attempt 1 plus a normal attempt 2 needs about 8 minutes) and Kilo's fold-the-two-echoes suggestion.
  • Round 2, 0ccaed6, local Codex CLI (read-only; stand-ins under both shell modes, shortened limits for the kill tests): C1, C2, C4, C5 (660s + ≤97s ≤ 757s) and C6 verified. It falsified C3 with a stand-in that exits 124 by itself after 299.3s, which whole-second SECONDS counts as 300s, so it reads "timed out". That needs a self-made 124 in the last second before the limit; it's the same shape as the fix it reviews, so it's recorded as R5 and C3 is worded to match. No code change. Review ends here.

@ralphstodomingo
ralphstodomingo marked this pull request as ready for review November 23, 2026 14:30
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
@kilo-code-bot

kilo-code-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • .github/workflows/release.yml
Previous Review Summary (commit 81578f8)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 81578f8)

Status: 2 Issues Found | Recommendation: Merge with optional suggestions

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

SUGGESTION

File Line Issue
.github/workflows/release.yml 106 Timeout text hardcodes "5 minutes" instead of deriving it from the 5m cap on line 101
.github/workflows/release.yml 111 Message prefix duplicated across both branches; attempt number hardcoded instead of using $attempt
Files Reviewed (1 file)
  • .github/workflows/release.yml - 2 suggestions

Verification notes

Checked the shell semantics rather than re-deriving the author's table:

  • bash -e safety: timeout ... || status=$? is a guarded list, so a non-zero attempt cannot abort the step before attempt 2; the status=0 reset on line 100 is required (not redundant), because || only assigns on failure.
  • Exit codes: GNU timeout returns 124 on SIGTERM timeout and 137 when --kill-after had to SIGKILL. Reporting 137 as "exited with code 137" conflates a SIGTERM-ignoring hang with an OOM kill — already disclosed as a known gap in the PR body, so not raised separately.
  • Job budget: the 11-minute worst case only materialises when both attempts fail, which fails the step before the smoke test / cold-start test / artifact upload run. A hang-then-succeed path is ~6 minutes, comfortably inside timeout-minutes: 15.
  • 5-minute cap headroom: build.ts runs three bun install --os="*" --cpu="*" calls per build (all platform prebuilds), which is the slow part on a cold ~/.bun/install/cache. The workflow cache uses restore-keys, so a bun.lock bump still gets a partial hit; a fully cold run remains the only scenario where 5m is not ~10x the measured 12-26s. Not raised, but worth knowing if a release ever reports a spurious timeout.
  • Orphaned children: timeout (without --foreground) signals the child's whole process group, so bun's bun install children get SIGTERM too. The residual case where a grandchild ignores SIGTERM is disclosed as R4 and does not reach a state this build produces.

No new CI-duplicating type/format findings, and no cost side effects (workflow-only change).

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4.1-flash-1017 · Input: 49.4K · Output: 9.3K · Cached: 432.4K

Review guidance: REVIEW.md from base branch main

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
A build that exits 124 by itself was reported as a timeout. The limit is now set once and the message reads it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VEmKQv6E2XpAgL5eJE8RYi
@dev-punia-altimate

Copy link
Copy Markdown
Contributor

🤖 Code Review — OpenCodeReview (Gemini) — No Issues Found

No supported files changed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release: Build (win32-x64) failed with EISDIR on @babel/traverse while the other targets built (v0.12.10 run, re-run without changes)

2 participants