Skip to content

Commit d664d83

Browse files
authored
feat: [Cadence Schedules] Add schedule API request/response types (#7749)
**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>
1 parent d44afb8 commit d664d83

File tree

3 files changed

+638
-10
lines changed

3 files changed

+638
-10
lines changed

common/types/schedule.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,13 @@ func (v *ScheduleSpec) GetJitter() (o time.Duration) {
181181
type StartWorkflowAction struct {
182182
WorkflowType *WorkflowType `json:"workflowType,omitempty"`
183183
TaskList *TaskList `json:"taskList,omitempty"`
184-
Input []byte `json:"-"`
184+
Input []byte `json:"-"` // Potential PII
185185
WorkflowIDPrefix string `json:"workflowIdPrefix,omitempty"`
186186
ExecutionStartToCloseTimeoutSeconds *int32 `json:"executionStartToCloseTimeoutSeconds,omitempty"`
187187
TaskStartToCloseTimeoutSeconds *int32 `json:"taskStartToCloseTimeoutSeconds,omitempty"`
188188
RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"`
189-
Memo *Memo `json:"-"`
190-
SearchAttributes *SearchAttributes `json:"-"`
189+
Memo *Memo `json:"-"` // Filtering PII
190+
SearchAttributes *SearchAttributes `json:"-"` // Filtering PII
191191
}
192192

193193
func (v *StartWorkflowAction) GetWorkflowType() *WorkflowType {
@@ -384,12 +384,12 @@ func (v *BackfillInfo) GetRunsTotal() (o int32) {
384384

385385
// ScheduleInfo provides runtime information about the schedule.
386386
type ScheduleInfo struct {
387-
LastRunTime time.Time `json:"lastRunTime,omitempty"`
388-
NextRunTime time.Time `json:"nextRunTime,omitempty"`
389-
TotalRuns int64 `json:"totalRuns,omitempty"`
390-
CreateTime time.Time `json:"createTime,omitempty"`
391-
LastUpdateTime time.Time `json:"lastUpdateTime,omitempty"`
392-
OngoingBackfills []BackfillInfo `json:"ongoingBackfills,omitempty"`
387+
LastRunTime time.Time `json:"lastRunTime,omitempty"`
388+
NextRunTime time.Time `json:"nextRunTime,omitempty"`
389+
TotalRuns int64 `json:"totalRuns,omitempty"`
390+
CreateTime time.Time `json:"createTime,omitempty"`
391+
LastUpdateTime time.Time `json:"lastUpdateTime,omitempty"`
392+
OngoingBackfills []*BackfillInfo `json:"ongoingBackfills,omitempty"`
393393
}
394394

395395
func (v *ScheduleInfo) GetLastRunTime() (o time.Time) {
@@ -427,7 +427,7 @@ func (v *ScheduleInfo) GetLastUpdateTime() (o time.Time) {
427427
return
428428
}
429429

430-
func (v *ScheduleInfo) GetOngoingBackfills() (o []BackfillInfo) {
430+
func (v *ScheduleInfo) GetOngoingBackfills() (o []*BackfillInfo) {
431431
if v != nil {
432432
return v.OngoingBackfills
433433
}

0 commit comments

Comments
 (0)