-
Notifications
You must be signed in to change notification settings - Fork 227
feat(web-api): add slackLists methods #1537
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1537 +/- ##
============================================
+ Coverage 72.77% 72.95% +0.18%
- Complexity 4412 4476 +64
============================================
Files 477 477
Lines 14081 14223 +142
Branches 1473 1483 +10
============================================
+ Hits 10247 10377 +130
- Misses 2963 2967 +4
- Partials 871 879 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…o ale-feat-lists-mthds
…va-slack-sdk into ale-feat-lists-mthds
zimeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srtaalej Sweeeeet! These are nice changes to have in progress! ☕ ✨
I'm starting a review now but wanted to leave a few notes on first findings. I plan to test this soon too and will share more then!
slack-api-client/src/test/java/test_locally/api/MethodsTest.java
Outdated
Show resolved
Hide resolved
...t/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsAccessDeleteRequest.java
Show resolved
Hide resolved
...t/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsAccessDeleteRequest.java
Show resolved
Hide resolved
slack-api-client/src/test/java/test_with_remote_apis/methods/slacklists_Test.java
Outdated
Show resolved
Hide resolved
…lacklists/SlackListsAccessDeleteRequest.java Co-authored-by: Eden Zimbelman <[email protected]>
…o ale-feat-lists-mthds
zimeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srtaalej These are all solid changes! 🔏 ✨
Overall things are seeming good, but a few things stood out that we might want to address before merging:
- Alphabetics: This is a quibble, but some implementations and imports of these "slackLists" methods are out of order around "stars" I noticed. Bringing this up here since this can cause added thought in surrounding changes at a later time...
- Underscores: I'm unsure if
slacklistsorslack_listsis better for file names, but a decision before releasing this might be good to have! - Builders: The form builder has repetitive logic around "null" values that we should avoid. Sending encoded arrays has caused me issue before with JSON encodings that I hope to avoid with consistent setups around this.
- Testing: Remote tests should match the testing example shared with this PR! This'll let us confirm the expected values are sent and received with the API.
Hoping these aren't significant changes needed, but I do realize this is a larger PR. Please let me know if I can share more about the remote testing or other notes!
slack-api-client/src/main/java/com/slack/api/methods/AsyncMethodsClient.java
Show resolved
Hide resolved
slack-api-client/src/main/java/com/slack/api/methods/RequestFormBuilder.java
Show resolved
Hide resolved
slack-api-client/src/test/java/test_with_remote_apis/methods/slacklists_Test.java
Show resolved
Hide resolved
...t/src/main/java/com/slack/api/methods/request/slack_lists/SlackListsAccessDeleteRequest.java
Show resolved
Hide resolved
…rmBuilder.java Co-authored-by: Eden Zimbelman <[email protected]>
…va-slack-sdk into ale-feat-lists-mthds
zimeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👁️🗨️ Leaving a quick note on perhaps unusual JSON logs appearing!
| "rich_text": [] | ||
| "rich_text": [ | ||
| "" | ||
| ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚧 issue: I notice this string value might be causing CI to error with unexpected properties:
Error: SlackListsTest.slackListsItemsCreate:107 » JsonSyntax java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 304 path $.item.fields[0].rich_text[0]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✏️ suggestion: For now we can revert this to be an empty array, unless a more descriptive typing is found with later tests?
🗣️ ramble: A similar issue might exist in adjacent logs too:
$.subtasks[0]of theslackLists.items.infomethod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it by adding "rich_text": [ { "type": "rich_text", "elements": [ { "type": "rich_text_section", "elements": [ { "type": "text", "text": "" } ] } ] } ]
mwbrooks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Looks good to me and thank you for handling all of @zimeg's feedback! 🙇🏻
👀 Let's hold off on merging until later Monday to give @WilliamBergamin a chance to look at the pull request.
🚀 After Monday, I'm happy to merge! We can always iterate in follow-up PRs with any additional feedback 👌🏻
🙏🏻 Great work on adding all of the lists methods to the Java SDK! It's a huge feat!
slack-api-client/src/main/java/com/slack/api/methods/Methods.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Michael Brooks <[email protected]>
zimeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srtaalej LGTM! This is a super impressive PR 🌟
Thank you for addressing the rambling comments as well as adding a test that we can use for continued maintenance. And the testing steps. I left a comment on possible errors in related testing, but nothing that stops this from landing! 🚢 💨
| @Override | ||
| @Deprecated // https://docs.slack.dev/changelog/2023-07-its-later-already-for-stars-and-reminders | ||
| public StarsRemoveResponse starsRemove(RequestConfigurator<StarsRemoveRequest.StarsRemoveRequestBuilder> req) throws IOException, SlackApiException { | ||
| return starsRemove(req.configure(StarsRemoveRequest.builder()).build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧮 nit(non-blocking): We can alphabetical order the list methods before these "stars" methods!
| assertThat(accessSetResponse.getError(), is(nullValue())); | ||
| assertThat(accessSetResponse.isOk(), is(true)); | ||
|
|
||
| try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🪓 question: Are we alright to remove the try from this test? Since we're not running this in CI at the moment, these failures might be nice to raise for more investigation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this try clause does not have catch clauses, so an exception thrown here would be re-thrown to the test runner. this means if you want to use try clause without catch clauses for auto-closing resources, that's totally fine.
in this case, the finally clause just prints info-level logging, so the try/finally may not be necessary though
| private String provided; | ||
| private transient Map<String, List<String>> httpResponseHeaders; | ||
|
|
||
| private File list; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧠 praise: TIL lists are a special file!
seratch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glad to see the team continues maintaining this!
| /** | ||
| * Encoded ID of the List. | ||
| */ | ||
| @SerializedName("list_id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: when the snake_case to camelCase (vice versa) is straight-forward like this one, the SerializedName annotation is not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for taking the time to drop a review! 😸
| /** | ||
| * Column definition for the List. (Optional) | ||
| */ | ||
| private List<Map<String, Object>> schema; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have the concrete object types of possible values here, avoiding Object is more developer friendly.
| * Initial item data. (Optional) | ||
| */ | ||
| @SerializedName("initial_fields") | ||
| private List<Map<String, Object>> initialFields; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
| assertThat(accessSetResponse.getError(), is(nullValue())); | ||
| assertThat(accessSetResponse.isOk(), is(true)); | ||
|
|
||
| try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this try clause does not have catch clauses, so an exception thrown here would be re-thrown to the test runner. this means if you want to use try clause without catch clauses for auto-closing resources, that's totally fine.
in this case, the finally clause just prints info-level logging, so the try/finally may not be necessary though
…va-slack-sdk into ale-feat-lists-mthds
…o ale-feat-lists-mthds
…va-slack-sdk into ale-feat-lists-mthds
This PR adds support for the following slackLists API methods and addresses issue #1503 :
Create, AccessDelete, AccessSet, DownloadGet, DownloadStart, ItemsCreate, ItemsDelete, ItemsDeleteMultiple, ItemsInfo, ItemsList, ItemsUpdate, UpdateTesting
Category (place an
xin each of the[ ])Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.