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.17% 71.16% -0.02%
==========================================
Files 222 222
Lines 18684 18680 -4
==========================================
- Hits 13299 13294 -5
Misses 4203 4203
- Partials 1182 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
| return IconResult{}, err | ||
| } | ||
| defer resp.Body.Close() | ||
| c.io.PrintDebug(ctx, "HTTP Request: %v %v", request.Method, request.URL) |
There was a problem hiding this comment.
| c.io.PrintDebug(ctx, "HTTP Request: %v %v", request.Method, request.URL) | |
| c.io.PrintDebug(ctx, "HTTP Request: %v %v %v", request.Method, request.URL, request.Proto) |
🔭 suggestion: To match the entire request signature:
HTTP Request: POST https://slack.com/api/apps.icon.set HTTP/1.1
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