(feat): Jobs harness - #20
Open
WhitWaldo wants to merge 1 commit into
Open
Conversation
Signed-off-by: Whit Waldo <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Two moderate API request issues remain in src/JobsHarness.ts.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a public JobsHarness for managing Dapr Jobs through HTTP.
Changes:
- Adds job scheduling, retrieval, deletion, and error handling.
- Adds lifecycle and integration tests.
- Exports
JobsHarnesspublicly.
File summaries
| File | Summary |
|---|---|
src/JobsHarness.ts |
Implements the Jobs harness; two moderate API-encoding issues remain: failurePolicy uses the wrong JSON key, and overwrite must be sent as a query parameter. |
src/JobsHarness.test.ts |
Adds configuration, lifecycle, CRUD, and delivery tests. |
src/index.ts |
Exports the new public API. |
Review details
Suppressed comments (1)
src/JobsHarness.ts:187
overwriteis a query parameter of the Jobs API, not a property of the JSON job definition. With this body-only encoding, the second schedule in the overwrite test is still treated as a conflicting create (or the field is ignored), sooverwrite: truedoes not take effect; append?overwrite=trueto the POST URL and omit this body field.
if (options.overwrite !== undefined) {
body.overwrite = options.overwrite;
}
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| body.overwrite = options.overwrite; | ||
| } | ||
| if (options.failurePolicy !== undefined) { | ||
| body.failure_policy = options.failurePolicy; |
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.
Description
Adding jobs harness
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #[issue number]
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: