Skip to content

Refactor imports, enhance performance, and add pagination features#33

Merged
kbtale merged 8 commits into
mainfrom
dev/fixes
May 10, 2026
Merged

Refactor imports, enhance performance, and add pagination features#33
kbtale merged 8 commits into
mainfrom
dev/fixes

Conversation

@kbtale

@kbtale kbtale commented May 10, 2026

Copy link
Copy Markdown
Member

No description provided.

kbtale added 8 commits May 9, 2026 23:51
Move 'import time' and 'get_all_subnets/get_all_interfaces/get_all_routes'
to the top-level import block. Remove the duplicate mid-file import block
that repeated ingest_live_data, get_devices_sorted_by_ip, etc.
- PRAGMA journal_mode=WAL in init_db() for concurrent reads and better write perf
- upsert_canonical_asset now returns the asset ID, eliminating a redundant
  get_db_connection() call inside ingest_canonical_assets' inner loop
… I/O

load_config was called 2-3 times per discovery run, each time opening
and parsing data/config.json. Now caches the result in memory.
- Scan view: [ ] keys for page up/down, page info shown in header
- Inventory view: [ ] keys for page up/down, auto-scroll 20 at a time
- Selection auto-advances to next page when reaching boundary
- Footer hints updated with new key bindings
The test was patching _icmp_ping which is no longer called since the
raw-socket refactor.  IcmpScanner.batch_ping was running 254 real
subprocess pings on CI, hitting the 2000s test timeout.
Now mocks batch_ping with instant responses — test completes in <0.1s.
- test_entrypoint_wiring: tomllib is 3.11+ only; replaced with regex
  approach that works on all Python versions
- test_scanner_arp_first: mock IcmpScanner.batch_ping to avoid 1152
  real TCP fallback connections hitting concurrent.futures timeout
tomllib is stdlib-only from Python 3.11 onwards.
Add tomli>=2.0 as conditional dep for python_version < 3.11.
Restore proper TOML parsing in test_entrypoint_wiring
with try/except ModuleNotFoundError fallback.
…e host

batch_ping returning empty made seeded_count >= responsive_count,
triggering 1152 real TCP connections on CI. One extra alive host
makes the condition false, skipping the slow fallback path.
@kbtale kbtale merged commit b93fc92 into main May 10, 2026
12 checks passed
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