Skip to content

Conversation

@ConradIrwin
Copy link

@ConradIrwin ConradIrwin commented Oct 27, 2025

We're trying to use gh-workflow at Zed (https://github.com/zed-industries/zed) and needed this.

Summary by CodeRabbit

  • New Features
    • Added a fluent API method for adding inputs to workflow calls, enabling developers to more conveniently configure workflow inputs.

@coderabbitai
Copy link

coderabbitai bot commented Oct 27, 2025

Walkthrough

Added a new builder-pattern method add_input to the WorkflowCall struct that accepts a name and WorkflowCallInput, inserts the input into an inputs map, and returns self for method chaining.

Changes

Cohort / File(s) Change Summary
Builder Method Addition
crates/gh-workflow/src/event.rs
Added pub fn add_input(mut self, name: impl Into<String>, input: WorkflowCallInput) -> Self method to WorkflowCall for fluent input addition

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single, straightforward method addition following standard builder pattern
  • No complex logic or control flow changes
  • Minimal surface area for potential issues

Poem

🐰 A builder's delight, so neat and so clean,
Add inputs with ease in a method serene!
Chain calls with grace, let the API flow,
Fluent and friendly—watch workflows grow! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The pull request title states "Add WorkflowCell::add_input", but the raw summary clearly indicates that the method add_input was added to the WorkflowCall class, not WorkflowCell. This is a factual inaccuracy in the title that could mislead reviewers and future developers searching the git history. The title correctly identifies that an add_input method was added, but misidentifies which class received this addition, making the title misleading rather than accurate. The title should be corrected to accurately reflect the actual change: "Add WorkflowCall::add_input" instead of "Add WorkflowCell::add_input". This correction will ensure the title accurately describes the class that received the new method and will help developers easily identify the change in git history.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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: 0

🧹 Nitpick comments (1)
crates/gh-workflow/src/event.rs (1)

811-816: LGTM! Implementation follows the builder pattern correctly.

The method correctly inserts the input into the HashMap and returns self for chaining, matching the pattern used throughout this file.

Consider adding documentation.

Most similar add_* methods in this file include doc comments. For example, line 197 has "Adds a branch name to filter on". Adding a doc comment would improve discoverability:

 impl WorkflowCall {
+    /// Adds a workflow call input
     pub fn add_input(mut self, name: impl Into<String>, input: WorkflowCallInput) -> Self {
         self.inputs.insert(name.into(), input);
         self
     }
 }

Consider adding add_output and add_secret for API completeness.

The WorkflowCall struct also has outputs and secrets HashMaps. For consistency, you might want to add similar builder methods for those fields:

pub fn add_output(mut self, name: impl Into<String>, output: WorkflowCallOutput) -> Self {
    self.outputs.insert(name.into(), output);
    self
}

pub fn add_secret(mut self, name: impl Into<String>, secret: WorkflowCallSecret) -> Self {
    self.secrets.insert(name.into(), secret);
    self
}

This would provide a uniform API, though it's fine to add them only as needed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8ec2428 and 18e8e67.

📒 Files selected for processing (1)
  • crates/gh-workflow/src/event.rs (1 hunks)

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