Repository navigation
fix(infra): infrastructure scripts stop depending on the caller's PYTHONPATH, one guard for the class, and one monitoring launcher (#18288, #17906) - #18292
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
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. Comment |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
|
Merger review at 995d41b: BLOCKED. Two must-fix items, then two guard tightenings. These check out:
Unverified: whether |
Thinking Path
#18288: infrastructure scripts imported backend internals (
utils.*and others) and resolved them only when the caller's PYTHONPATH already held the backend. Run standalone, they failed. The owner asked for the fix as soon as possible. Two of the ten scripts are edited by open #18230 (same-file rule), so they follow on this branch after it merges. Two others share files with the unfinished local branch for #17906 (merging the two monitoring launchers), so that work rides here too.A class guard written for this PR found the problem is 104 modules, not 10. The 94 not audited here are frozen in its allowlist and filed as #18289.
What Changed
c3f84fef8d,f7cac37817,995d41ba54(refactor(infrastructure): consolidate the two near-duplicate monitoring launchers into one #17906): one monitoring launcher.start_monitoring.py --backend hardwarereplacesstart_hardware_monitoring.py, which is removed: a full-repo grep found no caller. Backend selection lives in a siblingmonitoring/monitoring_backends.py, which keeps the launcher at 532 lines. The monitoring floors drop to 1 in the same commit. Cherry-picked onto currentmain;mainhas changed none of its files since.05aa29e638(infra: ten infrastructure scripts import backend internals and fail standalone — one guard for the class #18288): each script is decided as one of three: shared code moved toautobot_shared, a backend tool, or dead. All seven came out as backend tools, and each now putsautobot-backendand the repo root on its own path.python -Iimport beforeperformance_dashboard.pyNo module named 'utils'monitoring_system, which needs the backend'sconfigandconstantsvalidation_dashboard_generator.pyNo module named 'project_state_tracker'phase_validation.ymltest_phase5_cleanup.pytest_long_running_operations.pyNo module named 'autobot_shared'apply_memory_optimizations.pyNo module named 'utils'utils.memory_optimizationneedspsutil, whichautobot_shareddoes not declareanalysis/test_service_registry.pymonitoring/start_monitoring.py+monitoring_backends.pyNo module named 'autobot_shared'All of them now return 0 on a clean import.
repo_tests/infra_scripts_no_backend_imports_18288_test.py+infra_backend_imports_allowlist_18288.py):.pyunderautobot-infrastructure/, function bodies included.autobot-backend's top level, minus the standard library and root-provided names. There is no hand list.infra-backend-import-scan. There are 8 contrast fixtures.repo_tests/infra_monitoring_import_path_15643_test.pynow also accepts a sibling<name>.pymodule as a resolvable import, not only a package directory. Review this widening.Behaviour changes
start_hardware_monitoring.pyis gone. Anyone invoking it by hand on a host switches tostart_monitoring.py --backend hardware.test_long_running_operations.pynow really loads the framework instead of always reporting it unavailable.Verification
apply_memory_optimizations,validation_dashboard_generator): 6.reach_scope_claim_17844alone 10, guard-reach meta 23,reach_declarations411, symbol-fork 17, size ratchet 31, ceiling parity 11.Not done, stated rather than implied
verify_knowledge_consistency.pyandanalysis/npu_performance_measurement.pyare added to this branch after fix(knowledge): one active embedding model resolver, model-aware cache keys, and search refuses rather than embed in another space (#18143, #18185) #18230 merges.monitor_services.pyallowlist entry.So this PR is Refs #18288, and Closes #17906.
Closes #17906
Refs #18288
Model Used
Claude Opus 5.5 (master session: brief, review of the report, PR). Implementation by a Claude Opus subagent.
🤖 Generated with Claude Code