Repository navigation
ci: make fbuild the default for board builds - #2395
Conversation
📝 WalkthroughWalkthroughThe PR makes fbuild the unconditional build backend for all board compilation: removes FBUILD_BOARDS and conditional selection logic, updates tooling and docs to treat fbuild as default, converts fbuild flags to deprecated no-ops that warn, and adjusts tests and CI/workflow cache inputs accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant User as "User / CLI"
participant Args as "Args.parse_args()"
participant Selector as "select_build_driver()"
participant Driver as "FbuildDriver"
participant Compiler as "PioCompiler"
participant Fbuild as "fbuild (external)"
User->>Args: invoke CLI (autoresearch / debug_attached)
Args->>Selector: parsed args (deprecated flags allowed)
Selector->>Driver: returns FbuildDriver
Driver->>Compiler: request compile (use_fbuild=True)
Compiler->>Fbuild: invoke compile/upload
Fbuild-->>Compiler: build result
Compiler-->>User: report result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ci/autoresearch/build_driver.py (1)
86-137:⚠️ Potential issue | 🟡 Minor
PlatformIODriveris dead code and should be removed or deprecated.
select_build_driveris hard-wired to return onlyFbuildDriver(), and no callers instantiatePlatformIODriverdirectly anywhere in the codebase. The class remains exported in the public API but is unreachable through the normal autoresearch flow. Either remove it in this PR or add a formal deprecation decorator with a removal timeline.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/autoresearch/build_driver.py` around lines 86 - 137, PlatformIODriver is dead/unreachable because select_build_driver always returns FbuildDriver() and no callers instantiate PlatformIODriver; either remove the PlatformIODriver class entirely or mark it deprecated: add a clear deprecation decorator/comment on the PlatformIODriver class (including a removal version/timeline) and update any public API exports to reflect deprecation/ removal, and ensure select_build_driver and module-level __all__ (or exported symbols) no longer advertise PlatformIODriver if you remove it; reference PlatformIODriver, select_build_driver, and FbuildDriver when making the change so callers and tests can be updated accordingly.
🧹 Nitpick comments (9)
agents/docs/hardware-autoresearch.md (1)
55-57: URL inconsistency with issue-template links — consider pointing at/issues.The issue templates (
.github/ISSUE_TEMPLATE/bug_report.ymlandconfig.yml) link users tohttps://github.com/fastled/fbuild/issues, but this doc (andagents/docs/build-system.mdline 13) sends readers to the repo roothttps://github.com/fastled/fbuild. Since the stated purpose of the link is "file board build compatibility problems", the/issuesURL is more actionable.📝 Suggested alignment
-`bash autoresearch` uses fbuild for all board compiles. Do not use board-specific PlatformIO fallback paths for compatibility issues; file board build compatibility problems at https://github.com/fastled/fbuild. +`bash autoresearch` uses fbuild for all board compiles. Do not use board-specific PlatformIO fallback paths for compatibility issues; file board build compatibility problems at https://github.com/fastled/fbuild/issues.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@agents/docs/hardware-autoresearch.md` around lines 55 - 57, Update the actionable link in the "Build Backend" section (the `bash autoresearch` paragraph) to point to the repository's issue tracker by changing the URL from https://github.com/fastled/fbuild to https://github.com/fastled/fbuild/issues; also make the same change in agents/docs/build-system.md (the line that currently links to the repo root) so both docs consistently direct users to file board build compatibility problems via the /issues page.ci/compiler/compilation_orchestrator.py (1)
106-115:use_fbuild=Truehardcoding is correct — FBUILD_BOARDS fully removed, no reversion risk.The hardcoding is intentional and consistent with the PR: board example compilation via
compilation_orchestrator.pynow unconditionally uses fbuild. Verification confirms:
- FBUILD_BOARDS allowlist is fully removed (no matches anywhere)
- No stale conditional callers that would revert this behavior
run_pio_build()and test call sites correctly defaultuse_fbuild=Falsevia the parameter defaultMinor style consideration: The
use_fbuildparameter remains onPioCompilerbecause other code paths (autoresearch, debug_attached) still need conditional selection, and tests may passuse_fbuild=False. The hardcoding at this single call site is a valid pattern for documenting intent. If you prefer explicit consistency, a module-level constant (FBUILD_ENABLED = True) above the function would prevent accidental re-introduction, but it's not required.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/compiler/compilation_orchestrator.py` around lines 106 - 115, This callsite should intentionally keep use_fbuild=True when constructing PioCompiler in compilation_orchestrator.py (the hardcoding documents that example board compilation always uses fbuild); ensure the PioCompiler signature still accepts use_fbuild and other callers (like run_pio_build, autoresearch, debug_attached) continue to pass or rely on their defaults, and if you prefer explicit intent replace the literal with a module-level constant (e.g., FBUILD_ENABLED = True) and use that constant in the PioCompiler(...) call to prevent accidental reintroduction of conditional logic.ci/autoresearch/build_driver.py (1)
140-150:select_build_driverparameters are now dead — consider documenting or simplifying.
environment,use_fbuild_flag, andno_fbuild_flagare now completely unused but remain in the signature "for command compatibility." That's fine as a transition stance, but nothing here (type annotations, docstring Args, or_prefix) signals that to callers or to linters — future refactors are likely to either remove them inadvertently or miss that they should be removed.Consider one of:
- Add an
Args:block to the docstring explicitly calling out that all three parameters are intentionally ignored and scheduled for removal.- Prefix unused parameters with
_(e.g.,_environment,_use_fbuild_flag,_no_fbuild_flag) so static analysis doesn't flag them and the intent is visible at the call site definition.- If the flags are truly deprecated, track removal via a follow-up issue so
PlatformIODriverand these parameters don't linger indefinitely as unreachable code.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/autoresearch/build_driver.py` around lines 140 - 150, The parameters environment, use_fbuild_flag, and no_fbuild_flag of select_build_driver are unused and should be marked as intentionally ignored; update the function signature to prefix them with underscores (e.g., _environment, _use_fbuild_flag, _no_fbuild_flag) and amend the docstring to include an "Args:" note stating these parameters are intentionally ignored for compatibility (or alternatively add a short sentence in the docstring stating they are deprecated and scheduled for removal), so linters and future readers see the intent while retaining call-site compatibility.ci/ci-compile.py (1)
391-422: Dead code: the Docker auto-selection branch is now unreachable.Hard-coding
use_docker = Falsemakes the entireif use_docker:block (lines 395–422) unreachable, which is confusing to maintain. Consider removing the dead branch (and the now-pointless local variable) so the intent — "board compiles stay native/fbuild" — is expressed directly.♻️ Proposed simplification
- else: - # Normal Docker auto-detection for non-CI environments. - # Board compiles are fbuild-backed by default, so do not auto-route - # them to PlatformIO Docker images. - use_docker = False - if use_docker: - print( - green_text( - "🐳 Docker detected and will be used for faster compilation" - ) - ) - print(" Use --local to force native compilation instead") - # Update workflow to Docker - from ci.compiler.argument_parser import CompilationConfig - - config = CompilationConfig( - boards=config.boards, - examples=config.examples, - workflow=WorkflowType.DOCKER, - defines=config.defines, - extra_packages=config.extra_packages, - verbose=config.verbose, - output_path=config.output_path, - merged_bin=config.merged_bin, - log_failures=config.log_failures, - max_failures=config.max_failures, - docker_build=config.docker_build, - force_local=config.force_local, - wasm_run=config.wasm_run, - global_cache_dir=config.global_cache_dir, - skip_filters=config.skip_filters, - no_parallel=config.no_parallel, - ) + # Normal path for non-CI environments: board compiles are fbuild-backed + # by default, so do not auto-route to PlatformIO Docker images. The + # workflow is left as WorkflowType.NATIVE.Note that
green_textis then no longer used on this path; thefrom ci.compiler.formatting_utils import green_text, yellow_textimport a few lines above can be narrowed to justyellow_text.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/ci-compile.py` around lines 391 - 422, Remove the unreachable Docker auto-selection branch by deleting the hard-coded use_docker = False and the entire if use_docker: block (which creates a new CompilationConfig with WorkflowType.DOCKER) so board compiles remain native/fbuild; also remove or narrow any now-unused imports such as green_text from ci.compiler.formatting_utils (keep yellow_text if still used). Ensure you only remove the dead branch and its dependent code paths (the CompilationConfig instantiation and Docker-related prints) without altering other config usage elsewhere.ci/tests/test_fbuild_default_selection.py (1)
19-22: Assertion willKeyErrorinstead of failing cleanly ifuse_fbuildbecomes positional.
captured["use_fbuild"] = kwargs["use_fbuild"]assumesPioCompileris always constructed withuse_fbuildas a keyword argument. If a refactor passes it positionally, the test fails with a confusingKeyErrorrather than a clear assertion failure. Usingkwargs.get("use_fbuild")with a later explicitassert(or capturingargstoo) would give a clearer diagnostic.♻️ Suggested fix
- def __init__(self, *args: Any, **kwargs: Any) -> None: - captured["use_fbuild"] = kwargs["use_fbuild"] + def __init__(self, *args: Any, **kwargs: Any) -> None: + # Capture for assertion in the test; default to False so a + # positional regression produces a clear assertion failure + # rather than a KeyError. + captured["use_fbuild"] = kwargs.get("use_fbuild", False)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/tests/test_fbuild_default_selection.py` around lines 19 - 22, The FakePioCompiler.__init__ test helper currently assumes use_fbuild is passed as a kwarg and does captured["use_fbuild"] = kwargs["use_fbuild"], which raises KeyError if callers pass it positionally; change it to read use_fbuild more defensively (e.g., check kwargs.get("use_fbuild") and, if not present, look in args by position corresponding to PioCompiler's signature or explicitly set a sentinel), assign that value to captured["use_fbuild"], and then add an explicit assertion that use_fbuild is not the sentinel/None so the test fails with a clear assertion message rather than a KeyError.ci/tests/test_autoresearch_phases.py (1)
176-183: Consider asserting the exact driver set, not just the count.Hard-coding
len(result.drivers) == 8makes this test brittle — any future driver addition (or removal) silently breaks the assertion without clarifying what's expected. Since the test only checks membership ofPARLIOandRMT, a regression that drops another driver would be caught only by the opaque count check.♻️ Suggested refactor
def test_all_drivers(self, fake_project_dir: Path) -> None: args = _make_args(all=True, parlio=False, project_dir=fake_project_dir) result = _parse_args_and_build_commands(args) assert isinstance(result, RunContext) - assert len(result.drivers) == 8 - assert "PARLIO" in result.drivers - assert "RMT" in result.drivers + expected = {"PARLIO", "RMT", "SPI", "UART", "LCD_CLOCKLESS", + "LCD_RGB", "LCD_SPI", "OBJECT_FLED"} # adjust to match + assert set(result.drivers) == expectedPlease confirm the exact set with the current
_parse_args_and_build_commandsimplementation.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/tests/test_autoresearch_phases.py` around lines 176 - 183, The test test_all_drivers should assert the exact driver set instead of a brittle length check: replace the len(result.drivers) == 8 and the separate membership asserts with a single equality assertion comparing set(result.drivers) to the expected set of driver names returned by _parse_args_and_build_commands (e.g., assert set(result.drivers) == {"PARLIO", "RMT", "DRIVER3", ...}). Locate this in test_all_drivers (uses _make_args, _parse_args_and_build_commands, and RunContext) and update the assertion to the explicit expected set so failures clearly show which drivers differ.ci/debug_attached.py (2)
1356-1395: Dead PlatformIO fallback branches inmain().Because
_should_use_fbuild()now always returnsTrue, lines 1362–1363 (else: print("Using PlatformIO")), 1373–1374 (therun_compileelse), and 1394–1395 (therun_uploadelse) are unreachable. This is the downstream effect of the root cause flagged on_should_use_fbuild; documenting here for visibility, but the fix belongs there (either remove the predicate and flatten, or restore meaningful branching).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/debug_attached.py` around lines 1356 - 1395, The PlatformIO fallback branches in main() are unreachable because _should_use_fbuild() always returns True; fix by either restoring meaningful branching logic in _should_use_fbuild or by flattening main() to remove dead PlatformIO code: eliminate the else: print("📦 Using PlatformIO") and the run_compile/run_upload branches (and their imports) and keep only the fbuild paths (run_fbuild_compile, run_fbuild_upload) and the use_fbuild variable/removal as needed; if you choose to restore branching, adjust _should_use_fbuild to return a conditional value so the existing else branches (run_compile, run_upload) are reachable again.
1149-1165: Unused parameters; consider a follow-up to retire_should_use_fbuild.
_should_use_fbuildis now a constantTruewith three unused parameters. Since every call site inmain()ends up in theif use_fbuild:branch, theelsearms that still invokerun_compile/run_upload(lines 1373–1374 and 1394–1395) are dead paths. Consider as a follow-up:
- Inlining or deleting
_should_use_fbuildso callers don't pretend to branch on it.- Removing the PlatformIO fallback branches in
main()to cut ~15 lines of unreachable code.- Or, at minimum, prefix the params with
_and note in the docstring that the function exists only to keep the old call sites compiling during the transition.Leaving the decision function shaped like a real predicate invites future contributors to add board-specific branches back in, which this PR is explicitly trying to prevent.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/debug_attached.py` around lines 1149 - 1165, The function _should_use_fbuild currently always returns True and its parameters (environment, use_fbuild_flag, no_fbuild_flag) are unused; either remove the function and update callers to use the constant True, or minimally mark the parameters as intentionally unused by prefixing them (e.g., _environment, _use_fbuild_flag, _no_fbuild_flag) and update the docstring to state it exists solely for compatibility; also remove or flag the dead PlatformIO fallback branches in main() (the else arms that call run_compile/run_upload) or delete them to avoid misleading branching. Ensure you update every call site that expects a predicate (references to _should_use_fbuild) if you delete/inline it so they use True directly.agents/docs/commands-reference.md (1)
43-43: Use canonical GitHub organization casing in the repository link.The FastLED organization uses title case (
FastLED) as the canonical name on GitHub. While GitHub redirects on case-insensitive queries, using the canonical form maintains consistency with the official organization display and documentation standards.📝 Proposed fix
-File board build compatibility problems at https://github.com/fastled/fbuild. +File board build compatibility problems at https://github.com/FastLED/fbuild.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@agents/docs/commands-reference.md` at line 43, Update the GitHub repository link text to use the canonical organization casing by replacing the lowercase path "https://github.com/fastled/fbuild" with "https://github.com/FastLED/fbuild" in the string that currently reads "File board build compatibility problems at https://github.com/fastled/fbuild." so the repo uses the official FastLED casing in agents/docs/commands-reference.md.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/ISSUE_TEMPLATE/bug_report.yml:
- Line 9: Update the description value that references the board/MCU repo so the
GitHub org uses canonical casing: change the URL string
"https://github.com/fastled/fbuild" to "https://github.com/FastLED/fbuild" in
the description field (the line containing the board/microcontroller question)
to match the organization's canonical name.
In `@ci/autoresearch/args.py`:
- Around line 403-412: Add a runtime deprecation warning in parse_args() just
before returning the Args dataclass: check the parsed flags parsed.use_fbuild
and parsed.no_fbuild and, if either is True, write a stderr warning stating the
specific flag ("--no-fbuild" or "--use-fbuild") is deprecated and has no effect
because fbuild is always used for board builds; use sys.stderr (or print(...,
file=sys.stderr)) so it appears at parse time for callers of parse_args() and
parser.add_argument entries for --use-fbuild/--no-fbuild remain unchanged.
In `@ci/tests/test_fbuild_default_selection.py`:
- Around line 11-50: The test function
test_compile_board_examples_always_uses_fbuild should annotate the monkeypatch
parameter as pytest.MonkeyPatch; update the FakePioCompiler.__init__ signature
to explicitly type *args and **kwargs (e.g., *args: Any, **kwargs: Any) and keep
its return type -> None; ensure FakePioCompiler.build remains typed as
build(self, examples: list[str]) -> list[Future[SketchResult]] (or use
typing.List if consistent) and add any necessary imports (pytest, typing.Any) at
the top so the new annotations resolve.
---
Outside diff comments:
In `@ci/autoresearch/build_driver.py`:
- Around line 86-137: PlatformIODriver is dead/unreachable because
select_build_driver always returns FbuildDriver() and no callers instantiate
PlatformIODriver; either remove the PlatformIODriver class entirely or mark it
deprecated: add a clear deprecation decorator/comment on the PlatformIODriver
class (including a removal version/timeline) and update any public API exports
to reflect deprecation/ removal, and ensure select_build_driver and module-level
__all__ (or exported symbols) no longer advertise PlatformIODriver if you remove
it; reference PlatformIODriver, select_build_driver, and FbuildDriver when
making the change so callers and tests can be updated accordingly.
---
Nitpick comments:
In `@agents/docs/commands-reference.md`:
- Line 43: Update the GitHub repository link text to use the canonical
organization casing by replacing the lowercase path
"https://github.com/fastled/fbuild" with "https://github.com/FastLED/fbuild" in
the string that currently reads "File board build compatibility problems at
https://github.com/fastled/fbuild." so the repo uses the official FastLED casing
in agents/docs/commands-reference.md.
In `@agents/docs/hardware-autoresearch.md`:
- Around line 55-57: Update the actionable link in the "Build Backend" section
(the `bash autoresearch` paragraph) to point to the repository's issue tracker
by changing the URL from https://github.com/fastled/fbuild to
https://github.com/fastled/fbuild/issues; also make the same change in
agents/docs/build-system.md (the line that currently links to the repo root) so
both docs consistently direct users to file board build compatibility problems
via the /issues page.
In `@ci/autoresearch/build_driver.py`:
- Around line 140-150: The parameters environment, use_fbuild_flag, and
no_fbuild_flag of select_build_driver are unused and should be marked as
intentionally ignored; update the function signature to prefix them with
underscores (e.g., _environment, _use_fbuild_flag, _no_fbuild_flag) and amend
the docstring to include an "Args:" note stating these parameters are
intentionally ignored for compatibility (or alternatively add a short sentence
in the docstring stating they are deprecated and scheduled for removal), so
linters and future readers see the intent while retaining call-site
compatibility.
In `@ci/ci-compile.py`:
- Around line 391-422: Remove the unreachable Docker auto-selection branch by
deleting the hard-coded use_docker = False and the entire if use_docker: block
(which creates a new CompilationConfig with WorkflowType.DOCKER) so board
compiles remain native/fbuild; also remove or narrow any now-unused imports such
as green_text from ci.compiler.formatting_utils (keep yellow_text if still
used). Ensure you only remove the dead branch and its dependent code paths (the
CompilationConfig instantiation and Docker-related prints) without altering
other config usage elsewhere.
In `@ci/compiler/compilation_orchestrator.py`:
- Around line 106-115: This callsite should intentionally keep use_fbuild=True
when constructing PioCompiler in compilation_orchestrator.py (the hardcoding
documents that example board compilation always uses fbuild); ensure the
PioCompiler signature still accepts use_fbuild and other callers (like
run_pio_build, autoresearch, debug_attached) continue to pass or rely on their
defaults, and if you prefer explicit intent replace the literal with a
module-level constant (e.g., FBUILD_ENABLED = True) and use that constant in the
PioCompiler(...) call to prevent accidental reintroduction of conditional logic.
In `@ci/debug_attached.py`:
- Around line 1356-1395: The PlatformIO fallback branches in main() are
unreachable because _should_use_fbuild() always returns True; fix by either
restoring meaningful branching logic in _should_use_fbuild or by flattening
main() to remove dead PlatformIO code: eliminate the else: print("📦 Using
PlatformIO") and the run_compile/run_upload branches (and their imports) and
keep only the fbuild paths (run_fbuild_compile, run_fbuild_upload) and the
use_fbuild variable/removal as needed; if you choose to restore branching,
adjust _should_use_fbuild to return a conditional value so the existing else
branches (run_compile, run_upload) are reachable again.
- Around line 1149-1165: The function _should_use_fbuild currently always
returns True and its parameters (environment, use_fbuild_flag, no_fbuild_flag)
are unused; either remove the function and update callers to use the constant
True, or minimally mark the parameters as intentionally unused by prefixing them
(e.g., _environment, _use_fbuild_flag, _no_fbuild_flag) and update the docstring
to state it exists solely for compatibility; also remove or flag the dead
PlatformIO fallback branches in main() (the else arms that call
run_compile/run_upload) or delete them to avoid misleading branching. Ensure you
update every call site that expects a predicate (references to
_should_use_fbuild) if you delete/inline it so they use True directly.
In `@ci/tests/test_autoresearch_phases.py`:
- Around line 176-183: The test test_all_drivers should assert the exact driver
set instead of a brittle length check: replace the len(result.drivers) == 8 and
the separate membership asserts with a single equality assertion comparing
set(result.drivers) to the expected set of driver names returned by
_parse_args_and_build_commands (e.g., assert set(result.drivers) == {"PARLIO",
"RMT", "DRIVER3", ...}). Locate this in test_all_drivers (uses _make_args,
_parse_args_and_build_commands, and RunContext) and update the assertion to the
explicit expected set so failures clearly show which drivers differ.
In `@ci/tests/test_fbuild_default_selection.py`:
- Around line 19-22: The FakePioCompiler.__init__ test helper currently assumes
use_fbuild is passed as a kwarg and does captured["use_fbuild"] =
kwargs["use_fbuild"], which raises KeyError if callers pass it positionally;
change it to read use_fbuild more defensively (e.g., check
kwargs.get("use_fbuild") and, if not present, look in args by position
corresponding to PioCompiler's signature or explicitly set a sentinel), assign
that value to captured["use_fbuild"], and then add an explicit assertion that
use_fbuild is not the sentinel/None so the test fails with a clear assertion
message rather than a KeyError.
🪄 Autofix (Beta)
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f8dc8077-5d52-4e2e-bc79-45956e7998b9
📒 Files selected for processing (18)
.github/ISSUE_TEMPLATE/bug_report.yml.github/ISSUE_TEMPLATE/config.yml.github/workflows/build_template.ymlagents/docs/build-system.mdagents/docs/commands-reference.mdagents/docs/hardware-autoresearch.mdagents/docs/testing-commands.mdautoresearchci/autoresearch/args.pyci/autoresearch/build_driver.pyci/ci-compile.pyci/compiler/compilation_orchestrator.pyci/compiler/fbuild_boards.pyci/debug_attached.pyci/tests/test_autoresearch_phases.pyci/tests/test_fbuild_boards.pyci/tests/test_fbuild_default_selection.pyci/util/pyserial_monitor.py
💤 Files with no reviewable changes (2)
- ci/tests/test_fbuild_boards.py
- ci/compiler/fbuild_boards.py
|
Addressed the current CodeRabbit concerns in Changes included:
Validation:
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ci/ci-compile.py (1)
348-357:⚠️ Potential issue | 🟡 MinorStale comment and leftover single-board guard in GH Actions force-local block.
Two issues in the surviving logic after Docker auto-detection was removed:
- The comment on lines 348–350 still describes "Auto-detect Docker availability"; the block no longer does that — it only forces
--localon GitHub Actions. Please update the comment so intent matches behavior.config.boards and len(config.boards) == 1was only needed by the removed Docker-selection branch (which picked an image per single board). For the remaining "force local on CI" purpose this restriction is harmful: a GH Actions run with multiple boards will silently skip the force-local branch and could still end up attempting to pull Docker images — the exact thing the block is supposed to prevent.♻️ Suggested change
- # Auto-detect Docker availability if neither --docker nor --local is specified - # and not already running inside Docker - # IMPORTANT: Force --local on GitHub Actions to avoid pulling Docker images + # Force --local on GitHub Actions to avoid pulling Docker images on CI runners. + # Only applies when the workflow is still NATIVE, --local wasn't already set, + # and we're not already executing inside a Docker container. if ( config.workflow == WorkflowType.NATIVE and not config.force_local and not os.environ.get("FASTLED_DOCKER") - and config.boards - and len(config.boards) == 1 + and config.boards ):🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/ci-compile.py` around lines 348 - 357, Update the misleading comment above the GH Actions force-local block to state that it forces --local on CI (GitHub Actions) rather than auto-detecting Docker availability, and remove the leftover single-board guard by deleting the "and config.boards and len(config.boards) == 1" condition from the if expression that checks config.workflow == WorkflowType.NATIVE, not config.force_local, and not os.environ.get("FASTLED_DOCKER"); keep the other checks intact so the branch always forces local on GH Actions regardless of how many boards are specified.
🧹 Nitpick comments (1)
ci/autoresearch/args.py (1)
95-96:parse_argsshould accept an optionallist[str]parameter for testing flexibility.The new deprecation-warning tests in
ci/tests/test_fbuild_default_selection.pyhave to monkeypatchsys.argvto drive this function becauseparse_args()takes no argv argument. Adding aargv: list[str] | None = Noneparameter and forwarding it toparser.parse_args(argv)makes the function directly testable and avoids global-state patching.♻️ Proposed change
- `@staticmethod` - def parse_args() -> "Args": + `@staticmethod` + def parse_args(argv: list[str] | None = None) -> "Args": """Parse command-line arguments and return Args dataclass instance.""" ... - parsed = parser.parse_args() + parsed = parser.parse_args(argv)Based on learnings: "parse_args functions MUST accept an optional list[str] parameter for testing flexibility".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/autoresearch/args.py` around lines 95 - 96, The parse_args static method currently takes no arguments which forces tests to monkeypatch sys.argv; modify Args.parse_args to accept an optional parameter argv: list[str] | None = None and forward it into the argparse call (i.e., call parser.parse_args(argv) instead of parser.parse_args()), preserving the return type and behavior when argv is None; update the function signature and any internal references to use this argv param so tests can pass a list of arguments directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ci/tests/test_fbuild_default_selection.py`:
- Around line 28-34: FakePioCompiler.__init__ is indexing the wrong positional
argument for use_fbuild: when falling back to *args it should read the 7th
positional param (use_fbuild) not the 6th; update the fallback to check
len(args) >= 7 and set use_fbuild = args[6] so captured["use_fbuild"] accurately
reflects the PioCompiler.__init__ signature, keeping the existing assert and
bool conversion for captured["use_fbuild"].
---
Outside diff comments:
In `@ci/ci-compile.py`:
- Around line 348-357: Update the misleading comment above the GH Actions
force-local block to state that it forces --local on CI (GitHub Actions) rather
than auto-detecting Docker availability, and remove the leftover single-board
guard by deleting the "and config.boards and len(config.boards) == 1" condition
from the if expression that checks config.workflow == WorkflowType.NATIVE, not
config.force_local, and not os.environ.get("FASTLED_DOCKER"); keep the other
checks intact so the branch always forces local on GH Actions regardless of how
many boards are specified.
---
Nitpick comments:
In `@ci/autoresearch/args.py`:
- Around line 95-96: The parse_args static method currently takes no arguments
which forces tests to monkeypatch sys.argv; modify Args.parse_args to accept an
optional parameter argv: list[str] | None = None and forward it into the
argparse call (i.e., call parser.parse_args(argv) instead of
parser.parse_args()), preserving the return type and behavior when argv is None;
update the function signature and any internal references to use this argv param
so tests can pass a list of arguments directly.
🪄 Autofix (Beta)
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 22580040-d1db-4873-8144-8ade70f813c5
📒 Files selected for processing (13)
.github/ISSUE_TEMPLATE/bug_report.yml.github/ISSUE_TEMPLATE/config.ymlagents/docs/build-system.mdagents/docs/commands-reference.mdagents/docs/hardware-autoresearch.mdagents/docs/testing-commands.mdci/autoresearch/args.pyci/autoresearch/build_driver.pyci/ci-compile.pyci/compiler/compilation_orchestrator.pyci/debug_attached.pyci/tests/test_autoresearch_phases.pyci/tests/test_fbuild_default_selection.py
✅ Files skipped from review due to trivial changes (3)
- .github/ISSUE_TEMPLATE/config.yml
- agents/docs/hardware-autoresearch.md
- .github/ISSUE_TEMPLATE/bug_report.yml
🚧 Files skipped from review as they are similar to previous changes (3)
- agents/docs/build-system.md
- ci/compiler/compilation_orchestrator.py
- ci/debug_attached.py
There was a problem hiding this comment.
🧹 Nitpick comments (3)
ci/tests/test_fbuild_default_selection.py (3)
66-69: Consider parametrizing across all flag combinations to lock the invariant.The "always selects fbuild" contract is the core behavior change of this PR, but the test only exercises one
(use_fbuild=False, no_fbuild=True)combination. Parametrizing across all four combinations would make the invariant explicit and guard against accidental re-introduction of conditional logic.♻️ Proposed refactor
-def test_autoresearch_always_selects_fbuild() -> None: - """select_build_driver should always return the fbuild driver.""" - driver = select_build_driver("digispark-tiny", False, True) - assert isinstance(driver, FbuildDriver) +@pytest.mark.parametrize( + "use_fbuild,no_fbuild", + [(False, False), (True, False), (False, True), (True, True)], +) +def test_autoresearch_always_selects_fbuild( + use_fbuild: bool, no_fbuild: bool +) -> None: + """select_build_driver should always return the fbuild driver.""" + driver = select_build_driver("digispark-tiny", use_fbuild, no_fbuild) + assert isinstance(driver, FbuildDriver)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/tests/test_fbuild_default_selection.py` around lines 66 - 69, Update the test_autoresearch_always_selects_fbuild to parametrize all four boolean combinations for the two flags passed to select_build_driver (the current call uses use_fbuild=False, no_fbuild=True only); for each (use_fbuild, no_fbuild) pair assert the returned driver is an instance of FbuildDriver so the invariant is locked. Locate the test function name test_autoresearch_always_selects_fbuild and replace the single-case assertion with a parameterized loop or test parameterization that calls select_build_driver("digispark-tiny", use_fbuild, no_fbuild) for all combinations and asserts isinstance(driver, FbuildDriver).
28-34: Positional fallback is tightly coupled toPioCompiler.__init__signature.The
args[6]index silently depends on the exact parameter ordering ofPioCompiler.__init__(board, verbose, global_cache_dir, additional_defines, additional_include_dirs, additional_libs, use_fbuild). If anyone reorders or inserts a parameter, this fallback will capture the wrong value and the test could pass for the wrong reason or fail obscurely. Sincecompile_board_examplescurrently passesuse_fbuildas a kwarg, the fallback is effectively dead code anyway — consider removing it and just asserting on the kwarg path, or at least adding a comment referencing the expectedPioCompilersignature to aid future refactors.♻️ Proposed simplification
class FakePioCompiler: def __init__(self, *args: Any, **kwargs: Any) -> None: - use_fbuild = kwargs.get("use_fbuild", missing) - if use_fbuild is missing and len(args) >= 7: - use_fbuild = args[6] - assert use_fbuild is not missing, "PioCompiler use_fbuild argument missing" + assert "use_fbuild" in kwargs, ( + "compile_board_examples must pass use_fbuild as a keyword argument" + ) + use_fbuild = kwargs["use_fbuild"] captured["use_fbuild"] = bool(use_fbuild)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/tests/test_fbuild_default_selection.py` around lines 28 - 34, The positional fallback in FakePioCompiler.__init__ relies on the exact PioCompiler.__init__ signature (args[6]) and is fragile; remove the args[6] fallback and only read use_fbuild from kwargs, asserting it's present via kwargs, and set captured["use_fbuild"]=bool(use_fbuild); alternatively, if you want to keep the fallback for historical reasons, add a clear comment referencing the expected PioCompiler.__init__ parameter order and why args[6] is used, and ensure compile_board_examples still passes use_fbuild as a kwarg so the test remains deterministic.
1-13: Nit: import block formatting.
from typing import Anyis separated from the other standard-library imports (concurrent.futures,pathlib) by a blank line, which visually groups it with third-party/local imports. Consider consolidating all stdlib imports into one block.✏️ Proposed fix
-from typing import Any - from concurrent.futures import Future from pathlib import Path +from typing import Any import pytest🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ci/tests/test_fbuild_default_selection.py` around lines 1 - 13, Consolidate standard-library imports by moving "from typing import Any" into the stdlib block with "from concurrent.futures import Future" and "from pathlib import Path" so all three appear together without an intervening blank line; keep third-party and local imports (pytest and project modules like Args, FbuildDriver, select_build_driver, Board, compile_board_examples, SketchResult, parse_debug_attached_args) separated by a single blank line below the stdlib group.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@ci/tests/test_fbuild_default_selection.py`:
- Around line 66-69: Update the test_autoresearch_always_selects_fbuild to
parametrize all four boolean combinations for the two flags passed to
select_build_driver (the current call uses use_fbuild=False, no_fbuild=True
only); for each (use_fbuild, no_fbuild) pair assert the returned driver is an
instance of FbuildDriver so the invariant is locked. Locate the test function
name test_autoresearch_always_selects_fbuild and replace the single-case
assertion with a parameterized loop or test parameterization that calls
select_build_driver("digispark-tiny", use_fbuild, no_fbuild) for all
combinations and asserts isinstance(driver, FbuildDriver).
- Around line 28-34: The positional fallback in FakePioCompiler.__init__ relies
on the exact PioCompiler.__init__ signature (args[6]) and is fragile; remove the
args[6] fallback and only read use_fbuild from kwargs, asserting it's present
via kwargs, and set captured["use_fbuild"]=bool(use_fbuild); alternatively, if
you want to keep the fallback for historical reasons, add a clear comment
referencing the expected PioCompiler.__init__ parameter order and why args[6] is
used, and ensure compile_board_examples still passes use_fbuild as a kwarg so
the test remains deterministic.
- Around line 1-13: Consolidate standard-library imports by moving "from typing
import Any" into the stdlib block with "from concurrent.futures import Future"
and "from pathlib import Path" so all three appear together without an
intervening blank line; keep third-party and local imports (pytest and project
modules like Args, FbuildDriver, select_build_driver, Board,
compile_board_examples, SketchResult, parse_debug_attached_args) separated by a
single blank line below the stdlib group.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 91243a37-892f-4c9d-a1e6-086e57fe71b0
📒 Files selected for processing (2)
ci/autoresearch/args.pyci/tests/test_fbuild_default_selection.py
Summary
ci-compile, anddebug_attachedFBUILD_BOARDSallowlist and replace it with tests that assert the default-selection behaviorTesting
uv run pytest ci/tests/test_autoresearch_phases.py ci/tests/test_fbuild_default_selection.pySummary by CodeRabbit
Documentation
Deprecations
--use-fbuildand--no-fbuildare deprecated: they now emit warnings and no longer change behavior—fbuild is always used for board compilation.