Skip to content

feat: add has_been_called on complete & fail utility - #1390

Merged
WilliamBergamin merged 1 commit into
mainfrom
function-utility-has-been-called
Oct 10, 2025
Merged

feat: add has_been_called on complete & fail utility#1390
WilliamBergamin merged 1 commit into
mainfrom
function-utility-has-been-called

Conversation

@WilliamBergamin

@WilliamBergaminWilliamBergamin commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

Summary

These changes allow to easily determine if fail or complete was invoked, invoking both in the same handler can sometimes lead to errors returned from the Slack API

Testing

try:
# do some things to create the step outputcomplete(outputs={"search_result": invalid_object}) # this could cause a parameter validation error from the Slack APIexceptExceptionase:
logger.error("Unexpected error occurred")
ifnotcomplete.has_been_called():
fail(error="internal error")

The same applies to the fail utility function 🙏

Category

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Document pages under /docs
  • Others

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

@codecov

codecovBot commented Oct 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.05%. Comparing base (1d4e86b) to head (c970416).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #1390 +/- ##
==========================================
+ Coverage 91.03% 91.05% +0.02% 
==========================================
Files 222 222 Lines 7514 7534 +20 ==========================================
+ Hits 6840 6860 +20 
Misses 674 674 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cchenshcchensh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@zimegzimeg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@WilliamBergamin LGTM! This is quite slick I admit 🚢 💨

@zimegzimeg added this to the 1.27.0 milestone Oct 10, 2025
@WilliamBergamin
WilliamBergamin merged commit c8a50be into mainOct 10, 2025
14 checks passed
@WilliamBergamin
WilliamBergamin deleted the function-utility-has-been-called branch October 10, 2025 20:08
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@WilliamBergamin@zimeg@cchensh