Skip to content

fix: avoid icon upload without experiment for non-hosted apps#506

Merged
srtaalej merged 7 commits intomainfrom
ale-update-icon
Apr 28, 2026
Merged

fix: avoid icon upload without experiment for non-hosted apps#506
srtaalej merged 7 commits intomainfrom
ale-update-icon

Conversation

@srtaalej
Copy link
Copy Markdown
Contributor

@srtaalej srtaalej commented Apr 20, 2026

Summary

  • Without the set-icon experiment enabled, non-hosted (Bolt) apps were still attempting to upload an icon via apps.hosted.icon, which is only valid for hosted apps
  • This fix routes icon uploads by app type: experiment on → apps.icon.set (works for all app types), experiment off + hosted → apps.hosted.icon, experiment off + non-hosted → skip
  • Adds a DEPRECATED comment on the apps.hosted.icon path per reviewer suggestion

Test plan

$ ./bin/slack run -e set-icon    # Bolt app: confirm icon uploads via apps.icon.set
$ ./bin/slack deploy             # Hosted app without experiment: confirm icon uploads via apps.hosted.icon
$ ./bin/slack run                # Bolt app without experiment: confirm icon upload is skipped
  • go test ./internal/pkg/apps/ -run Test_updateIcon — 6 cases covering all routing paths and error handling

Requirements

@srtaalej srtaalej self-assigned this Apr 20, 2026
@srtaalej srtaalej requested a review from a team as a code owner April 20, 2026 16:03
@srtaalej srtaalej added the semver:patch Use on pull requests to describe the release version increment label Apr 20, 2026
@srtaalej srtaalej marked this pull request as draft April 20, 2026 16:03
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.24%. Comparing base (809c2ee) to head (367a058).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/pkg/apps/install.go 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #506      +/-   ##
==========================================
+ Coverage   71.18%   71.24%   +0.06%     
==========================================
  Files         222      222              
  Lines       18680    18682       +2     
==========================================
+ Hits        13297    13310      +13     
+ Misses       4202     4189      -13     
- Partials     1181     1183       +2     

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

@srtaalej srtaalej marked this pull request as ready for review April 20, 2026 17:08
Copy link
Copy Markdown
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srtaalej I left a comment if we want to continue supporting the apps.hosted.icon after the experiment concludes. It's unclear to me if we should continue to support paths that reference this method right now 🔭

Comment on lines -662 to 666
if clients.Config.WithExperimentOn(experiment.SetIcon) {
if isHosted {
_, err = clients.API().Icon(ctx, clients.Fs, token, appID, iconPath)
} else if clients.Config.WithExperimentOn(experiment.SetIcon) {
_, err = clients.API().IconSet(ctx, clients.Fs, token, appID, iconPath)
} else {
_, err = clients.API().Icon(ctx, clients.Fs, token, appID, iconPath)
return nil
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪬 question: Are we hoping to have all uploads use apps.icon.set? I find this works as expected for hosted apps at the moment and am unsure that we need to change this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm agreed - i guess i was unsure whether or not we were completely dropping apps.hosted.icon support 🤔 should the experiment only work with apps.icon.set then?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srtaalej I understand apps.icon.set to be the replacement and preferred method for updating an app icon now! Please correct me if this is wrong, but we should use that while the experiment is active if so 🧪

@srtaalej srtaalej requested a review from zimeg April 21, 2026 16:23
Copy link
Copy Markdown
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srtaalej Thanks for these updates! I understand the fix this PR is addressing now and changes LGTM 🚢

Before merging I'm wondering if some PR formalities can be polished? The confusion I had most was in the intent of this PR. The title explains what the code does but not why this change was needed. I might suggest:

fix: avoid icon upload without experiment for non-hosted apps

Including a note in the description of when this might happen can be helpful in sharing about the issue as this is adjusting behavior in a current release. Perhaps with a changelog too?

The test plan also did not give me much to start with. Sharing the commands you used to test the development build with can make review faster for me if I can ask for that 🙏

Something brief gives a lot of focus and we can save unit test steps for CI:

$ slack run -e set-icon  # Confirm icon uploads for Bolt app

We should also add a bug label and milestone to this before we merge so our release notes find it in the right spot.

Comment thread internal/pkg/apps/install.go
@srtaalej srtaalej added the bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented label Apr 28, 2026
@srtaalej srtaalej changed the title fix: route icon upload by app type in updateIcon fix: avoid icon upload without experiment for non-hosted apps Apr 28, 2026
@srtaalej srtaalej added the changelog Use on updates to be included in the release notes label Apr 28, 2026
@srtaalej srtaalej added this to the Next Release milestone Apr 28, 2026
@srtaalej srtaalej merged commit f99323b into main Apr 28, 2026
8 checks passed
@srtaalej srtaalej deleted the ale-update-icon branch April 28, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented changelog Use on updates to be included in the release notes semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants