Skip to content

Conversation

@tchow-zlai
Copy link
Collaborator

@tchow-zlai tchow-zlai commented Aug 13, 2025

Summary

  • To correctly display online and offline schedules as well as indicate what schedules to deploy, we need to pass in a map of conf modes to schedules defined by a conf in both the deploy submission request as well as when we retrieve conf details.

Checklist

  • Added Unit Tests
  • Covered by existing CI
  • Integration tested
  • Documentation update

Summary by CodeRabbit

  • New Features
    • Added per-mode scheduling to deployment and configuration APIs, enabling granular schedules by execution mode.
    • New optional scheduling options appear in deployment requests, configuration list items, and configuration detail responses.
    • Backward compatible: existing workflows remain unchanged unless the new options are used.
    • Improves flexibility for rollout planning and mode-specific timing.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 13, 2025

Walkthrough

Adds planner.thrift include to orchestration.thrift and introduces an optional per-mode scheduling map field (modeSchedules) to ScheduleDeployRequest, ConfListItemResponse, and ConfGetResponse, using planner.Mode. No other fields changed.

Changes

Cohort / File(s) Summary
Thrift orchestration API
api/thrift/orchestration.thrift
Included planner.thrift; added optional map<planner.Mode,string> modeSchedules to ScheduleDeployRequest (field 4), ConfListItemResponse (field 4), and ConfGetResponse (field 5).

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant OrchestrationService
  participant Planner

  Client->>OrchestrationService: ScheduleDeployRequest(modeSchedules)
  OrchestrationService->>Planner: Validate modes (planner.Mode)
  Planner-->>OrchestrationService: OK / details
  OrchestrationService-->>Client: Conf*Response(modeSchedules)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Poem

New modes align, in tidy rows,
A map of when each service goes.
Thrift now speaks in plural time,
Planner’s compass sets the rhyme.
Schedules hum in per-mode light—
Deploys take flight, precisely right.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tchow/mode-schedules

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
api/thrift/orchestration.thrift (2)

256-257: Add concise docs; consider payload implications for list APIs.

Listing per-mode schedules may bloat responses; OK if intended. Long-term, consider aligning all “mode” fields to planner.Mode for consistency.

-    4: optional map<planner.Mode, string> modeSchedules
+    // Optional per-mode schedule map for this conf; may increase list payload size.
+    4: optional map<planner.Mode, string> modeSchedules

273-274: Document field semantics; consider a request flag to control inclusion.

ConfGetResponse might benefit from an includeSchedules flag in ConfGetRequest to avoid unnecessary data transfer.

-    5: optional map<planner.Mode, string> modeSchedules
+    // Optional per-mode schedule map for this conf. Consider a request flag to include/omit for performance.
+    5: optional map<planner.Mode, string> modeSchedules

I can draft the ConfGetRequest toggle + downstream wiring if desired.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 699a6c3 and b984aed.

📒 Files selected for processing (1)
  • api/thrift/orchestration.thrift (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
  • GitHub Check: analyzer_tests
  • GitHub Check: groupby_tests
  • GitHub Check: fetcher_tests
  • GitHub Check: streaming_tests
  • GitHub Check: spark_tests
  • GitHub Check: join_tests
  • GitHub Check: batch_tests
  • GitHub Check: cloud_aws_tests
  • GitHub Check: cloud_gcp_tests
  • GitHub Check: service_commons_tests
  • GitHub Check: service_tests
  • GitHub Check: scala_compile_fmt_fix
  • GitHub Check: online_tests
  • GitHub Check: api_tests
  • GitHub Check: aggregator_tests
  • GitHub Check: flink_tests
  • GitHub Check: python_tests
  • GitHub Check: enforce_triggered_workflows
🔇 Additional comments (1)
api/thrift/orchestration.thrift (1)

6-6: Include Verification Passed: planner.thrift Defines Mode & No Circular Include

Verified that api/thrift/planner.thrift exists, declares enum Mode, and does not include orchestration.thrift. No action needed.

Comment on lines +123 to 124
4: optional map<planner.Mode, string> modeSchedules
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Enum 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 -B2

Length of output: 4508


Document modeSchedules field and JSON enum key behavior

  • JSON protocols (TSimpleJSONProtocol/TJSONProtocol) serialize enum keys as their numeric strings—ensure downstream JSON gateways accept numeric-string keys.
  • Add concise field docs for modeSchedules in all orchestration structs (lines 123, 256, 273): specify expected schedule format (e.g. cron), timezone (UTC), and semantics for omitted vs. empty map.

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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
}
🤖 Prompt for AI Agents
In api/thrift/orchestration.thrift around lines 123, 256 and 273, the optional
map<planner.Mode,string> modeSchedules fields lack documentation and callers may
be surprised that TSimpleJSONProtocol/TJSONProtocol will serialize enum map keys
as numeric strings; update the three orchestration struct field comments to
document: the map keys are planner.Mode and when serialized to JSON may appear
as numeric string keys (gateway must accept numeric-string keys), the map values
are schedule strings in cron format (or clearly state accepted format), times
are interpreted in UTC, and semantics: omitted field = use default schedules, an
explicit empty map = disable all schedules, and invalid/empty strings are
treated as errors — add these concise notes inline for each occurrence.

1: optional string branch
2: optional string confName
3: optional string confHash
4: optional map<planner.Mode, string> modeSchedules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By using planner.Mode I assume we'll continue to embrace Backfill and Deploy vs Offline and Online naming (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).

Copy link
Contributor

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 :)

@tchow-zlai tchow-zlai merged commit 4e8f43b into main Aug 13, 2025
21 checks passed
@tchow-zlai tchow-zlai deleted the tchow/mode-schedules branch August 13, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants