Skip to content

feat: support SLACK_CLI_APP_ICON_PATH env var for icon override#519

Open
srtaalej wants to merge 2 commits intomainfrom
ale-icon-env-var
Open

feat: support SLACK_CLI_APP_ICON_PATH env var for icon override#519
srtaalej wants to merge 2 commits intomainfrom
ale-icon-env-var

Conversation

@srtaalej
Copy link
Copy Markdown
Contributor

@srtaalej srtaalej commented May 1, 2026

Summary

  • Add SLACK_CLI_APP_ICON_PATH environment variable support to override the app icon path at install/deploy time
  • Enables setting different icons per environment (dev/staging/prod) without changing project files
  • Priority chain: SLACK_CLI_APP_ICON_PATH env var > manifest icon field > icon.png in project root
  • Extracts shared resolveIconPath helper used by both Install() (hosted) and InstallLocalApp() (non-hosted) flows

Test plan

Unit tests

  • go test ./internal/config/ -run Test_DotEnv — env var loading (set, empty, whitespace trimming)
  • go test ./internal/pkg/apps/ -run Test_resolveIconPath — all 8 priority chain scenarios

Manual testing

From a Slack app project directory with assets/icon.png:

  1. Baseline — default icon via slack run

    ./bin/slack run -e set-icon

    Confirm output shows Updated app icon: assets/icon.png

  2. Override via env var

    export SLACK_CLI_APP_ICON_PATH=icon.png
    ./bin/slack run -e set-icon

    Confirm output shows Updated app icon: icon.png

  3. Invalid env var path falls back

    export SLACK_CLI_APP_ICON_PATH=/nonexistent/icon.png
    ./bin/slack run -e set-icon

    Confirm warning about file not found and fallback to manifest/default icon

  4. Unset env var restores default

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

    Confirm output shows Updated app icon: assets/icon.png

🤖 Generated with Claude Code

Allow users to override the app icon path via the SLACK_CLI_APP_ICON_PATH
environment variable, enabling different icons per environment without
changing project files.

Priority chain: env var > manifest icon > icon.png in project root.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@srtaalej srtaalej requested a review from a team as a code owner May 1, 2026 18:57
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.30%. Comparing base (783ac1a) to head (95ded37).

Files with missing lines Patch % Lines
internal/pkg/apps/install.go 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #519      +/-   ##
==========================================
+ Coverage   71.25%   71.30%   +0.04%     
==========================================
  Files         222      222              
  Lines       18682    18690       +8     
==========================================
+ Hits        13311    13326      +15     
+ Misses       4190     4184       -6     
+ Partials     1181     1180       -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