Description
src/fromager/hooks.py has 28% unit test coverage with no dedicated unit test file (97% combined coverage including e2e tests). Hooks are the primary extension mechanism, using stevedore for plugin discovery.
The three run_*_hooks() functions have no error handling - exceptions from plugins propagate unpredictably to callers. Error handling varies by call site: bootstrapper.py wraps its call in try/except, but build.py does not.
_get_hooks() uses @with_thread_lock() for thread-safe caching of the hook manager.
Scope
| Function |
Lines |
Callers |
log_hooks() |
40-56 |
1 |
run_post_build_hooks() |
67-91 |
1 |
run_post_bootstrap_hooks() |
94-118 |
1 |
run_prebuilt_wheel_hooks() |
121-141 |
1 |
_get_hooks() (private) |
23-37 |
3 (internal) |
Acceptance Criteria
Description
src/fromager/hooks.pyhas 28% unit test coverage with no dedicated unit test file (97% combined coverage including e2e tests). Hooks are the primary extension mechanism, using stevedore for plugin discovery.The three
run_*_hooks()functions have no error handling - exceptions from plugins propagate unpredictably to callers. Error handling varies by call site:bootstrapper.pywraps its call in try/except, butbuild.pydoes not._get_hooks()uses@with_thread_lock()for thread-safe caching of the hook manager.Scope
log_hooks()run_post_build_hooks()run_post_bootstrap_hooks()run_prebuilt_wheel_hooks()_get_hooks()(private)Acceptance Criteria
_get_hooks()- test stevedore manager creation and caching behaviorrun_post_build_hooks()- test with mocked hooks, verify correct arguments are passedlog_hooks()- test logging output for loaded plugins