Skip to content

feat: support icon path in project config.json#514

Open
srtaalej wants to merge 1 commit intomainfrom
ale-icon-config
Open

feat: support icon path in project config.json#514
srtaalej wants to merge 1 commit intomainfrom
ale-icon-config

Conversation

@srtaalej
Copy link
Copy Markdown
Contributor

@srtaalej srtaalej commented Apr 29, 2026

Summary

  • Adds an icon field to .slack/config.json so users can specify an icon path without modifying their app manifest
  • Icon resolution order: manifest icon field > config.json icon field > icon.png in project root
  • Adds GetIconPath / SetIconPath to ProjectConfigManager interface following the same patterns as GetProjectID / SetProjectID
  • Migrates existing tests in add_test.go and install_test.go to use AddDefaultMocks() instead of manually duplicating mock setup for ProjectConfigMock

Example config.json

{
  "icon": "assets/icon.png",
  "project_id": "abc-123"
}

Test plan

Unit tests

go test ./internal/config/ -run Test_ProjectConfig_GetIconPath -v   # 3 cases
go test ./internal/config/ -run Test_ProjectConfig_SetIconPath -v   # 3 cases
go test ./...                                                       # full suite

Manual testing

1. Build the branch

git fetch origin ale-icon-config
git checkout ale-icon-config
go build -o bin/slack .

2. Set up a test app (or use an existing bolt app)

./bin/slack create
cd <app-name>

3. Add an icon to config.json

Place an image file somewhere in the project (e.g. assets/icon.png), then add the path to .slack/config.json:

{
  "icon": "assets/icon.png",
  "project_id": "..."
}

4. Run with the set-icon experiment

../bin/slack run -e set-icon

Verify you see Updated app icon: assets/icon.png in the output.

5. Verify manifest takes precedence over config.json

Set icon in both the manifest (slack.yaml / manifest.ts) and config.json with different paths. Run again — the manifest path should be used.

6. Verify fallback to project root

Remove icon from both manifest and config.json. Place icon.png in the project root. Run again — should pick up icon.png.

Allow users to specify an icon path in .slack/config.json as an
alternative to the manifest icon field. Resolution order is:
manifest > config.json > icon.png in project root.

Also migrates tests to use AddDefaultMocks() for ProjectConfigMock
instead of manually setting up each mock method.
@srtaalej srtaalej requested a review from a team as a code owner April 29, 2026 15:29
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.27%. Comparing base (1a7c949) to head (54bc2bb).
⚠️ Report is 4 commits behind head on main.

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     #514      +/-   ##
==========================================
+ Coverage   71.17%   71.27%   +0.09%     
==========================================
  Files         222      222              
  Lines       18678    18704      +26     
==========================================
+ Hits        13294    13331      +37     
+ Misses       4201     4191      -10     
+ Partials     1183     1182       -1     

☔ 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.

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