Skip to content

Address PR #182 review feedback: refactor batch handling and fix test issues#183

Closed
Copilot wants to merge 2 commits intobolt/optimize-thread-pool-overhead-10412449787616114386from
copilot/apply-comments-from-pr-182
Closed

Address PR #182 review feedback: refactor batch handling and fix test issues#183
Copilot wants to merge 2 commits intobolt/optimize-thread-pool-overhead-10412449787616114386from
copilot/apply-comments-from-pr-182

Conversation

Copy link

Copilot AI commented Feb 9, 2026

Addresses review feedback from PR #182 which introduced conditional thread pool usage for small rule batches.

Changes

Extract duplicate batch result handling logic

The single-batch and multi-batch paths duplicated counter updates and progress bar rendering. Extracted into _handle_batch_result():

def _handle_batch_result(result: Optional[List[str]]):
    nonlocal successful_batches
    if result:
        successful_batches += 1
        existing_rules.update(result)
    render_progress_bar(successful_batches, total_batches, f"Folder {sanitize_for_log(folder_name)}")

# Now both paths use the helper
if total_batches == 1:
    result = process_batch(1, batches[0])
    _handle_batch_result(result)
else:
    with concurrent.futures.ThreadPoolExecutor(max_workers=3) as executor:
        # ...
        _handle_batch_result(result)

Fix import-time side effects in test_push_rules_perf.py

Moved import main from module level into test methods to prevent import-time execution of load_dotenv() and USE_COLORS computation. Matches pattern in test_plan_details.py.

Fix mock future reuse in test_multi_batch_uses_thread_pool

Test was returning identical mock future for each submit() call, causing all batches to collapse into single dict entry. Now uses distinct futures:

mock_future1, mock_future2 = MagicMock(), MagicMock()
mock_executor_instance.submit.side_effect = [mock_future1, mock_future2]
mock_as_completed.return_value = [mock_future1, mock_future2]

Documentation and linting

  • Added module/class docstrings to test_push_rules_perf.py
  • Fixed markdown reference syntax in .jules/bolt.md
  • All ruff checks pass
Original prompt

Hi @copilot, please open a new pull request to apply changes based on the comments in this thread for Pull Request: #182. Thank you!

Custom agent used: Development Partner
The Development Partner Protocol


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@trunk-io
Copy link

trunk-io bot commented Feb 9, 2026

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

… imports, and improve test coverage

Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Feb 9, 2026

👋 Development Partner is reviewing this PR. Will provide feedback shortly.

Copilot AI changed the title [WIP] Update code based on comments from pull request 182 Address PR #182 review feedback: refactor batch handling and fix test issues Feb 9, 2026
Copilot AI requested a review from abhimehro February 9, 2026 17:22
@abhimehro abhimehro deleted the branch bolt/optimize-thread-pool-overhead-10412449787616114386 February 13, 2026 02:09
@abhimehro abhimehro closed this Feb 13, 2026
@abhimehro abhimehro deleted the copilot/apply-comments-from-pr-182 branch February 13, 2026 23:49
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.

2 participants