Skip to content

feat: add entity.presentComments method - #2055

Open
zimeg wants to merge 6 commits into
mainfrom
zimeg-feat-entity-present-comments
Open

zimeg wants to merge 6 commits into
mainfrom
zimeg-feat-entity-present-comments

Conversation

@zimeg

@zimeg zimeg commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

This pull request adds the entity.presentComments method to the Web API clients.

  • entity_presentComments takes required comments and trigger_id, and optional cursor, can_post_comment, delete_action_id, user_auth_required, user_auth_url, and error. It sends a JSON body like entity_presentDetails.
  • error is a dict like the one entity_presentDetails takes, since the API rejects a string with must provide an object.
  • The async and legacy clients are regenerated with scripts/codegen.py, and the method is added to the Web API coverage test.

This is part 1 of 2 in the entity stack. It's in the B9 work object comments batch. Each pull request builds on the one before it and merges on its own, bottom to top. Related to #2014.

  1. feat: add entity.presentComments method #2055 entity.presentComments 👈 this pull request
  2. feat: add entity.acknowledgeCommentAction method #2054 entity.acknowledgeCommentAction

Testing

In an app with Work Objects comments, when the entity_comments_requested event arrives:

  1. Call client.entity_presentComments(comments=[...], trigger_id=event["trigger_id"], can_post_comment=True) and confirm the comments tab lists them with a composer.
  2. Call it with comments=[], user_auth_required=True, and user_auth_url and confirm the tab asks the user to authenticate.
  3. Repeat with AsyncWebClient to check the generated async method.

Live check: a real trigger_id needs a Work Object flexpane, so the check is a documented error. The docs' example trigger_id gets past schema validation and returns invalid_trigger_id for both calls above, and from AsyncWebClient too (rerun on 2026-11-30). A comment id over 25 characters fails schema validation first with must be less than 26 characters. Leaving out comments returns missing required field: comments, even with user_auth_required, so comments stays required. These calls ran in a developer workspace.

Category

  • 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 (Documents)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • 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 have signed the Salesforce CLA (required before your PR can be reviewed or merged).
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.93%. Comparing base (f69c507) to head (b88cbe9).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2055      +/-   ##
==========================================
- Coverage   84.96%   84.93%   -0.03%     
==========================================
  Files         118      118              
  Lines       14287    14287              
==========================================
- Hits        12139    12135       -4     
- Misses       2148     2152       +4     

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

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
zimeg force-pushed the zimeg-feat-entity-present-comments branch from 61172bb to 24b1d74 Compare November 18, 2026 06:15
@zimeg
zimeg changed the base branch from zimeg-feat-entity-acknowledge-comment-action to main November 18, 2026 06:15
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg mentioned this pull request Nov 20, 2026
5 of 16 tasks
@zimeg zimeg modified the milestones: 3.48.0, 3.48.1 Nov 20, 2026
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
zimeg marked this pull request as ready for review December 1, 2026 03:55
@zimeg
zimeg requested a review from a team as a code owner December 1, 2026 03:55

@mwbrooks mwbrooks 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.

✅ Thanks @zimeg! Checking that the API rejects a string error before typing it as a dict saves developers a confusing must provide an object.

Comment thread slack_sdk/web/client.py Resolved
Co-authored-by: Michael Brooks <21328+mwbrooks@users.noreply.github.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg

zimeg commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

🌟 Thanks for the kind review @mwbrooks! The error Args line made the presentComments docs complete.

This branch has not been deployed

No deployments
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 semver:minor web-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants