Skip to content
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

Add functions.completeSuccess/Error APIs for remote functions #1432

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

seratch
Copy link
Member

@seratch seratch commented Nov 21, 2023

Summary

This pull request adds two endpoints, which will be coming soon, to WebClient family. Developers can use these APIs along with slackapi/bolt-python#986

Category (place an x in each of the [ ])

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs-src (Documents, have you run ./scripts/docs.sh?)
  • /docs-src-v2 (Documents, have you run ./scripts/docs-v2.sh?)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements (place an x in each [ ])

  • 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 python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

@seratch seratch added enhancement M-T: A feature request for new functionality web-client Version: 3x labels Nov 21, 2023
@seratch seratch added this to the 3.x milestone Nov 21, 2023
@seratch seratch self-assigned this Nov 21, 2023
Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (7fb3daf) 85.46% compared to head (b44f2d0) 85.38%.

Files Patch % Lines
slack_sdk/web/async_client.py 33.33% 4 Missing ⚠️
slack_sdk/web/client.py 33.33% 4 Missing ⚠️
slack_sdk/web/legacy_client.py 33.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1432      +/-   ##
==========================================
- Coverage   85.46%   85.38%   -0.08%     
==========================================
  Files         111      111              
  Lines       12114    12132      +18     
==========================================
+ Hits        10353    10359       +6     
- Misses       1761     1773      +12     

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

@seratch
Copy link
Member Author

seratch commented Nov 21, 2023

I think we can skip having codecov patch 50% this time

Copy link
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

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

This looks good to me 💯 thank you 🙇

I left one comment regarding an issue I faced during my testing of python remote functions

https://api.slack.com/methods/functions.completeSuccess
"""
kwargs.update({"function_execution_id": function_execution_id, "outputs": outputs})
return self.api_call("functions.completeSuccess", params=kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

During my testing of python remote functions I found that passing these values to the params parameter lead to some instability and resorted to passing values through the json parameter to resolve the issue

This might have been an issue on my end, but could you confirm this approach is reliable for a variety of outputs?

Copy link
Member Author

Choose a reason for hiding this comment

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

@WilliamBergamin Oh, this is great catch! i totally forgot to do json.dumps() before passing the value to kwargs. Thanks for saving me!

@seratch seratch merged commit 06e55d1 into slackapi:main Nov 22, 2023
8 of 9 checks passed
@seratch seratch deleted the remote-functions branch November 22, 2023 04:10
@seratch seratch modified the milestones: 3.x, 3.26.0 Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality Version: 3x web-client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants