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 file_ids to chat.update parameters #1187

Merged
merged 1 commit into from Feb 24, 2022
Merged

Conversation

seratch
Copy link
Member

@seratch seratch commented Feb 24, 2022

Summary

This pull request adds file_ids to chat.update parameters. Also, it fixes an existing bug in conversations_inviteShared method.

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 bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented enhancement M-T: A feature request for new functionality web-client Version: 3x labels Feb 24, 2022
@seratch seratch added this to the 3.16.0 milestone Feb 24, 2022
@seratch seratch self-assigned this Feb 24, 2022
@seratch seratch modified the milestones: 3.16.0, 3.15.2 Feb 24, 2022
@@ -2448,7 +2453,7 @@ async def conversations_inviteShared(
else:
kwargs.update({"emails": emails})
if isinstance(user_ids, (list, Tuple)):
kwargs.update({"emails": ",".join(user_ids)})
kwargs.update({"user_ids": ",".join(user_ids)})
Copy link
Member Author

Choose a reason for hiding this comment

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

This has been a bug

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

@codecov
Copy link

codecov bot commented Feb 24, 2022

Codecov Report

Merging #1187 (9767f09) into main (53766ae) will decrease coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1187      +/-   ##
==========================================
- Coverage   86.55%   86.53%   -0.03%     
==========================================
  Files         110      110              
  Lines       10855    10864       +9     
==========================================
+ Hits         9396     9401       +5     
- Misses       1459     1463       +4     
Impacted Files Coverage Δ
slack_sdk/web/async_client.py 85.08% <50.00%> (-0.06%) ⬇️
slack_sdk/web/client.py 86.47% <75.00%> (-0.06%) ⬇️
slack_sdk/web/legacy_client.py 86.18% <75.00%> (-0.06%) ⬇️
slack_sdk/socket_mode/builtin/internals.py 72.36% <0.00%> (-0.44%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53766ae...9767f09. Read the comment docs.

Copy link
Contributor

@filmaj filmaj left a comment

Choose a reason for hiding this comment

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

Looks good! My one comment is that codecov reports some of the type-checking code is not covered by tests, specifically:

  • In async_client, if either file_ids or user_ids is a list or a Tuple, we should check that the properties are mapped to a comma-delimited string
  • In the regular client and the legacy_client, if file_ids is a list of a Tuple, we should that it gets updated to a comma-delimited string

Perhaps we could add those unit tests while we're here?

@@ -2448,7 +2453,7 @@ async def conversations_inviteShared(
else:
kwargs.update({"emails": emails})
if isinstance(user_ids, (list, Tuple)):
kwargs.update({"emails": ",".join(user_ids)})
kwargs.update({"user_ids": ",".join(user_ids)})
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

@seratch
Copy link
Member Author

seratch commented Feb 24, 2022

Hi @filmaj thanks for the comment! As those classes are auto generated, we are okay to skip adding tests. If we want to do so just to gain slightly better coverage rate, it's also fine, though. Let me skip it this time.

@seratch seratch merged commit d0db05a into slackapi:main Feb 24, 2022
@seratch seratch deleted the chat-update branch February 24, 2022 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented 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.

None yet

3 participants