feat(schedule): add clean-type overloads for createSchedule and updateSchedule#1070
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (69.38%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
Code Review ✅ Approved 3 resolved / 3 findingsIntroduces clean-type overloads for schedule creation to improve API ergonomics. Nanosecond precision, type validation, and unit test coverage findings have been addressed. ✅ 3 resolved✅ Edge Case: Unsafe (byte[]) cast on memo/searchAttributes can throw
✅ Bug: startTime/endTime conversion truncates to millisecond precision
✅ Quality: No unit tests for new clean-type conversion helpers
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
9c49b7e to
18843c3
Compare
542718a to
161346e
Compare
99a09dd to
1870f36
Compare
…eSchedule Callers can now use ScheduleSpec/ScheduleAction/SchedulePolicies directly instead of constructing raw Thrift gen CreateScheduleRequest/UpdateScheduleRequest. The raw-request overloads remain for callers that need memo or search attributes.
…o/searchAttribute types, add tests - toThriftSpec: use getEpochSecond()*1e9+getNano() instead of toEpochMilli()*1e6 to preserve sub-millisecond precision and avoid overflow - toThriftStartWorkflow: validate memo/searchAttributes map values are byte[] before casting; throw IllegalArgumentException with the offending key name on mismatch - Add ScheduleClientImplTest covering spec, action, policies, and error path conversions
…ce interface ScheduleClientImplTest stubbed service methods with bare T return values, but IWorkflowService now returns CompletableFuture<T>. Update all thenReturn calls to use CompletableFuture.completedFuture(...). Also wrap the createSchedule/updateSchedule clean-type overloads in try/catch so mapping exceptions (e.g. from toThriftAction) complete the future exceptionally rather than escaping synchronously, matching the documented async contract.
ce7fd1b to
3509da1
Compare
Code Review ✅ Approved 4 resolved / 4 findingsIntroduces clean-type overloads for ✅ 4 resolved✅ Edge Case: Unsafe (byte[]) cast on memo/searchAttributes can throw
✅ Bug: startTime/endTime conversion truncates to millisecond precision
✅ Quality: No unit tests for new clean-type conversion helpers
✅ Bug: backfillSchedule now fires requests concurrently instead of sequentially
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
What changed
Adds convenience overloads to
ScheduleClientandScheduleClientImplso callers can use clean client types instead of raw Thrift gen types.Before:
After:
The raw-request overloads remain for callers that need to set memo or search attributes (which require Thrift gen types).
New private helpers in
ScheduleClientImpl:toThriftSpec,toThriftAction,toThriftStartWorkflow,toThriftPolicies,toThriftCatchUpPolicy,toThriftRetryPolicy.Why
Makes the API surface usable without knowledge of generated Thrift types. Enables clean samples in
cadence-java-samples.How it was tested
./gradlew compileJava -x generateProto— clean buildDependencies
Stacked on
feat/schedule-impl(#1069). Merge #1067 and #1069 first.