Repository navigation
Conversation
…arve the runner (#389) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe CI build job now limits Turbo concurrency to 50%. Each shard records runner resource data and uploads kernel logs and sampler output as an always-run diagnostic artifact. ChangesCI resource control
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…389) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
155-161: 🚀 Performance & Scalability | 🔵 TrivialAdd direct cgroup CPU telemetry for throttling diagnosis.
The workflow captures
dmesgand resource samples, but not the active cgroup’scpu.stat. When available, capturenr_throttledandthrottled_usec, or narrow the comment to the evidence collected.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml around lines 155 - 161, Extend the “Capture runner diagnostics” step to read the active cgroup’s cpu.stat when available and persist nr_throttled and throttled_usec alongside the existing dmesg output, while tolerating unavailable cgroup paths or read failures.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Line 147: Update the sampler command around the Chromium process count to
capture pgrep’s output while preventing its nonzero status from triggering the
fallback, then emit ${chrom_count:-0} so no-match cases produce exactly one zero
without a newline.
---
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 155-161: Extend the “Capture runner diagnostics” step to read the
active cgroup’s cpu.stat when available and persist nr_throttled and
throttled_usec alongside the existing dmesg output, while tolerating unavailable
cgroup paths or read failures.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f215bd5c-fe21-448f-b543-47e6e47f534f
📒 Files selected for processing (1)
.github/workflows/ci.yml
| nohup bash -c ' | ||
| while true | ||
| do | ||
| echo "$(date +%s) mem=$(free -m | awk "/^Mem:/{print \$3\"/\"\$2}") swap=$(free -m | awk "/^Swap:/{print \$3}") load=$(cut -d" " -f1-3 /proc/loadavg) chrom=$(pgrep -c chrom 2>/dev/null || echo 0)" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
sample="$(pgrep -c '^__coderabbit_no_such_process__$' 2>/dev/null || echo 0)"
if [[ "$sample" == $'0\n0' ]]; then
echo "The fallback emits duplicate zero lines."
exit 1
fiRepository: conciv-dev/conciv
Length of output: 155
🏁 Script executed:
#!/usr/bin/env bash
set -u
pattern='^__coderabbit_no_such_process_9f3c7b__$'
printf '%s\n' '--- direct pgrep ---'
set +e
direct="$(pgrep -c "$pattern" 2>/tmp/pgrep.err)"
status=$?
set -e
printf 'status=%s\n' "$status"
printf 'stdout=%q\n' "$direct"
printf 'stderr=%q\n' "$(cat /tmp/pgrep.err)"
printf '%s\n' '--- command substitution with fallback ---'
set +e
sample="$(pgrep -c "$pattern" 2>/dev/null || echo 0)"
status=$?
set -e
printf 'status=%s\n' "$status"
printf 'quoted=%q\n' "$sample"
printf 'lines=%s\n' "$(printf '%s\n' "$sample" | wc -l)"
printf '%s\n' '--- workflow expression shape ---'
set +e
line="$(echo "ts=1 chrom=$(pgrep -c "$pattern" 2>/dev/null || echo 0)")"
status=$?
set -e
printf 'status=%s\n' "$status"
printf 'quoted=%q\n' "$line"
printf '%s\n' "$line" | od -An -t x1Repository: conciv-dev/conciv
Length of output: 423
🌐 Web query:
man7 pgrep -c count exit status no matches outputs 0
💡 Result:
The pgrep command's exit status and output behavior regarding counts are defined as follows: Exit Status: By default and when using the --count (-c) option, pgrep uses the following exit codes [1]: - 0: One or more processes matched the criteria [2][1]. - 1: No processes matched [2][1]. - 2: Syntax error in the command line [2][1]. - 3: Fatal error, such as out of memory [2][1]. Output for --count (-c): When the --count (-c) option is used, pgrep suppresses the list of PIDs and instead prints the total count of matching processes to standard output [1]. If the count is zero (i.e., no processes match), pgrep will output 0 and exit with a non-zero exit status (specifically 1) [1].
Citations:
Prevent duplicate zero counts in the sampler output.
When no Chromium process matches, pgrep -c chrom outputs 0 and returns status 1. The fallback appends another 0, which inserts a newline into the sampler record. Store the count with || true, then use ${chrom_count:-0}.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/ci.yml at line 147, Update the sampler command around the
Chromium process count to capture pgrep’s output while preventing its nonzero
status from triggering the fallback, then emit ${chrom_count:-0} so no-match
cases produce exactly one zero without a newline.
|
Obsolete: the strand's root cause was fixed in #433 (per-icon lucide imports shrank the cold-start transform burst ~70%; CI hammer 0-strand in 10 attempts). The concurrency cap was a timing mitigation for the same failure and is no longer needed. |
Summary
Every main CI run since
99bbfa8f(Aug 10) has failed shard-4 with[vitest] Browser connection was closed, killing the@conciv/appbrowser suite. That's 9/9 reds on main.TURBO_CONCURRENCY=100%uncapped on GitHub's 4-vCPU runners, while multiple Chromium fleets + vite dev hosts run concurrently across the shard's packages — the runner saturates.vitest-dev/vitest#10791), so once the websocket to the browser starves under CPU pressure, the run just dies instead of retrying.turbo.json); CI deliberately re-uncaps to 100% per workflow for speed on dedicated runners — this shard job is the one case where dedicated isn't enough.Change
Scoped the fix to only the
build + test (shard-N)matrix job in.github/workflows/ci.yml: added a job-levelenv: TURBO_CONCURRENCY: '50%', which overrides the workflow-level100%default for just that job's steps. Every other job (plan,repo-checks,storybook,plan-e2e,e2e,e2e-summary,zizmor) is untouched and keeps running at 100%.Test plan
@conciv/app, or a runner-size bump — not covered by this change.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation