feat: add debug logging and retry support to icon upload#505
feat: add debug logging and retry support to icon upload#505
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #505 +/- ##
==========================================
+ Coverage 71.16% 71.17% +0.01%
==========================================
Files 222 222
Lines 18684 18678 -6
==========================================
- Hits 13296 13294 -2
+ Misses 4204 4201 -3
+ Partials 1184 1183 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zimeg
left a comment
There was a problem hiding this comment.
@srtaalej Super nice improvements to help troubleshooting! 📫
I'm hoping we can land a change or two more before this merges. One is in comments below but also I think we can remove these logs from output now too:
slack-cli/internal/pkg/apps/install.go
Line 534 in 560402d
slack-cli/internal/pkg/apps/install.go
Line 659 in 560402d
Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
zimeg
left a comment
There was a problem hiding this comment.
@srtaalej LGTM! Thanks for making those changes. I'm finding the following outputs in verbose logs for both endpoints with a ROSI app:
HTTP Request: POST https://slack.com/api/apps.hosted.icon HTTP/1.1
HTTP Request User-Agent: slack-cli/v4.0.1-ale-upload-icon-7-g59168bd (os: darwin)
HTTP Request Body: <binary image data, 265734 bytes>
HTTP Response Status: HTTP/1.1 200 OK
HTTP Response Body:
{"ok":true}HTTP Request: POST https://slack.com/api/apps.icon.set HTTP/1.1
HTTP Request User-Agent: slack-cli/v4.0.1-ale-upload-icon-7-g59168bd (os: darwin)
HTTP Request Body: <binary image data, 265734 bytes>
HTTP Response Status: HTTP/1.1 200 OK
HTTP Response Body:
{"ok":true}
Changelog
Add verbose debug logging and retry support to icon upload API calls.
Summary
This PR refactors
uploadIconto useDoWithRetryinstead of callinghttpClient.Dodirectly, matching the pattern used by all other API methods. It adds verbose debug logging for icon upload requests and responses and automatic retry on rate limits for icon uploadsAddresses review feedback from #469 (comment)
Test plan
go test ./internal/api/ -run Iconpassesmake buildthenslack run -e set-icon --verbosefrom a project withicon.png— confirmHTTP request/response details appear in verbose logs without binary noise
Requirements