-
Notifications
You must be signed in to change notification settings - Fork 15
Feature/job graph processor #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Subscribe to events by exact correlationId match. Returns an unsubscribe function. Ignores events without correlationId.
Subscribe to events where correlationId starts with a given prefix. Used by job graph processor to receive all events for a graph via prefix like 'graph:g1:'.
…o command handlers Handler-adapter forwards optional PipelineContext as second argument to plugin handlers. PipelineServer.createContext includes eventStore and messageBus. Enables plugins like job-graph-processor to access shared infrastructure. plea: Files must be committed together for coherence
Validates job graphs for: unique IDs, dependency existence, self-references, cycles (DFS), empty targets, and non-empty graphs. Exports Job type used by the rest of the package.
… graph submission Introduces evolve state machine and getReadyJobs query. After GraphSubmitted, getReadyJobs returns jobs with no dependencies.
…succeeds Adds JobDispatched and JobSucceeded event handling to evolve. After a dependency succeeds, getReadyJobs returns its dependents.
…yload error field
…lve events plea: three tests cover three branches of one pure function (null/failure/success)
…policy, completion plea: four tests cover four branches of one orchestration function
…ests plea: Command.data is Record<string,unknown> — single boundary cast in toProcessGraphCommand is required to bridge to ProcessGraphCommand's typed data. No way to narrow Record<string,unknown> to structural types without as.
…eady jobs After registering the correlation listener, loop over dispatched jobs and fire-and-forget sendCommand for each target. This ensures the bus actually executes the work that the graph tracks.
… ready dependent jobs When a predecessor job completes and new jobs become ready, fire-and-forget sendCommand for each newly dispatched target. Completes the dispatch loop so graphs actually execute end-to-end.
…messageBus.sendCommand
createGraphProcessor now takes an optional { dispatch } option. When
provided, commands are dispatched via the callback instead of the raw
messageBus.sendCommand. This allows the pipeline server to route
dispatched commands through processCommand for full tracking.
Add optional third parameter to PipelineContext.sendCommand so callers can dispatch commands with a custom correlationId instead of inheriting the parent context's. Needed by the graph processor to dispatch target commands with per-job correlationIds through processCommand.
…d handler When the pipeline context provides sendCommand, the handler wraps it as the dispatch callback for createGraphProcessor. This routes dispatched target commands through the pipeline server's processCommand path, ensuring they appear in /messages and trigger full pipeline tracking.
Adds Array.isArray check before calling validateGraph to prevent TypeError crash when ProcessJobGraph is re-invoked with event data that lacks the jobs field.
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.
Description
Type of Change
Checklist
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.