feat(climate): add climate disasters seed + ListClimateDisasters RPC …#2535
feat(climate): add climate disasters seed + ListClimateDisasters RPC …#2535
Conversation
…with snake_case Redis payload
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Greptile SummaryThis PR introduces end-to-end climate disaster ingestion: a new Railway seed script (
Confidence Score: 5/5Safe to merge; all findings are P2 quality/observability improvements that do not block the primary data path. No P0 or P1 issues found. The three P2 findings are: a monitoring gap in MCP staleness tracking (doesn't break serving), hardcoded zero for ReliefWeb affected population (data enrichment gap, not a correctness failure), and Null Island placement for uncoded multi-country events (edge-case data quality). All core logic — seeder resilience, handler pagination, Redis shape, health wiring, and test coverage — is sound and follows established project patterns. api/mcp.ts (staleness threshold mismatch), scripts/seed-climate-disasters.mjs (affectedPopulation and Null Island coordinate issues) Important Files Changed
Sequence DiagramsequenceDiagram
participant Cron as Railway Cron 6h
participant Seed as seed-climate-disasters.mjs
participant RW as ReliefWeb API
participant NatCache as Redis natural:events:v1
participant Redis as Redis climate:disasters:v1
participant Handler as ListClimateDisasters Handler
participant Client as API Client
Cron->>Seed: trigger
Seed->>RW: POST /v1/disasters types FL TC DR HT WF
RW-->>Seed: disaster rows
Seed->>NatCache: getCachedJson natural:events:v1
NatCache-->>Seed: events array
Seed->>Seed: filter GDACS and FIRMS then dedup sort slice 300
Seed->>Redis: SET climate:disasters:v1 TTL 21600s
Seed->>Redis: SET seed-meta:climate:disasters
Client->>Handler: GET /api/climate/v1/list-climate-disasters
Handler->>Redis: getCachedJson climate:disasters:v1
Redis-->>Handler: disasters array
Handler->>Handler: normalise and paginate
Handler-->>Client: disasters with pagination
|
|
Merged by mistake ! will revert & review @FayezBast |
|
Pls resubmit this PR @FayezBast |
Summary
Adds climate disaster ingestion and API exposure for the climate domain.
scripts/seed-climate-disasters.mjsFL,TC,DR,HT,WF; statusalert/current/ongoing)natural:events:v1(GDACS + NASA FIRMS only; no GDACS re-seeding)climate:disasters:v121600(6h)id, type, name, country, country_code, lat, lng, severity, started_at, status, affected_population, source, source_urlClimateDisasterListClimateDisastersOperational note:
RELIEFWEB_APPNAMEmust be set (approved value) on Railway forseed-climate-disasters.I cannot set Railway secrets from this code PR directly.
Type of change
Affected areas
/api/*)Checklist