Skip to content

ci: make fbuild the default for board builds - #2395

Merged
zackees merged 3 commits into
masterfrom
pr/fbuild-default-board-builds
Apr 24, 2026
Merged

zackees merged 3 commits into
masterfrom
pr/fbuild-default-board-builds

Conversation

@zackees

@zackees zackees commented Apr 24, 2026 •

Copy link
Copy Markdown
Member

Summary

  • route board compiles through fbuild by default across autoresearch, ci-compile, and debug_attached
  • remove the obsolete FBUILD_BOARDS allowlist and replace it with tests that assert the default-selection behavior
  • update docs and issue guidance so board build compatibility issues point to the fbuild tracker

Testing

  • uv run pytest ci/tests/test_autoresearch_phases.py ci/tests/test_fbuild_default_selection.py

Summary by CodeRabbit

  • Documentation

    • Issue templates and multiple docs/help texts now direct board build compatibility reports to the fbuild tracker and state fbuild is the default build backend for all boards; references to PlatformIO fallbacks removed.
  • Deprecations

    • --use-fbuild and --no-fbuild are deprecated: they now emit warnings and no longer change behavior—fbuild is always used for board compilation.

@coderabbitai

coderabbitai Bot commented Apr 24, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Summary
GitHub Templates & Config
​.github/ISSUE_TEMPLATE/bug_report.yml, ​.github/ISSUE_TEMPLATE/config.yml
Updated issue prompt and contact links to route board build compatibility problems to the FastLED/fbuild issue tracker.
Workflows
​.github/workflows/build_template.yml
Rewrote workflow comment and expanded cache-key-extra to include Python deps (trusted/pyproject.toml, trusted/uv.lock) alongside platform files; asserts per-board non-colliding fbuild caches.
Documentation
agents/docs/...
agents/docs/build-system.md, agents/docs/commands-reference.md, agents/docs/hardware-autoresearch.md, agents/docs/testing-commands.md
Standardized docs to state fbuild is the mandatory backend for all boards; removed PlatformIO fallback/allowlist guidance and point compatibility issues to the fbuild tracker.
CLI & Help Text
autoresearch, ci/autoresearch/args.py
Marked --use-fbuild/--no-fbuild as deprecated compatibility flags and emit warnings if used; added Args.parse_args(argv) optional parameter.
Build Driver Selection & Orchestration
ci/autoresearch/build_driver.py, ci/compiler/compilation_orchestrator.py, ci/debug_attached.py, ci/ci-compile.py
Eliminated board-dependent selection: select_build_driver always returns FbuildDriver(), orchestration always enables fbuild (constant), removed FBUILD_BOARDS special-casing and related Docker auto-selection pathways; debug CLI always uses fbuild compile/upload and resolves env via defaults.
Removed Allowlist
ci/compiler/fbuild_boards.py
Deleted FBUILD_BOARDS module and its frozenset of board IDs.
Tests Removed
ci/tests/test_fbuild_boards.py
Removed test validating FBUILD_BOARDS membership and pyproject fbuild dependency check.
Tests Added / Updated
ci/tests/test_autoresearch_phases.py, ci/tests/test_fbuild_default_selection.py
Updated driver expectations (LCD driver set) and added tests asserting fbuild is used by default, FbuildDriver selection, and deprecation warnings from CLI flags.
Module Docs
ci/util/pyserial_monitor.py
Docstrings adjusted to remove --no-fbuild references and reframe module as legacy direct-serial workflow helper.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

Poem

"I hopped through code with nimble paws,
fbuild now rules without a pause.
Branches pruned to one clear track,
every board joins the same pack.
— 🐇"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly and concisely describes the main change: making fbuild the default for board builds across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pr/fbuild-default-board-builds

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

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

PlatformIODriver is dead code and should be removed or deprecated.

select_build_driver is hard-wired to return only FbuildDriver(), and no callers instantiate PlatformIODriver directly 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.yml and config.yml) link users to https://github.com/fastled/fbuild/issues, but this doc (and agents/docs/build-system.md line 13) sends readers to the repo root https://github.com/fastled/fbuild. Since the stated purpose of the link is "file board build compatibility problems", the /issues URL 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=True hardcoding is correct — FBUILD_BOARDS fully removed, no reversion risk.

The hardcoding is intentional and consistent with the PR: board example compilation via compilation_orchestrator.py now 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 default use_fbuild=False via the parameter default

Minor style consideration: The use_fbuild parameter remains on PioCompiler because other code paths (autoresearch, debug_attached) still need conditional selection, and tests may pass use_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_driver parameters are now dead — consider documenting or simplifying.

environment, use_fbuild_flag, and no_fbuild_flag are 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 PlatformIODriver and 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 = False makes the entire if 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_text is then no longer used on this path; the from ci.compiler.formatting_utils import green_text, yellow_text import a few lines above can be narrowed to just yellow_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 will KeyError instead of failing cleanly if use_fbuild becomes positional.

