Skip to content

feat: support png, jpg, jpeg, gif for icon auto-detection#509

Open
srtaalej wants to merge 2 commits intomainfrom
ale-icon-assets-fallback
Open

feat: support png, jpg, jpeg, gif for icon auto-detection#509
srtaalej wants to merge 2 commits intomainfrom
ale-icon-assets-fallback

Conversation

@srtaalej
Copy link
Copy Markdown
Contributor

@srtaalej srtaalej commented Apr 27, 2026

Summary

  • Extracts resolveIconPath function to centralize icon fallback logic used by both Install and InstallLocalApp
  • Searches for icon.{png,jpg,jpeg,gif} in assets/ first, then project root — matching all formats the API accepts
  • Updates hasValidIconPath() in slack_yaml.go to also recognize jpg, jpeg, gif in assets/
  • PNG has highest priority when multiple icon files exist

Test plan

  • go test ./internal/pkg/apps/ -run Test_resolveIconPath — 11 cases covering all formats, priority, and fallback paths
  • go test ./internal/shared/types/ -run Test_SlackYaml — existing + new cases for jpg/gif detection
  • Manual: place icon.jpg in assets/, run ./bin/slack run -e set-icon — verify icon uploads
  • Manual: place icon.png in project root only — verify root fallback still works
  • Manual: set icon in manifest — verify it takes precedence over auto-detection

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.
@srtaalej srtaalej requested a review from a team as a code owner April 27, 2026 19:46
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.17%. Comparing base (1a7c949) to head (23afd93).

Files with missing lines Patch % Lines
internal/pkg/apps/install.go 0.00% 4 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zimeg zimeg changed the title fix: add assets/icon.png fallback for icon auto-detection feat: add assets/icon.png fallback for icon auto-detection Apr 27, 2026
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.
@srtaalej srtaalej changed the title feat: add assets/icon.png fallback for icon auto-detection feat: support png, jpg, jpeg, gif for icon auto-detection Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant