feat(#3299): runtime configuration engine with Zod validation#3521
Conversation
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3521 +/- ##
==========================================
+ Coverage 53.63% 53.71% +0.07%
==========================================
Files 2260 2264 +4
Lines 85976 86227 +251
Branches 24147 24183 +36
==========================================
+ Hits 46117 46320 +203
- Misses 39687 39735 +48
Partials 172 172
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
🤖 Finished Review · ✅ Success · Started 3:30 AM UTC · Completed 3:48 AM UTC |
ReviewFindingsMedium
Low
Info
Previous runReviewFindingsMedium
Low
Info
Previous run (2)ReviewFindingsHigh
Medium
Low
Info
Previous run (3)ReviewFindingsHigh
Medium
Low
Info
Previous run (4)ReviewReason: stale-head The review agent reviewed commit Previous run (5)ReviewFindingsHigh
Medium
Low / Info
Previous run (6)ReviewFindingsHigh
Medium
Low / Info
|
174a46e to
6f9de3c
Compare
|
🤖 Finished Review · ✅ Success · Started 1:25 PM UTC · Completed 1:36 PM UTC |
6f9de3c to
6061960
Compare
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
|
🤖 Finished Review · ✅ Success · Started 6:09 PM UTC · Completed 6:22 PM UTC |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 6:24 PM UTC · Completed 6:43 PM UTC |
4ad38b4 to
d12c7c7
Compare
|
🤖 Finished Review · ✅ Success · Started 11:47 PM UTC · Completed 12:02 AM UTC |
Implements the runtime configuration engine for boost-backend: - RuntimeConfigResolver: two-layer config resolution (DB override → YAML baseline) with cacheService (30s TTL, immediate invalidation on write). Single cache layer, no duplicate wrappers. - AdminConfigService: DB-backed config overrides using the boost_admin_config table. Validates all writes against Zod schemas and enforces configScope (yaml-only fields rejected for DB writes). - Zod schemas as single source of truth: all 15 admin-configurable fields defined with schema, configScope annotation (yaml-only, db-overridable, db-only), and descriptions. config.d.ts generated from the same schema definitions. - Credential encryption: AES-256-GCM encryption for sensitive DB-stored values (e.g., DevSpaces credentials) with configurable encryption secret. - Schema version tracking: stores schema version alongside DB values. On startup, re-validates all stored values against current schemas and removes invalid overrides (restoring YAML baseline). - Plugin wired with coreServices.cache and coreServices.database dependencies, satisfying the cache-from-day-one architecture rule. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add boost.admin permission check to /config/status endpoint - Redact sensitive fields in /config/status response - Return generic error message, log details server-side - Exclude sensitive fields from effective-config cache - Fetch sensitive fields fresh from DB on cache hit - Replace SELECT-then-INSERT/UPDATE with atomic onConflict().merge() - Return undefined + log warning when encryptionSecret missing on read - Clear cached knexPromise on rejection for retry - Add encryptionSecret to config.d.ts with @visibility secret - Replace require('crypto') with ES import for createHash - Fix misleading codegen comment in config.d.ts - Add upsert-update test case Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: gabemontero <gmontero@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Guard isSensitiveField against unknown DB keys (nil-deref) - Wrap JSON.parse in try/catch in getOverride/getAllOverrides - Warn at startup when encrypted DB values exist without encryptionSecret Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove encryptValue/decryptValue from public exports (internal only) - Mark encryptionSecret, set(), remove() as @internal - Auto-delete corrupt JSON rows in getOverride - Handle decryption failures from rotated secrets gracefully - Use knex.fn.now() for DB timestamps instead of client-side Date - Add tests for corrupt JSON and rotated-secret error paths Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: gabemontero <gmontero@redhat.com>
d12c7c7 to
5f91eb5
Compare
|
🤖 Finished Review · ✅ Success · Started 12:07 AM UTC · Completed 12:23 AM UTC |
- validateStoredValues: separate decryption errors from validation errors. Rows that fail decryption (rotated secret) are kept intact with a warning instead of being deleted. Only rows that fail Zod schema validation after successful decryption are removed. - Add httpRouter.addAuthPolicy for /config/status endpoint to match the pattern used by all other endpoints in the codebase. - Add tests for both new behaviors (2 new test cases, 79 total). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: gabemontero <gmontero@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 12:30 AM UTC · Completed 12:47 AM UTC |
|



Implements the runtime configuration engine for boost-backend:
RuntimeConfigResolver: two-layer config resolution (DB override →
YAML baseline) with cacheService (30s TTL, immediate invalidation
on write). Single cache layer, no duplicate wrappers.
AdminConfigService: DB-backed config overrides using the
boost_admin_config table. Validates all writes against Zod schemas
and enforces configScope (yaml-only fields rejected for DB writes).
Zod schemas as single source of truth: all 15 admin-configurable
fields defined with schema, configScope annotation (yaml-only,
db-overridable, db-only), and descriptions. config.d.ts generated
from the same schema definitions.
Credential encryption: AES-256-GCM encryption for sensitive
DB-stored values (e.g., DevSpaces credentials) with configurable
encryption secret.
Schema version tracking: stores schema version alongside DB values.
On startup, re-validates all stored values against current schemas
and removes invalid overrides (restoring YAML baseline).
Plugin wired with coreServices.cache and coreServices.database
dependencies, satisfying the cache-from-day-one architecture rule.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Closes #3299
Post-script verification
feat/3299-runtime-config-engine)2e647e201781a7b120cb2e71fab2e8740be418e9..HEAD)