Repository navigation
Conversation
seratch
left a comment
There was a problem hiding this comment.
Comments for reviewers. I won't merge this PR without approvals from other maintainers.
| callback_id=callback_id, edit=edit, save=save, execute=execute, | ||
| ) | ||
| elif isinstance(step, WorkflowStepBuilder): | ||
| step = step.build() |
There was a problem hiding this comment.
The build method validates the state of the WorkflowStepBuilder object.
| def edit_my_step(ack, configure): | ||
| pass | ||
| """ | ||
| if len(args) == 1: |
There was a problem hiding this comment.
This is the pattern for @my_step.edit (= the edit method is used without ()).
Codecov Report
@@ Coverage Diff @@
## main #113 +/- ##
==========================================
- Coverage 90.65% 90.14% -0.51%
==========================================
Files 148 148
Lines 4141 4375 +234
==========================================
+ Hits 3754 3944 +190
- Misses 387 431 +44
Continue to review full report at Codecov.
|
| pass | ||
| """ | ||
|
|
||
| if len(args) == 1: |
There was a problem hiding this comment.
What do you think about delegating this conditional to a method named something like used_without_argument or maybe used_as_plain_decorator?
Eventuals refactors to this logic may be easier by changing it in only one place, we would need to pass the type of listener to that method
There was a problem hiding this comment.
It sounds nice. I will have some method to commonize the logic. Thanks for the feedback!
| for sub in kwargs["lazy"]: | ||
| functions.append(sub) | ||
| return functions | ||
| return None |
There was a problem hiding this comment.
Is there any problem if we return [] instead of None?
There was a problem hiding this comment.
Indeed. I agree we can return an empty list in the case 👍
| pass | ||
| """ | ||
|
|
||
| if len(args) == 1: |
There was a problem hiding this comment.
It sounds nice. I will have some method to commonize the logic. Thanks for the feedback!
| for sub in kwargs["lazy"]: | ||
| functions.append(sub) | ||
| return functions | ||
| return None |
There was a problem hiding this comment.
Indeed. I agree we can return an empty list in the case 👍
mwbrooks
left a comment
There was a problem hiding this comment.
Really like all the examples that you took the time to include!
Codecov Report
@@ Coverage Diff @@
## main #113 +/- ##
==========================================
- Coverage 91.08% 90.80% -0.28%
==========================================
Files 148 149 +1
Lines 4184 4406 +222
==========================================
+ Hits 3811 4001 +190
- Misses 373 405 +32
Continue to review full report at Codecov.
|
|
@aoberoi told me that he was going to share some thoughts on this and that's the reason why I'm holding off merging this PR. I will change the milestone for this from 0.9 to 1.1 for now. |
|
I am planning to update this PR for aiming to merge it in v1.3. Let me know if you have further comments or feedback on this. |
|
We will use #224 for this |
This pull request adds Workflow Steps support using decorator interface. This way provides more Pythonic way of coding and more flexibility for workflow step listeners. Adding this feature doesn't break anything for the default way to add steps to Bolt apps.
Category (place an
xin each of the[ ])slack_bolt.Appand/or its core componentsslack_bolt.async_app.AsyncAppand/or its core componentsslack_bolt.adapter/docsRequirements (place an
xin each[ ])Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
./scripts/install_all_and_run_tests.shafter making the changes.