Add job dependencies (dependsOn) across Postgres, Redis, demo, and docs#40
Merged
Conversation
- Introduced a new SQL migration to add `depends_on_job_ids` and `depends_on_tags` columns to the `job_queue` table, along with an index for efficient querying. - Implemented job dependency management in the backend, allowing jobs to specify prerequisites that must be completed before execution. - Enhanced the `JobOptions` and `JobRecord` interfaces to include fields for job dependencies. - Added utility functions for normalizing and resolving job dependencies, ensuring robust handling of prerequisite jobs. - Developed comprehensive tests for the new job dependency features, validating their functionality and integration. These changes significantly enhance the job management capabilities of DataQueue, enabling more complex workflows and dependencies.
- Introduced a new feature for job dependencies, allowing jobs to specify prerequisites using `dependsOn.jobIds` and `dependsOn.tags`. - Implemented a `DependencyDemo` component to showcase job dependency functionality, including linear chains and tag-drain barriers. - Updated the `AddJobForm` to include a new job type for dependencies and enhanced the `JobMonitor` to display dependency information. - Created comprehensive documentation on job dependencies, including usage examples and integration details. - Updated the sidebar and comparison sections to reflect the new job dependencies feature. These changes significantly enhance the job management capabilities of DataQueue, enabling more complex workflows and dependencies.
✅ Deploy Preview for dataqueue-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for docsdataqueuedev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- Introduced a new endpoint for batch job insertion at `/api/jobs/batch`, allowing multiple jobs to be added simultaneously with support for job dependencies using `dependsOn.jobIds` and `dependsOn.tags`. - Updated the existing job creation endpoint to include the `dependsOn` field in the job options. - Enhanced helper functions to support batch job addition and job dependency management. - Added comprehensive end-to-end tests to validate the functionality of job dependencies and batch processing. These changes significantly enhance the job management capabilities of DataQueue, enabling more complex workflows and efficient job handling.
- Updated the batch job processing endpoint to utilize a mapped array of job options, enhancing type safety with `JobOptions` and `JobType`. - Improved code readability by separating the mapping logic from the job addition call. - Ensured compatibility with the existing job dependency features introduced in previous commits. These changes streamline the job addition process and maintain consistency with the recent enhancements in job management capabilities.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #40 +/- ##
==========================================
- Coverage 81.28% 80.18% -1.11%
==========================================
Files 37 39 +2
Lines 7011 7515 +504
Branches 908 987 +79
==========================================
+ Hits 5699 6026 +327
- Misses 1292 1463 +171
- Partials 20 26 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 optional job prerequisites via
dependsOn: wait for listed jobs to complete and/or for tag-based “drain” barriers. Implements persistence and scheduling in PostgreSQL and Redis, exposes types and helpers (including batch references foraddJobs), and documents the feature with a demo and API/usage pages.Important changes
dependsOnon job options:jobIds(all must complete) andtags(active barrier until no matching in-flight work)batchDepRef/ resolution for dependencies inside the sameaddJobsbatchOther changes
job-dependenciesusage page, API cross-links,llms.txt/llms-full.txtupdates@nicnocquee/reacttypes extended where neededHow to test
dependsOn.jobIdsanddependsOn.tagsvia the library or demo; verify a dependent stays pending until prerequisites complete, and that failure/cancel of a prerequisite cancels pending dependents as documented.apps/docs/content/docs/usage/job-dependencies.mdxand linked API pages; confirm examples and behavior descriptions match the implementation.