middleware-manager/util
hhftechnologies 9d0b772458
Some checks are pending
Build and Push Docker Image / build-and-push (push) Waiting to run
Tests / Run Tests (push) Waiting to run
Tests / Lint (push) Waiting to run
Tests / Build (push) Blocked by required conditions
Improve error handling, tests, and defaults
Add robust error checks and helpers, improve transaction safety, and refine default templates handling.

- Add api/handlers/test_helpers_test.go with mustUnmarshalResponse and mustScan helpers and update many handler tests to use them or to check json.Unmarshal errors to fail fast.
- Replace direct DB Scan calls in tests with mustScan or explicit error checks to surface query failures.
- Improve transaction rollback handling across codepaths (config handlers, database migrations, transaction utils, CertGenerator) to log rollback errors and avoid silent failures.
- Make WithTransaction/WithTimeoutTransaction/BatchTransaction formatting consistent and add panic-safe rollback logging.
- In main, log a warning instead of ignoring EnsureDefaultDataSources errors.
- Add/cleanup various helper blank assignments and small refactors in services (config_proxy, config_generator) and switch tests to shared response writers (writeJSONResponse/writeResponseBody) where applicable.
- Large cleanup and enhancements in config/defaults.go to preserve string formatting for YAML templates, ensure special fields are quoted/preserved, and tidy whitespace/formatting.

These changes improve test reliability, make DB/tx failures more visible, and ensure default template YAML preserves important string values.
2026-04-15 20:00:48 +05:30
..
id_normalizer.go Improve error handling, tests, and defaults 2026-04-15 20:00:48 +05:30
id_normalizer_test.go harden HTTP usage, caching, and transactional deletes 2026-03-01 14:22:02 +05:30