-
Notifications
You must be signed in to change notification settings - Fork 18
Add WorkflowCell::add_input #173
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdded a new builder-pattern method Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
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.
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
selffor 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_outputandadd_secretfor API completeness.The
WorkflowCallstruct also hasoutputsandsecretsHashMaps. 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.
We're trying to use gh-workflow at Zed (https://github.com/zed-industries/zed) and needed this.
Summary by CodeRabbit