feat: support png, jpg, jpeg, gif for icon auto-detection#509
Open
feat: support png, jpg, jpeg, gif for icon auto-detection#509
Conversation
The icon upload fallback only checked for icon.png in the project root. This adds assets/icon.png as the first fallback path, matching the convention used by slack-samples template repos and the existing auto-detection in slack_yaml.go.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #509 +/- ##
==========================================
- Coverage 71.17% 71.17% -0.01%
==========================================
Files 222 222
Lines 18678 18682 +4
==========================================
+ Hits 13294 13296 +2
- Misses 4201 4206 +5
+ Partials 1183 1180 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Extract resolveIconPath to centralize icon fallback logic across
Install and InstallLocalApp. Search for icon.{png,jpg,jpeg,gif}
in assets/ then project root, matching all formats the API accepts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resolveIconPathfunction to centralize icon fallback logic used by bothInstallandInstallLocalAppicon.{png,jpg,jpeg,gif}inassets/first, then project root — matching all formats the API acceptshasValidIconPath()inslack_yaml.goto also recognize jpg, jpeg, gif inassets/Test plan
go test ./internal/pkg/apps/ -run Test_resolveIconPath— 11 cases covering all formats, priority, and fallback pathsgo test ./internal/shared/types/ -run Test_SlackYaml— existing + new cases for jpg/gif detectionicon.jpginassets/, run./bin/slack run -e set-icon— verify icon uploadsicon.pngin project root only — verify root fallback still worksiconin manifest — verify it takes precedence over auto-detection