captured["use_fbuild"] = kwargs["use_fbuild"] assumes PioCompiler is always constructed with use_fbuild as a keyword argument. If a refactor passes it positionally, the test fails with a confusing KeyError rather than a clear assertion failure. Using kwargs.get("use_fbuild") with a later explicit assert (or capturing args too) 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) == 8 makes this test brittle — any future driver addition (or removal) silently breaks the assertion without clarifying what's expected. Since the test only checks membership of PARLIO and RMT, 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) == expected

Please confirm the exact set with the current _parse_args_and_build_commands implementation.

🤖 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 in main().

Because _should_use_fbuild() now always returns True, lines 1362–1363 (else: print("Using PlatformIO")), 1373–1374 (the run_compile else), and 1394–1395 (the run_upload else) 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_fbuild is now a constant True with three unused parameters. Since every call site in main() ends up in the if use_fbuild: branch, the else arms that still invoke run_compile / run_upload (lines 1373–1374 and 1394–1395) are dead paths. Consider as a follow-up:

  1. Inlining or deleting _should_use_fbuild so callers don't pretend to branch on it.
  2. Removing the PlatformIO fallback branches in main() to cut ~15 lines of unreachable code.
  3. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 34342ba and f215b56.

📒 Files selected for processing (18)
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/ISSUE_TEMPLATE/config.yml
  • .github/workflows/build_template.yml
  • agents/docs/build-system.md
  • agents/docs/commands-reference.md
  • agents/docs/hardware-autoresearch.md
  • agents/docs/testing-commands.md
  • autoresearch
  • ci/autoresearch/args.py
  • ci/autoresearch/build_driver.py
  • ci/ci-compile.py
  • ci/compiler/compilation_orchestrator.py
  • ci/compiler/fbuild_boards.py
  • ci/debug_attached.py
  • ci/tests/test_autoresearch_phases.py
  • ci/tests/test_fbuild_boards.py
  • ci/tests/test_fbuild_default_selection.py
  • ci/util/pyserial_monitor.py
💤 Files with no reviewable changes (2)
  • ci/tests/test_fbuild_boards.py
  • ci/compiler/fbuild_boards.py

Comment thread .github/ISSUE_TEMPLATE/bug_report.yml Resolved
Comment thread ci/autoresearch/args.py Resolved
@zackees

zackees commented Apr 24, 2026

Copy link
Copy Markdown
Member Author

Addressed the current CodeRabbit concerns in b102613791.

Changes included:

  • canonicalized the fbuild issue links to FastLED/fbuild/issues
  • added runtime stderr warnings for deprecated --use-fbuild / --no-fbuild flags
  • removed the dead PlatformIO fallback branches from ci/debug_attached.py and the dead Docker auto-selection branch from ci/ci-compile.py
  • marked PlatformIODriver and select_build_driver compatibility parameters as deprecated intent
  • tightened tests with explicit driver-set assertions, typed test helpers, and coverage for the new deprecation warnings

Validation:

  • uv run pytest ci/tests/test_autoresearch_phases.py ci/tests/test_fbuild_default_selection.py

@coderabbitai coderabbitai 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.

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 | 🟡 Minor

Stale comment and leftover single-board guard in GH Actions force-local block.

Two issues in the surviving logic after Docker auto-detection was removed:

  1. The comment on lines 348–350 still describes "Auto-detect Docker availability"; the block no longer does that — it only forces --local on GitHub Actions. Please update the comment so intent matches behavior.
  2. config.boards and len(config.boards) == 1 was 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_args should accept an optional list[str] parameter for testing flexibility.

The new deprecation-warning tests in ci/tests/test_fbuild_default_selection.py have to monkeypatch sys.argv to drive this function because parse_args() takes no argv argument. Adding a argv: list[str] | None = None parameter and forwarding it to parser.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

📥 Commits

Reviewing files that changed from the base of the PR and between f215b56 and b102613.

📒 Files selected for processing (13)
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/ISSUE_TEMPLATE/config.yml
  • agents/docs/build-system.md
  • agents/docs/commands-reference.md
  • agents/docs/hardware-autoresearch.md
  • agents/docs/testing-commands.md
  • ci/autoresearch/args.py
  • ci/autoresearch/build_driver.py
  • ci/ci-compile.py
  • ci/compiler/compilation_orchestrator.py
  • ci/debug_attached.py
  • ci/tests/test_autoresearch_phases.py
  • ci/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

@coderabbitai coderabbitai 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.

🧹 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 to PioCompiler.__init__ signature.

The args[6] index silently depends on the exact parameter ordering of PioCompiler.__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. Since compile_board_examples currently passes use_fbuild as 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 expected PioCompiler signature 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 Any is 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

📥 Commits

Reviewing files that changed from the base of the PR and between b102613 and 408819a.

📒 Files selected for processing (2)
  • ci/autoresearch/args.py
  • ci/tests/test_fbuild_default_selection.py

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant