Skip to content

fix(ci/lint): make python_pipeline green on master (KBI002 + dead monkeypatch from #3290) - #3312

Merged
zackees merged 1 commit into
masterfrom
fix/autoresearch-phases-kbi002
Jun 20, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/autoresearch-phases-kbi002

Conversation

@zackees

@zackees zackees commented Jun 20, 2026 •

Copy link
Copy Markdown
Member

Two pre-existing lint failures on master blocking the session-stop hook every turn. Both small, both cleanup.

Changes

  1. ci/autoresearch/phases.py:813,1067 — bare except KeyboardInterrupt: raise violated KBI002. Replaced with except KeyboardInterrupt as ki: handle_keyboard_interrupt(ki); raise (the canonical project pattern; handle_keyboard_interrupt already imported).

  2. ci/autoresearch/staging.py — _suppress_root_platformio_merge monkeypatched ci.compiler.pio.get_root_platformio_build_flags. That function was a bridge from PR feat(autoresearch): synthesise platformio.ini from boards.py, drop root dep #3290 while PR Sever root platformio.ini merge from CI compile path (#3274 Phase 2) #3278 was in flight. PR Sever root platformio.ini merge from CI compile path (#3274 Phase 2) #3278 (sever) and Deprecate PioCompiler as build fallback + Phase 4 cleanup (#3274 Phase 3) #3279 (Phase 4 cleanup, via PR feat(ci): deprecate PioCompiler backend + Phase 4 cleanup (#3279) #3295) have both merged; get_root_platformio_build_flags was deleted entirely. The monkeypatch's target no longer exists — ty was correctly flagging the unresolved-attribute reference. Deleted the obsolete context manager + its with block.

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved keyboard interrupt handling during project synthesis process.
    • Simplified internal project staging initialization.

…keypatch)

Two pre-existing lint failures on master were blocking the session-stop
hook on every turn:

1. `ci/autoresearch/phases.py:813,1067` — bare `except KeyboardInterrupt:
   raise` violated KBI002 (KeyboardInterrupt handler must call
   `handle_keyboard_interrupt(ki)`). Replaced with the canonical pattern;
   `handle_keyboard_interrupt` was already imported at the module top.

2. `ci/autoresearch/staging.py` — `_suppress_root_platformio_merge`
   monkeypatched `ci.compiler.pio.get_root_platformio_build_flags`,
   which was a bridge added in PR #3290 while PR #3278 was in flight.
   PR #3278 (sever) and PR #3279 (Phase 4 cleanup, PR #3295) have both
   merged; `get_root_platformio_build_flags` was deleted entirely.
   The monkeypatch's target no longer exists — ty was correctly flagging
   the `unresolved-attribute` reference. Deleted the obsolete context
   manager and its `with` block.

`bash lint` python_pipeline now green.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 20, 2026
@zackees
zackees merged commit 837b974 into master Jun 20, 2026
9 of 10 checks passed
@coderabbitai

coderabbitai Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7bbd5727-8f0f-4687-ab5a-ebc39b442e6e

📥 Commits

Reviewing files that changed from the base of the PR and between fae6321 and 1ba2092.

📒 Files selected for processing (2)
  • ci/autoresearch/phases.py
  • ci/autoresearch/staging.py

📝 Walkthrough

Walkthrough

Two cleanup changes to the autoresearch CI pipeline: phases.py tightens KeyboardInterrupt handlers in both platformio.ini synthesis paths to capture the exception and call handle_keyboard_interrupt before re-raising; staging.py removes the _suppress_root_platformio_merge monkey-patch wrapper and calls _init_platformio_build directly.

Changes

Autoresearch CI pipeline cleanup

Layer / File(s) Summary
KeyboardInterrupt routing in synthesis paths
ci/autoresearch/phases.py
Both the parse-time (platformio.ini after env is known) and deferred (post chip auto-detect) synthesis paths now capture KeyboardInterrupt as ki and route it through handle_keyboard_interrupt(ki) before re-raising.
Remove _suppress_root_platformio_merge monkey-patch from staging
ci/autoresearch/staging.py
Drops contextmanager/Iterator imports and the entire _suppress_root_platformio_merge function; synthesise_autoresearch_project now calls _init_platformio_build directly with an inline comment noting the root platformio.ini merge path is gone.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

  • FastLED/FastLED#3290: Directly related — introduced the _suppress_root_platformio_merge wrapper around _init_platformio_build in ci/autoresearch/staging.py that this PR removes.

Poem

🐇 A monkey-patch lived in the staging land,
Suppressing merges with a conjured hand.
But upstream severed the root ini thread—
So I yanked the wrapper and called direct instead!
handle_keyboard_interrupt now gets its due,
The autoresearch pipeline: simpler, and true. ✨

✨ 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 fix/autoresearch-phases-kbi002

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.

@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 20, 2026
@zackees
zackees deleted the fix/autoresearch-phases-kbi002 branch August 21, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant