feat: add Jobs/Scheduler client API (Alpha1)#771
Open
nelson-parente wants to merge 2 commits intodapr:mainfrom
Open
feat: add Jobs/Scheduler client API (Alpha1)#771nelson-parente wants to merge 2 commits intodapr:mainfrom
nelson-parente wants to merge 2 commits intodapr:mainfrom
Conversation
Add the Jobs building block client for both gRPC and HTTP transports: - schedule() — create or update a scheduled job - get() — retrieve a job definition by name - delete() — delete a job by name All APIs are Alpha1, matching the Go SDK's implementation. Includes unit tests for HTTP transport. Relates to dapr#667. Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
4 tasks
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #771 +/- ##
============================================
- Coverage 100.00% 30.26% -69.74%
============================================
Files 1 140 +139
Lines 6 3853 +3847
Branches 1 605 +604
============================================
+ Hits 6 1166 +1160
- Misses 0 2639 +2639
- Partials 0 48 +48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Remove typeUrl from AnySchema (match other building blocks' pattern) - fromProtoJob: fallback to string not raw Uint8Array on parse failure - fromProtoJob: check value.length to handle empty Uint8Array - parseDurationSeconds: throw on unrecognized format instead of silent 0 - parseDurationSeconds: use matchAll to avoid g-flag lastIndex issues - Duration round-trip: always use seconds format for simplicity Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
Contributor
|
@nelson-parente This is something already in progress by @atrauzzi in #688 - I've sought a status update on that one and will revisit this later should it not be something they're interested in pursuing. |
Contributor
|
Also, regardless, the Jobs API is moving to stable in 1.18, so this should retarget the stable methods/types. |
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
schedule()— create or update a scheduled jobget()— retrieve a job definition by namedelete()— delete a job by namePart 1 of 2 — see #769 (stacked) for the server callback handler.
Implementation Details
Job,ScheduleJobRequest,JobFailurePolicy,JobEventscheduleJobAlpha1/getJobAlpha1/deleteJobAlpha1v1.0-alpha1/jobs/{name}routes (name in URL, not body)JobFailurePolicysupportsdropandconstantretry strategiesdatafield serialized asgoogle.protobuf.Any(JSON)Test plan
tsc --noEmitpasses (zero type errors)Relates to #667.
Signed-off-by: Nelson Parente nelson_parente@live.com.pt