Skip to content

Remove redundant JobDefinitionRecord - #229

Closed
viceroypenguin wants to merge 2 commits into
mainfrom
codex/unify-job-definition
Closed

viceroypenguin wants to merge 2 commits into
mainfrom
codex/unify-job-definition

Conversation

@viceroypenguin

@viceroypenguin viceroypenguin commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

JobDefinition and JobDefinitionRecord duplicated the same configuration and required startup to copy every field between them. Remove JobDefinitionRecord and use JobDefinition across scheduling, storage, monitoring, testing, and the dashboard client. Startup now registers definitions directly.

Queue settings live solely on Queue: consumers use its Name, Priority, and Concurrency, with no corresponding aliases on JobDefinition. Dashboard payloads and newly written Redis metadata use a nested queue object. SQL storage keeps the existing column mappings, and Redis readers and Lua scripts support previously stored flat metadata. Local invoker and CLR type bindings are optional and excluded from serialization, along with computed acquisition limits.

Validation:

  • Functional and storage projects build on .NET 8, 10, and 11 with warnings treated as errors; zero warnings or errors.
  • 155 functional tests pass on each framework.
  • 658 storage tests pass on each framework, covering SQLite with EF Core and LinqToDB, in-memory and capturing storage, live Redis, serialization, and conformance infrastructure. Regression coverage includes acquiring jobs from old Redis metadata and updating the catalogue to nested queue settings.
  • Dashboard lint, type checks, all 61 client tests, production build, and bundle size check pass.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a00625a3-2915-4e76-886f-44f2176e90e3
📥 Commits

Reviewing files that changed from the base of the PR and between 5f22a8e and 0e2ee1f.

📒 Files selected for processing: 38
  • docs/architecture.md
  • src/Immediate.Jobs.Dashboard/DashboardClient/src/components/JobDetail.vue
  • src/Immediate.Jobs.Dashboard/DashboardClient/src/contracts.ts
  • src/Immediate.Jobs.Dashboard/DashboardClient/src/query.ts
  • src/Immediate.Jobs.Dashboard/DashboardJsonSerializerContext.cs
  • src/Immediate.Jobs.EntityFrameworkCore/EntityFrameworkCoreJobStorage.DefinitionCatalog.cs
  • src/Immediate.Jobs.LinqToDB/LinqToDBJobStorage.DefinitionCatalog.cs
  • src/Immediate.Jobs.Redis/RedisJobStorage.Acquire.cs
  • src/Immediate.Jobs.Redis/RedisJobStorage.DefinitionCatalog.cs
  • src/Immediate.Jobs.Redis/RedisJobStorage.Definitions.cs
  • src/Immediate.Jobs.Redis/RedisJobStorage.Records.cs
  • src/Immediate.Jobs.Redis/RedisJsonSerializerContext.cs
  • src/Immediate.Jobs.Shared/Apis/JobDefinitionRecord.cs
  • src/Immediate.Jobs.Shared/Apis/JobMonitoringDefinitions.cs
  • src/Immediate.Jobs.Shared/Internals/JobDefinition.cs
  • src/Immediate.Jobs.Shared/Internals/JobSchedulingService.cs
  • src/Immediate.Jobs.Shared/Storage/IJobStorage.cs
  • src/Immediate.Jobs.Shared/Storage/InMemoryJobStorage.DefinitionCatalog.cs
  • src/Immediate.Jobs.Shared/Storage/InMemoryJobStorage.Definitions.cs
  • src/Immediate.Jobs.Shared/Storage/InMemoryJobStorage.Enqueue.cs
  • src/Immediate.Jobs.Shared/Storage/JobDefinitionReconciliation.cs
  • src/Immediate.Jobs.Shared/Storage/JobDefinitionRegistration.cs
  • src/Immediate.Jobs.Shared/Storage/SingleServerJobStorage.DefinitionCatalog.cs
  • src/Immediate.Jobs.Testing/CapturingJobStorage.cs
  • src/Immediate.Jobs.Testing/JobTestHarness.cs
  • src/Immediate.Jobs.Testing/Storage/DefinitionAcquisitionStorageConformance.cs
  • src/Immediate.Jobs.Testing/Storage/DefinitionCatalogStorageConformance.cs
  • src/Immediate.Jobs.Testing/Storage/DefinitionRemovalStorageConformance.cs
  • src/Immediate.Jobs.Testing/Storage/MonitoringStorageConformance.cs
  • src/Immediate.Jobs.Testing/Storage/RecurringStorageConformance.cs
  • src/Immediate.Jobs.Testing/Storage/ReplicaStorageConformance.Enqueue.cs
  • src/Immediate.Jobs.Testing/Storage/ReplicaStorageConformance.cs
  • src/Immediate.Jobs.Testing/Storage/TagStorageConformance.cs
  • tests/Immediate.Jobs.FunctionalTests/DefinitionAcquisitionTests.cs
  • tests/Immediate.Jobs.FunctionalTests/Packages/DashboardPackageTests.cs
  • tests/Immediate.Jobs.FunctionalTests/StorageCapabilityTests.cs
  • tests/Immediate.Jobs.StorageTests/JobDefinitionSerializationTests.cs
  • tests/Immediate.Jobs.StorageTests/RedisConformanceTests.cs
💤 Files with no reviewable changes: 1
  • src/Immediate.Jobs.Shared/Apis/JobDefinitionRecord.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

JobDefinition now serves as the shared definition type for execution, storage, and monitoring. Queue settings serialize as flat fields, while runtime bindings and computed acquisition limits are excluded. Storage and dashboard contracts use the updated type, and execution checks for a missing invoker.

Changes: Shared job definition

Layer / File(s) Summary
Definition model and JSON shape
src/Immediate.Jobs.Shared/Internals/JobDefinition.cs, src/Immediate.Jobs.Shared/Apis/JobDefinitionRecord.cs, tests/Immediate.Jobs.StorageTests/JobDefinitionSerializationTests.cs, docs/architecture.md
JobDefinition replaces the removed JobDefinitionRecord. Queue settings use flat JSON fields, while runtime bindings and computed acquisition limits are omitted. Serialization tests cover round trips and existing flat metadata.
Scheduling and storage migration
src/Immediate.Jobs.Shared/Storage/*, src/Immediate.Jobs.Shared/Internals/JobSchedulingService.cs, src/Immediate.Jobs.EntityFrameworkCore/EntityFrameworkCoreJobStorage.DefinitionCatalog.cs, src/Immediate.Jobs.LinqToDB/LinqToDBJobStorage.DefinitionCatalog.cs, src/Immediate.Jobs.Redis/RedisJobStorage.*, src/Immediate.Jobs.Testing/*Storage*, src/Immediate.Jobs.Testing/JobTestHarness.cs, tests/Immediate.Jobs.FunctionalTests/*, tests/Immediate.Jobs.StorageTests/RedisConformanceTests.cs
Storage interfaces, in-memory storage, and EF Core, LinqToDB, and Redis implementations now use JobDefinition. Scheduling passes definitions directly to storage. Execution paths throw InvalidOperationException with the job name when the invoker is missing. Related storage tests and test doubles use the updated type.
Monitoring and dashboard contracts
src/Immediate.Jobs.Shared/Apis/JobMonitoringDefinitions.cs, src/Immediate.Jobs.Dashboard/DashboardJsonSerializerContext.cs, src/Immediate.Jobs.Dashboard/DashboardClient/src/contracts.ts, src/Immediate.Jobs.Dashboard/DashboardClient/src/query.ts, src/Immediate.Jobs.Dashboard/DashboardClient/src/components/JobDetail.vue, tests/Immediate.Jobs.FunctionalTests/Packages/DashboardPackageTests.cs
Monitoring and dashboard contracts use JobDefinition. The dashboard API test checks for queueName and verifies that queue, invoker, jobType, and acquisitionLimits are absent.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Suggested reviewers: dukesteen

Merge Risk: ⚪ Minimal · up to 0e2ee

No actionable merge-blocking issue is established for this change; it is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 72 functions across 35 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title is concise, specific, and accurately describes the primary change: removing the redundant JobDefinitionRecord type.
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 72 functions across 35 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 2
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@viceroypenguin
viceroypenguin deleted the codex/unify-job-definition branch October 16, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant