Repository navigation
ci(avr8js): restart fbuild daemon + cap step at 8 min (fixes #2645) - #2646
Conversation
…ang (#2645) After ci-compile.py invokes `fbuild build`, the daemon is left in whatever state the build ended in. On the avr8js path that state has been making `/api/test-emu` hang silently for 30 minutes before failing with `daemon error: request failed`. Restarting brings up a fresh daemon for the avr8js request, and the 8-min step timeout caps the bleed while the upstream fbuild regression is being tracked. Also dumps daemon status + log tail on failure so the next debugging cycle has real evidence of what the daemon was doing during the hang (currently the run produces a single 104-byte error line). Scope: only the avr8js template — QEMU templates use the same `fbuild test-emu` pipeline but are green today (run 26700714508), so leave them untouched. Refs FastLED/fbuild#291, #292, #130.
📝 WalkthroughWalkthroughThis PR hardens the fbuild test-emu CI step by introducing an 8-minute timeout and daemon restart/status checks after sketch compilation. It also adds a failure diagnostics step that captures daemon status and logs for debugging when the test step fails. Changesfbuild test-emu reliability and diagnostics
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/avr8js_docker_template.yml (2)
106-109: ⚡ Quick winConsider adding a brief wait after daemon restart.
The daemon restart is followed immediately by
fbuild test-emuon line 110. Depending on daemon startup time, there might be a race condition where test-emu attempts to connect before the daemon is fully initialized.⏱️ Proposed fix to add startup verification
echo "::group::fbuild daemon restart (FastLED#2645)" uv run fbuild daemon restart || true +sleep 2 uv run fbuild daemon status || true echo "::endgroup::"Alternatively, poll the status until ready (if fbuild supports it):
echo "::group::fbuild daemon restart (FastLED#2645)" uv run fbuild daemon restart || true +for i in {1..5}; do + if uv run fbuild daemon status; then break; fi + sleep 1 +done -uv run fbuild daemon status || true echo "::endgroup::"🤖 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/avr8js_docker_template.yml around lines 106 - 109, After restarting the fbuild daemon (the "uv run fbuild daemon restart" invocation) add a short wait-and-verify step before running "uv run fbuild test-emu": either insert a small sleep (e.g., a few seconds) after "uv run fbuild daemon restart" or poll "uv run fbuild daemon status" in a loop until it reports ready (with a timeout) so that "fbuild test-emu" does not race with daemon startup; update the block containing "uv run fbuild daemon restart", "uv run fbuild daemon status", and the subsequent "fbuild test-emu" invocation accordingly.
103-104: ⚡ Quick winReduce hardening priority: current callers don’t allow command injection; quote template vars anyway
inputs.platform/inputs.sketchare unquoted in.github/workflows/avr8js_docker_template.yml(around lines 103-104). However, in this repo the reusable workflow is only called by.github/workflows/avr8js_uno_test.yml, with hardcodedplatform: unoandsketch: Test, so PR/workflow_dispatch metadata can’t supply attacker-controlled values to these shell arguments.Low-cost hardening still recommended: quote the template variables defensively, and consider whether the immediate
fbuild daemon restart/status || truefollowed byfbuild test-emuneeds an explicit readiness wait/retry iffbuild’s restart isn’t synchronous.🔒 Proposed fix to quote template variables
- uv run ci/ci-compile.py ${{ inputs.platform }} \ - --examples ${{ inputs.sketch }} \ + uv run ci/ci-compile.py "${{ inputs.platform }}" \ + --examples "${{ inputs.sketch }}" \ --verbose🤖 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/avr8js_docker_template.yml around lines 103 - 104, Quote the template variables passed to the shell command in the reusable workflow: change the invocation of uv run ci/ci-compile.py to pass "${{ inputs.platform }}" and "${{ inputs.sketch }}" (i.e., wrap inputs.platform and inputs.sketch in quotes) so the shell receives safely quoted arguments; while editing, review the sequence around the fbuild daemon restart/status and fbuild test-emu calls and, if restart isn't synchronous, add a simple readiness wait/retry (e.g., loop with sleep and status check) to ensure fbuild is ready before running fbuild test-emu.
🤖 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.
Nitpick comments:
In @.github/workflows/avr8js_docker_template.yml:
- Around line 106-109: After restarting the fbuild daemon (the "uv run fbuild
daemon restart" invocation) add a short wait-and-verify step before running "uv
run fbuild test-emu": either insert a small sleep (e.g., a few seconds) after
"uv run fbuild daemon restart" or poll "uv run fbuild daemon status" in a loop
until it reports ready (with a timeout) so that "fbuild test-emu" does not race
with daemon startup; update the block containing "uv run fbuild daemon restart",
"uv run fbuild daemon status", and the subsequent "fbuild test-emu" invocation
accordingly.
- Around line 103-104: Quote the template variables passed to the shell command
in the reusable workflow: change the invocation of uv run ci/ci-compile.py to
pass "${{ inputs.platform }}" and "${{ inputs.sketch }}" (i.e., wrap
inputs.platform and inputs.sketch in quotes) so the shell receives safely quoted
arguments; while editing, review the sequence around the fbuild daemon
restart/status and fbuild test-emu calls and, if restart isn't synchronous, add
a simple readiness wait/retry (e.g., loop with sleep and status check) to ensure
fbuild is ready before running fbuild test-emu.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e3436abb-309c-45f2-ba14-93678f1fccc3
📒 Files selected for processing (1)
.github/workflows/avr8js_docker_template.yml
Summary
ci-compile.pyinvokesfbuild build, the daemon is left in whatever state the build ended in. On the avr8js path that state has been making/api/test-emuhang silently for 30 minutes before failing withdaemon error: request failed: error sending request for url (http://127.0.0.1:8765/api/test-emu). Restart the daemon betweenci-compile.pyandfbuild test-emuto start the avr8js request from a known-clean daemon.timeout-minutes: 8so the step fails fast instead of burning a 30 min runner minute floor per push.fbuild daemon statusand tail the daemon log into the existingavr8js_output.logartifact so the next iteration has real evidence (today's failures upload a single 104-byte error line).Closes #2645. Refs FastLED/fbuild#291, #292, #130.
Scope
.github/workflows/avr8js_docker_template.ymlis touched. The QEMU templates use the samefbuild test-emupipeline but are green today (run 26700714508) — leave them alone to avoid regression risk.Test plan
uno_avr8js_testworkflow goes green on this PR (or, if the daemon-restart doesn't unblock the upstream hang, fails inside 8 min with daemon-status + daemon-log evidence attached for the next iteration).🤖 Generated with Claude Code
Summary by CodeRabbit