feat: [Cadence Schedules] Add schedule core types and enums#7745
feat: [Cadence Schedules] Add schedule core types and enums#7745abhishekj720 merged 1 commit intomasterfrom
Conversation
6bfdf34 to
64922b1
Compare
| if err != nil { | ||
| return fmt.Errorf("unknown enum value %q for %q: %v", s, "ScheduleCatchUpPolicy", err) | ||
| } | ||
| *e = ScheduleCatchUpPolicy(val) |
There was a problem hiding this comment.
Would it make sense to error instead of accepting arbitrary numbers? I don't recall the behavior of other types.
There was a problem hiding this comment.
Matches existing convention: all enums in common/types accept arbitrary numeric values for forward-compatibility.
For example:
cadence/common/types/replicator.go
Line 61 in b3d0695
| TaskStartToCloseTimeoutSeconds *int32 `json:"taskStartToCloseTimeoutSeconds,omitempty"` | ||
| RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"` | ||
| Memo *Memo `json:"-"` | ||
| SearchAttributes *SearchAttributes `json:"-"` |
There was a problem hiding this comment.
I would advocate for using value types for all these fields as well but this seems aligned with how we handle these fields everywhere else.
e9da54d to
899ddf4
Compare
899ddf4 to
9bc91ad
Compare
Signed-off-by: abhishek.jha <abhishek.jha@uber.com>
9bc91ad to
db5a299
Compare
Code Review ✅ Approved 2 resolved / 2 findingsClean foundational type definitions following established codebase patterns. Both previous findings (missing BackfillInfo getters and enum String() format mismatch) have been resolved. ✅ 2 resolved✅ Bug:
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
) **What changed?** - Add request/response types for all Schedule CRUD and lifecycle APIs (Create, Describe, Update, Delete, Pause, Unpause, List, Backfill) in `common/types/schedule_service.go` - Add `ScheduleListEntry` for paginated list responses - Include nil-safe getters for every field on every type, consistent with existing patterns in `common/types/shared.go` - Add `schedule_service_test.go` with nil-receiver and value getter tests **Why?** To support the new Cadence Schedules feature (pause/resume, catch-up, backfill), we need internal Go types to represent schedule entities within the server codebase. These types mirror the IDL definitions. This serves as the foundation for the scheduler workflow and API implementation. Builds on [#7745](#7745) which introduced the core schedule types and enums. **How did you test it?** Added unit tests and ran go test ./.. on the added files **Potential risks** N/A **Release notes** Added request/response types for cadence schedules **Documentation Changes** N/A --- ## Reviewer Validation **PR Description Quality** (check these before reviewing code): - [ ] **"What changed"** provides a clear 1-2 line summary - [ ] Project Issue is linked - [ ] **"Why"** explains the full motivation with sufficient context - [ ] **Testing is documented:** - [ ] Unit test commands are included (with exact `go test` invocation) - [ ] Integration test setup/commands included (if integration tests were run) - [ ] Canary testing details included (if canary was mentioned) - [ ] **Potential risks** section is thoughtfully filled out (or legitimately N/A) - [ ] **Release notes** included if this completes a user-facing feature - [ ] **Documentation** needs are addressed (or noted if uncertain) Signed-off-by: abhishek.jha <abhishek.jha@uber.com>
What changed?
Added internal Go types for Cadence Schedules (enums, core structs) mirroring api/v1/schedule.proto.
Why?
To support the new Cadence Schedules feature (pause/resume, catch-up, backfill), we need internal Go types to represent schedule entities within the server codebase. These types mirror the IDL definitions and include standard helper methods (Getters, String/Enum marshalling) required for internal usage. This serves as the foundation for the scheduler workflow and API implementation.
Proto definitions: cadence-workflow/cadence-idl#246
How did you test it?
Ran unit tests for enum marshalling/unmarshalling:
go test -v ./common/types/ -run TestSchedule
Potential risks
N/A - Purely additive type definitions; not yet wired into any active code paths.
Release notes
Added core internal types for Cadence Schedules.
Documentation Changes
N/A
Reviewer Validation
PR Description Quality (check these before reviewing code):
go testinvocation)