about summary refs log tree commit diff
path: root/test/python/server_test_case.py
diff options
context:
space:
mode:
authorAlexander_Kabui <alexanderkabui@proton.me>2026-10-13 23:36:39 +0300
committerAlexander_Kabui <alexanderkabui@proton.me>2026-10-14 07:28:51 +0300
commit22ff53e2d65e47df27d76aa7420a146074c00282 (patch)
tree07f550107ebb9501b1fa79e8e8d6b2d48210572d /test/python/server_test_case.py
parenta188b75157516c5e00dd130d9ca8dfbd6cf36679 (diff)
downloadgenenetwork4-22ff53e2d65e47df27d76aa7420a146074c00282.tar.gz
config: GN4_DB_MODE (mariadb optional on dev) + no-DB hardening
* src/config.rs (DbMode, Config.db_mode, parse_db_mode): add
GN4_DB_MODE=dev|production in the layered config; dev runs with no
configured DB; fail-closed parse (a typo refuses).
* src/db.rs (DbError, pool, probe), src/error.rs (ApiError::from_db):
mint a typed 503 db_unavailable at the db::pool() choke point,
distinguishing Unavailable from Query.
* src/main.rs: loud no-DB startup line; production refuses to start
(exit non-zero) before axum::serve.
* src/routes/{accessions,datasets,groups,mapping_methods,publications,species,traits}.rs:
route every DB error through ApiError::from_db.
* src/bin/gn-indexer.rs: refuse to build an index when the DB is unreachable.
* tests/no_db.rs: pin no-DB degradation (search 200 partial, DB routes 503).

His ask (DM 2026-10-12): "Make it an option to switch it off for
development machines? I mean mariadb." The no-DB hardening is ours
(review-driven). Default GN4_DB_MODE left unflipped (=dev); the flip needs
owner sign-off.
Diffstat (limited to 'test/python/server_test_case.py')
0 files changed, 0 insertions, 0 deletions