mirror of
https://github.com/usestrix/strix.git
synced 2026-08-22 19:09:37 +02:00
refactor: reorganize core report and tui modules
This commit is contained in:
@@ -41,9 +41,9 @@ from strix.interface.utils import (
|
||||
rewrite_localhost_targets,
|
||||
validate_config_file,
|
||||
)
|
||||
from strix.report.state import get_global_report_state
|
||||
from strix.telemetry import posthog
|
||||
from strix.telemetry.logging import configure_dependency_logging
|
||||
from strix.telemetry.scan_store import get_global_scan_store
|
||||
|
||||
|
||||
HOST_GATEWAY_HOSTNAME = "host.docker.internal"
|
||||
@@ -53,7 +53,7 @@ import logging # noqa: E402
|
||||
|
||||
|
||||
# Per-scan logging is set up by ``setup_scan_logging`` from inside
|
||||
# ``orchestration.runner.run_strix_scan`` once the scan ``run_dir`` is
|
||||
# ``core.runner.run_strix_scan`` once the scan ``run_dir`` is
|
||||
# known — that's where ``strix.*`` levels and handlers are owned. Pre-scan
|
||||
# work (``main()``, env validation, image pull) emits via the module
|
||||
# logger; once setup_scan_logging runs, those records start landing in
|
||||
@@ -558,7 +558,7 @@ def _load_resume_state(args: argparse.Namespace, parser: argparse.ArgumentParser
|
||||
|
||||
def display_completion_message(args: argparse.Namespace, results_path: Path) -> None:
|
||||
console = Console()
|
||||
scan_store = get_global_scan_store()
|
||||
scan_store = get_global_report_state()
|
||||
|
||||
scan_completed = False
|
||||
if scan_store and scan_store.scan_results:
|
||||
@@ -765,7 +765,7 @@ def main() -> None:
|
||||
posthog.error("unhandled_exception", str(e))
|
||||
raise
|
||||
finally:
|
||||
scan_store = get_global_scan_store()
|
||||
scan_store = get_global_report_state()
|
||||
if scan_store:
|
||||
posthog.end(scan_store, exit_reason=exit_reason)
|
||||
|
||||
@@ -773,7 +773,7 @@ def main() -> None:
|
||||
display_completion_message(args, results_path)
|
||||
|
||||
if args.non_interactive:
|
||||
scan_store = get_global_scan_store()
|
||||
scan_store = get_global_report_state()
|
||||
if scan_store and scan_store.vulnerability_reports:
|
||||
sys.exit(2)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user