-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Add mode schedules map #1071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,6 +3,7 @@ namespace java ai.chronon.orchestration | |||||||||||||
|
|
||||||||||||||
| include "common.thrift" | ||||||||||||||
| include "api.thrift" | ||||||||||||||
| include "planner.thrift" | ||||||||||||||
|
|
||||||||||||||
| // This has to be 0-indexed for Java usage | ||||||||||||||
| enum ConfType { | ||||||||||||||
|
|
@@ -119,6 +120,7 @@ struct ScheduleDeployRequest { | |||||||||||||
| 1: optional string branch | ||||||||||||||
| 2: optional string confName | ||||||||||||||
| 3: optional string confHash | ||||||||||||||
| 4: optional map<planner.Mode, string> modeSchedules | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+123
to
124
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainEnum map keys can be problematic with JSON gateways; add field docs. Thrift JSON stringifies enum keys (often numeric). Verify any JSON/HTTP boundary can handle this. Also document schedule format/timezone and null vs empty semantics. Apply inline docs: - 4: optional map<planner.Mode, string> modeSchedules
+ // Map from planner.Mode to schedule expression (e.g. cron). Clarify format/timezone and empty vs omitted semantics in docs.
+ 4: optional map<planner.Mode, string> modeSchedules🏁 Script executed: #!/bin/bash
# Detect JSON protocol usage that may be impacted by enum map keys
rg -n 'TJSONProtocol|SimpleJSONProtocol|JsonProtocol' -S
# Find call-sites to ensure they populate/consume modeSchedules correctly
rg -n 'ScheduleDeployRequest|modeSchedules' -A2 -B2Length of output: 4508 Document
Suggested inline diff: - 4: optional map<planner.Mode, string> modeSchedules
+ // Map from planner.Mode to cron schedule string (e.g. "0 0 * * *" UTC).
+ // Empty map = no modes scheduled; omitted = use default scheduling.
+ 4: optional map<planner.Mode, string> modeSchedules📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| struct ScheduleDeployResponse { | ||||||||||||||
|
|
@@ -251,6 +253,7 @@ struct ConfListItemResponse { | |||||||||||||
| 1: optional string confName | ||||||||||||||
| 2: optional ConfType confType | ||||||||||||||
| 3: optional string confHash | ||||||||||||||
| 4: optional map<planner.Mode, string> modeSchedules | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| struct ConfListResponse { | ||||||||||||||
|
|
@@ -267,6 +270,7 @@ struct ConfGetResponse { | |||||||||||||
| 2: optional string confHash | ||||||||||||||
| 3: optional ConfType confType | ||||||||||||||
| 4: optional LogicalNode confContents | ||||||||||||||
| 5: optional map<planner.Mode, string> modeSchedules | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| // ====================== End of Orchestration Service API Types ====================== | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using
planner.ModeI assume we'll continue to embraceBackfillandDeployvsOfflineandOnlinenaming (I think both will always live on in various aspects).I can do the mapping on my side, but there are cases where we pass the opposite (and know we had a CLI verb naming discussion a few days ago).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like discrete naming with an enum vs wildcard strings any day :)