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

Mark stars.* API methods as deprecated #1387

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

seratch
Copy link
Member

@seratch seratch commented Jul 14, 2023

see also: https://api.slack.com/changelog/2023-07-its-later-already-for-stars-and-reminders

Summary

(Describe the goal of this PR. Mention any related issue numbers)

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 this to the 3.22.0 milestone Jul 14, 2023
@seratch seratch self-assigned this Jul 14, 2023
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #1387 (6abca93) into main (12e4850) will decrease coverage by 0.07%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main    #1387      +/-   ##
==========================================
- Coverage   85.57%   85.51%   -0.07%     
==========================================
  Files         111      111              
  Lines       11586    11591       +5     
==========================================
- Hits         9915     9912       -3     
- Misses       1671     1679       +8     
Impacted Files Coverage Δ
slack_sdk/models/blocks/blocks.py 96.60% <ø> (ø)
slack_sdk/web/deprecation.py 44.44% <33.33%> (-9.41%) ⬇️
slack_sdk/web/async_base_client.py 98.33% <100.00%> (ø)
slack_sdk/web/base_client.py 89.62% <100.00%> (ø)
slack_sdk/web/legacy_base_client.py 87.75% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@zimeg zimeg 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! Left a few comments for future maintenance, but nothing blocking – the checks for deprecated methods work wonderfully!

client = WebClient(base_url="http://localhost:8888")
client.stars_list(token="xoxb-api_test")
finally:
os.environ.update({"SLACKCLIENT_SKIP_DEPRECATION": env_value})
Copy link
Member

Choose a reason for hiding this comment

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

This seems to raise the following error if SLACKCLIENT_SKIP_DEPRECATION isn't set:

TypeError: str expected, not NoneType

Not a blocker IMO since the deprecation warning is correctly shown when setting this variable before running the test, just wanted to raise this!

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, good catch! will fix before merging it


def show_2020_01_deprecation(method_name: str):
Copy link
Member

Choose a reason for hiding this comment

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

Nice change!

@@ -10,8 +10,10 @@
"admin.conversations.whitelist.",
]

deprecated_method_prefixes_2023_07 = ["stars."]
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if we want to include a comment to the changelog above this deprecation too? It's already included in the comment below so not a huge deal if not!

Copy link
Member Author

Choose a reason for hiding this comment

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

Sadly, we don't have any workaround for this breaking change. So, I cannot think of any good comment for it

@seratch seratch merged commit 6abca93 into slackapi:main Jul 14, 2023
10 checks passed
@seratch seratch deleted the stars-method-deperecation branch July 14, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants