feat: add singleton-row scheduler_config model#66
Merged
Conversation
…settings Introduces SchedulerConfig (Trax.Effect) and PersistentSchedulerConfig (Trax.Effect.Data) to hold the dashboard-editable subset of SchedulerConfiguration / LocalWorkerOptions / MetadataCleanupConfiguration in a single-row table (id always 1, enforced by CHECK constraint). Postgres migration 034 and Sqlite migration 002 create the table; the table is consumed by the IOperationsService persistence layer in Trax.Scheduler and exposed through the operations.config GraphQL surface in Trax.Api so React and Blazor dashboards see the same values.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Adds round-trip tests in both InMemoryProviderTests and SqliteProviderTests that exercise every column on the SchedulerConfig model through Save/Load via EF, plus a nullable-columns variant and an update-existing-row variant for Sqlite. SqliteMigrationTests gets scheduler_config in ExpectedTables so a missing-table regression is caught at build time. The tests use DbSet.Add directly rather than IDataContext.Track because Track infers Added vs Modified from `Id > 0`, which would misclassify the singleton (Id always = 1) as an update on first persist. Each test deletes any prior row first since the fixture's DB is shared across tests.
|
This PR is included in version 1.34.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a singleton-row `scheduler_config` table that persists the dashboard-editable subset of `SchedulerConfiguration`, `LocalWorkerOptions`, and `MetadataCleanupConfiguration`. Settings written through this table survive app restarts and are re-applied to the in-memory `SchedulerConfiguration` singleton at startup by a hosted service in Trax.Scheduler.
The table is intentionally a singleton (id always = 1, enforced by a CHECK constraint) since there is exactly one runtime configuration per deployment.
Files
Coordinated changes
This PR is the foundation. Consumers in:
Merge order: this PR first.
Test plan