Skip to content

Comments

refactor: extract CommandExecutionContext to decouple BrowserManagerHandle from TaskManager#1125

Open
vringar wants to merge 4 commits intorefactor/architecture-docsfrom
refactor/extract-command-context
Open

refactor: extract CommandExecutionContext to decouple BrowserManagerHandle from TaskManager#1125
vringar wants to merge 4 commits intorefactor/architecture-docsfrom
refactor/extract-command-context

Conversation

@vringar
Copy link
Contributor

@vringar vringar commented Feb 19, 2026

Summary

  • Extract FailureTracker class from TaskManager's inline failure tracking fields
  • Define CommandExecutionContext protocol that BrowserManagerHandle depends on instead of TaskManager directly
  • Update BrowserManagerHandle to use the protocol, breaking the circular dependency
  • TaskManager implements the protocol via store_record() and finalize_visit_id() methods

This enables mock-based unit testing of BrowserManagerHandle without needing a full TaskManager.

Stacked on #1124.

@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 63.88889% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.03%. Comparing base (8d36d7f) to head (1be210b).

Files with missing lines Patch % Lines
openwpm/browser_manager.py 21.42% 11 Missing ⚠️
openwpm/failure_tracker.py 72.72% 9 Missing ⚠️
openwpm/task_manager.py 71.42% 4 Missing ⚠️
openwpm/command_execution_context.py 81.81% 2 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           refactor/architecture-docs    #1125      +/-   ##
==============================================================
+ Coverage                       36.17%   44.03%   +7.86%     
==============================================================
  Files                              35       37       +2     
  Lines                            3475     3522      +47     
==============================================================
+ Hits                             1257     1551     +294     
+ Misses                           2218     1971     -247     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vringar vringar force-pushed the refactor/extract-command-context branch from 6b6daf0 to 536eb98 Compare February 20, 2026 12:17
@vringar vringar changed the base branch from refactor/architecture-docs to master February 20, 2026 12:21
@vringar vringar changed the base branch from master to refactor/architecture-docs February 20, 2026 12:24
@vringar vringar force-pushed the refactor/architecture-docs branch from 3eee199 to 8d36d7f Compare February 20, 2026 12:41
@vringar vringar force-pushed the refactor/extract-command-context branch from 536eb98 to 1be210b Compare February 20, 2026 12:41
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