fix(ingest): skip known KEV/FIRMS rows; CI skips unchanged images

CISA KEV republished 1685 NIST URLs every 5 min; FIRMS re-inserted
~325k global hotspots every 15 min. Producer now skips URLs already
in event_dedup and FIRMS CSVs that are unchanged (delta-only persist).

CI rebuilds only images whose paths changed and never pulls/rebuilds
Timescale or bounces osint-db unless Dockerfile.pg changes.
This commit is contained in:
Sirius DevOps 2026-08-29 19:32:00 -04:00
commit 5651d251d0
No known key found for this signature in database
9 changed files with 438 additions and 94 deletions

View file

@ -22,7 +22,11 @@ def test_firms_and_rss_caches_are_ttlcache():
def test_ingest_fires_hits_http_once_within_ttl(monkeypatch):
from fire_sources import _csv_digest, _seen_ids
firms_cache.clear()
_csv_digest.clear()
_seen_ids.clear()
monkeypatch.setenv("FIRMS_MAP_KEY", "k" * 32)
monkeypatch.setenv("FIRMS_DATASETS", "VIIRS_NOAA20_NRT")
# fire_sources already imported FIRMS_DATASETS — patch the module attr
@ -58,7 +62,7 @@ def test_ingest_fires_hits_http_once_within_ttl(monkeypatch):
monkeypatch.setattr("fire_sources.persist_hotspots", fake_publish)
assert asyncio.run(ingest_fires()) == 5
assert asyncio.run(ingest_fires()) == 5
assert asyncio.run(ingest_fires()) == 0
assert hits["n"] == 1