Skip to content

Add request and response for WorkflowGet API #1076

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

david-zlai
Copy link
Contributor

@david-zlai david-zlai commented Aug 14, 2025

Summary

Checklist

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

Summary by CodeRabbit

  • New Features
    • Added a new API to fetch workflow details by ID, returning key metadata such as run identifier, configuration info, execution mode, partition range, branch, submitter, workflow plan, submission time, recompute flag, and current status.
    • Enables clients to programmatically retrieve comprehensive workflow information and status in a single response for improved integration and monitoring workflows.

Copy link
Contributor

coderabbitai bot commented Aug 14, 2025

Walkthrough

Introduces two Thrift structs in api/thrift/orchestration.thrift: WorkflowGetRequest and WorkflowGetResponse with 12 optional fields including WorkflowStatus. They are placed after WorkflowStatusRequest and before NodeStatusRequest. An extra closing brace was added.

Changes

Cohort / File(s) Summary
Thrift API additions
api/thrift/orchestration.thrift
Added structs: WorkflowGetRequest {workflowId}; WorkflowGetResponse {runId, confName, confHash, mode, startPartition, endPartition, branch, user, workflowPlan, submissionTime, forceRecompute, status: WorkflowStatus}. Positioned after WorkflowStatusRequest, before NodeStatusRequest. Extra closing brace inserted.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant OrchestrationAPI

  Client->>OrchestrationAPI: WorkflowGetRequest(workflowId?)
  OrchestrationAPI-->>Client: WorkflowGetResponse(runId, conf*, mode, partitions, branch, user, plan, submissionTime, forceRecompute, status)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

New structs bloom in Thrift’s domain,
A request whispers an ID’s name;
A response returns the tale complete,
Status and settings neatly meet.
One brace too bold may overstay—
Nudge it gently on its way.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch david/workflow_get_api

🪧 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: 2

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

184-186: Is workflowId actually optional?

Semantically required for a GET-by-id. If you keep it optional for backward-compat, validate server-side and document it.

📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f287421 and d8f1ad9.

📒 Files selected for processing (1)
  • api/thrift/orchestration.thrift (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Test non-spark modules on scala 2.12
api/thrift/orchestration.thrift

[error] 203-203: Thrift code generation failed due to syntax error: last token was '}' at line 203. Parser error during include pass. Thrift command failed: /usr/local/bin/thrift --gen 'java:generated_annotations=undated' -out bazel-out/k8-fastbuild/bin/api/thrift_gen_orchestration api/thrift/orchestration.thrift

🪛 GitHub Actions: Test Python
api/thrift/orchestration.thrift

[error] 203-203: Thrift syntax error: (last token was '}') in orchestration.thrift:203. Thrift generation failed. Command: thrift --gen py -out api/python/ api/thrift/orchestration.thrift

⏰ 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). (5)
  • GitHub Check: scala_compile_fmt_fix
  • GitHub Check: streaming_tests
  • GitHub Check: fetcher_tests
  • GitHub Check: join_tests
  • GitHub Check: analyzer_tests

Comment on lines +188 to +190
struct WorkflowGetResponse {
1: optional string runId
2: optional string confName
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Use workflowId (not runId) for workflow identity

API elsewhere uses workflowId (WorkflowStartResponse, WorkflowStatusResponse, WorkflowResponse). runId is used for node step runs; using it here is confusing. Rename now before clients adopt it.

-    1: optional string runId
+    1: optional string workflowId
📝 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
struct WorkflowGetResponse {
1: optional string runId
2: optional string confName
struct WorkflowGetResponse {
1: optional string workflowId
2: optional string confName
// …other fields…
}
🤖 Prompt for AI Agents
In api/thrift/orchestration.thrift around lines 188–190, the WorkflowGetResponse
struct uses the field name runId which is inconsistent with the rest of the API;
rename field 1 from runId to workflowId (keep id 1 and optional string type) and
update any local references in this Thrift file to use workflowId instead of
runId; after changing the IDL, regenerate/update any generated client/server
code and update call sites/tests to refer to WorkflowGetResponse.workflowId so
the API consistently uses workflowId for workflow identity.

Comment on lines +203 to +204
}

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove stray closing brace to fix Thrift parse error

Extraneous '}' breaks codegen (see pipeline error at line 203). Remove it.

-}
📝 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
}
🧰 Tools
🪛 GitHub Actions: Test non-spark modules on scala 2.12

[error] 203-203: Thrift code generation failed due to syntax error: last token was '}' at line 203. Parser error during include pass. Thrift command failed: /usr/local/bin/thrift --gen 'java:generated_annotations=undated' -out bazel-out/k8-fastbuild/bin/api/thrift_gen_orchestration api/thrift/orchestration.thrift

🪛 GitHub Actions: Test Python

[error] 203-203: Thrift syntax error: (last token was '}') in orchestration.thrift:203. Thrift generation failed. Command: thrift --gen py -out api/python/ api/thrift/orchestration.thrift

🤖 Prompt for AI Agents
In api/thrift/orchestration.thrift around lines 203 to 204, there's an
extraneous closing brace '}' that causes a Thrift parse/codegen error; remove
this stray '}' so the file's braces match (verify surrounding
struct/enum/service blocks) and run the Thrift linter/codegen to confirm the
syntax error is resolved.

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.

1 participant