Commit Graph

4 Commits

Author SHA1 Message Date
Elie Habib
6ec076c8d3 test(circuit-breakers): harden regression tests with try/finally and existence guards (#911)
- Wrap all 4 behavioral it() blocks in try/finally so clearAllCircuitBreakers()
  always runs on assertion failure (P2 — leaked breaker state between tests)
- Add assert.ok(fnStart !== -1) guards for fetchHapiSummary, fetchPositiveGdeltArticles,
  and fetchGdeltArticles so renames produce a clear diagnostic (P2 — silent false-positives)
- Fix misleading comment in seed-wb-indicators.mjs: WLD/EAS are 3-char codes and
  aren't filtered by iso3.length !== 3 (P3)
- Add timeout-minutes: 10 and permissions: contents: read to seed GHA workflow (P3)
2026-03-03 15:13:29 +04:00
Elie Habib
a5b2af8e11 feat(tech-readiness): bootstrap hydration via Railway seed + bootstrap key (#889)
* feat(tech-readiness): bootstrap hydration via Railway seed + bootstrap key

Add pre-computed TechReadiness rankings to the bootstrap payload so the
panel renders immediately on first load instead of waiting for 4 slow
World Bank RPC calls (which can trip circuit breakers on cold starts,
causing persistent "No data available" until the 5-min cooldown expires).

- scripts/seed-wb-indicators.mjs: new Railway seed script that fetches
  IT.NET.USER.ZS / IT.CEL.SETS.P2 / IT.NET.BBND.P2 / GB.XPD.RSDV.GD.ZS
  for all countries, computes rankings (same weights as the frontend
  getTechReadinessRankings), and writes economic:worldbank-techreadiness:v1
  to Redis with a 7-day TTL
- api/bootstrap.js: register techReadiness key in BOOTSTRAP_CACHE_KEYS
  and SLOW_KEYS (s-maxage=3600, appropriate for annual WB data)
- src/services/economic/index.ts: fast-path in getTechReadinessRankings()
  returns getHydratedData('techReadiness') immediately on first page load;
  country-specific comparison requests still use live RPCs

* ci: add weekly GHA workflow for WB tech readiness seed
2026-03-03 13:30:42 +04:00
Elie Habib
3dadf74ded test(circuit-breakers): harden HAPI/GDELT regression tests (P2 fixes) (#886) 2026-03-03 11:45:48 +04:00
Elie Habib
dba8b18aad fix(circuit-breakers): per-instance breakers for HAPI (20 countries) and GDELT (#879)
* fix(tech-readiness): per-indicator circuit breakers for World Bank RPC

* test(tech-readiness): regression tests for per-indicator circuit breakers

* fix(circuit-breakers): per-instance breakers for HAPI and GDELT

* test(circuit-breakers): regression tests for HAPI per-country and GDELT split breakers
2026-03-03 10:52:43 +04:00