Skip to content

feat: 'env' command no longer prompts for an app for Bolt projects#456

Merged
zimeg merged 3 commits intomainfrom
zimeg-fix-env-select-bolt
Apr 1, 2026
Merged

feat: 'env' command no longer prompts for an app for Bolt projects#456
zimeg merged 3 commits intomainfrom
zimeg-fix-env-select-bolt

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented Apr 1, 2026

Changelog

N/A - Fixes unreleased changes.

Summary

This PR defaults to project variables of env commands for Bolt applications while requiring app selection for ROSI projects 🥀

Resolves confusion of the scope these commands are applied to!

Preview

Bolt

bolt

ROSI

Local app

deno

Deployed app

ROSI

Reviewers

Please confirm the following works for various cases:

  1. Deployed ROSI app - "API" and selection
  2. Local ROSI app - ".env" and selection
  3. Deployed Bolt app - ".env" for project
  4. Local Bolt app - ".env" for project
$ slack create asdf  # Create either a Bolt or ROSI app
$ cd asdf
$ slack install      # Required for ROSI apps! Not Bolt!
$ slack env list
$ slack env add
$ slack env add
$ slack env list
$ slack delete

Notes

This follows changes of #437 and #451 which both "unlock" the env commands for local ROSI apps but I am unsure if we want to keep this change?

Requirements

@zimeg zimeg added this to the Next Release milestone Apr 1, 2026
@zimeg zimeg self-assigned this Apr 1, 2026
@zimeg zimeg requested a review from a team as a code owner April 1, 2026 19:18
@zimeg zimeg added bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch Use on pull requests to describe the release version increment area:deno-sdk Related to github.com/slackapi/deno-slack-sdk area:bolt-js Related to github.com/slackapi/bolt-js area:bolt-python Related to github.com/slackapi/bolt-python labels Apr 1, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 88.57143% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.96%. Comparing base (6958c8a) to head (550b1ab).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/env/add.go 85.71% 1 Missing and 1 partial ⚠️
cmd/env/list.go 85.71% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #456   +/-   ##
=======================================
  Coverage   70.95%   70.96%           
=======================================
  Files         220      220           
  Lines       18450    18466   +16     
=======================================
+ Hits        13092    13104   +12     
- Misses       4181     4183    +2     
- Partials     1177     1179    +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.

Copy link
Copy Markdown
Member Author

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

🗣️ Notes to self and others which is much the same-

Comment on lines +77 to +88
// isHostedRuntime returns true if the local manifest is for an app that uses
// the Deno Slack SDK function runtime.
//
// It defaults to false when the manifest cannot be fetched, which directs the
// command to use the project ".env" file. Otherwise the API is used.
func isHostedRuntime(ctx context.Context, clients *shared.ClientFactory) bool {
manifest, err := clients.AppClient().Manifest.GetManifestLocal(ctx, clients.SDKConfig, clients.HookExecutor)
if err != nil {
return false
}
return manifest.IsFunctionRuntimeSlackHosted() || manifest.IsFunctionRuntimeLocal()
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🔭 note: I'm not thrilled with the placement of this logic but we might want to keep it scoped to the env commands at this time?

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.

I'm surprised we don't have a helper function already, but I agree let's just scope it to env for now.

@mwbrooks mwbrooks added enhancement M-T: A feature request for new functionality and removed bug M-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented labels Apr 1, 2026
Copy link
Copy Markdown
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

✅ Yea, this is such a nice experience! 🎉 The note about adding creating the .env is also very helpful.

🧪 Works well for Deno Deployed, Deno Local, and Bolt Local apps.

✏️ I changed the label/title from bug/fix to enhancement/feat. This is a new feature for Bolt apps and I feel like it's an enhancement on the previous experience that required the app to be installed.

Comment on lines +77 to +88
// isHostedRuntime returns true if the local manifest is for an app that uses
// the Deno Slack SDK function runtime.
//
// It defaults to false when the manifest cannot be fetched, which directs the
// command to use the project ".env" file. Otherwise the API is used.
func isHostedRuntime(ctx context.Context, clients *shared.ClientFactory) bool {
manifest, err := clients.AppClient().Manifest.GetManifestLocal(ctx, clients.SDKConfig, clients.HookExecutor)
if err != nil {
return false
}
return manifest.IsFunctionRuntimeSlackHosted() || manifest.IsFunctionRuntimeLocal()
}
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.

I'm surprised we don't have a helper function already, but I agree let's just scope it to env for now.

@mwbrooks mwbrooks changed the title fix: default to project variables of env commands for bolt apps feat: 'env' command no longer prompts for an app for Bolt projects Apr 1, 2026
@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented Apr 1, 2026

@mwbrooks The framing is much better as an improvement of what landed before 🤓 ✨

Let's get this merged for a few more changes around the env commands. These make neat features I think! 🌲

@zimeg zimeg merged commit 24c1d2c into main Apr 1, 2026
8 checks passed
@zimeg zimeg deleted the zimeg-fix-env-select-bolt branch April 1, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bolt-js Related to github.com/slackapi/bolt-js area:bolt-python Related to github.com/slackapi/bolt-python area:deno-sdk Related to github.com/slackapi/deno-slack-sdk enhancement M-T: A feature request for new functionality 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