Skip to content

Commit 6f92582

Browse files
authored
feat(bolt-install): added --experiment=bolt-install (#88)
1 parent dede31d commit 6f92582

6 files changed

Lines changed: 17 additions & 11 deletions

File tree

cmd/app/add_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func TestAppAddCommandPreRun(t *testing.T) {
103103
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
104104
cf.SDKConfig.WorkingDirectory = "."
105105
cm.AddDefaultMocks()
106-
cm.Config.ExperimentsFlag = append(cm.Config.ExperimentsFlag, experiment.BoltFrameworks)
106+
cm.Config.ExperimentsFlag = append(cm.Config.ExperimentsFlag, string(experiment.BoltFrameworks))
107107
cm.Config.LoadExperiments(ctx, cm.IO.PrintDebug)
108108
mockProjectConfig := config.NewProjectConfigMock()
109109
mockProjectConfig.On("GetManifestSource", mock.Anything).Return(config.ManifestSourceRemote, nil)
@@ -115,7 +115,7 @@ func TestAppAddCommandPreRun(t *testing.T) {
115115
Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) {
116116
cf.SDKConfig.WorkingDirectory = "."
117117
cm.AddDefaultMocks()
118-
cm.Config.ExperimentsFlag = append(cm.Config.ExperimentsFlag, experiment.BoltFrameworks)
118+
cm.Config.ExperimentsFlag = append(cm.Config.ExperimentsFlag, string(experiment.BoltFrameworks))
119119
cm.Config.LoadExperiments(ctx, cm.IO.PrintDebug)
120120
mockProjectConfig := config.NewProjectConfigMock()
121121
mockProjectConfig.On("GetManifestSource", mock.Anything).Return(config.ManifestSourceLocal, nil)

cmd/manifest/info_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func TestInfoCommand(t *testing.T) {
133133
},
134134
}, nil)
135135
cf.AppClient().Manifest = manifestMock
136-
cm.Config.ExperimentsFlag = append(cm.Config.ExperimentsFlag, experiment.BoltFrameworks)
136+
cm.Config.ExperimentsFlag = append(cm.Config.ExperimentsFlag, string(experiment.BoltFrameworks))
137137
cm.Config.LoadExperiments(ctx, cm.IO.PrintDebug)
138138
mockProjectConfig := config.NewProjectConfigMock()
139139
mockProjectConfig.On("GetManifestSource", mock.Anything).Return(config.ManifestSourceLocal, nil)
@@ -162,7 +162,7 @@ func TestInfoCommand(t *testing.T) {
162162
cf.SDKConfig.WorkingDirectory = "."
163163
cm.IO.AddDefaultMocks()
164164
cm.Os.AddDefaultMocks()
165-
cm.Config.ExperimentsFlag = append(cm.Config.ExperimentsFlag, experiment.BoltFrameworks)
165+
cm.Config.ExperimentsFlag = append(cm.Config.ExperimentsFlag, string(experiment.BoltFrameworks))
166166
cm.Config.LoadExperiments(ctx, cm.IO.PrintDebug)
167167
mockProjectConfig := config.NewProjectConfigMock()
168168
mockProjectConfig.On("GetManifestSource", mock.Anything).

docs/guides/using-slack-cli-with-bolt-frameworks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ View more samples
2626

2727
You will then be prompted to choose between **Bolt for JavaScript** or **Bolt for Python**. Choose your favorite flavor.
2828

29-
Your app will be cloned from the respective [JavaScript](https://github.com/slack-samples/bolt-js-starter-template) or [Python](https://github.com/slack-samples/bolt-python-starter-template) project template on our Slack Platform Sample Code repository, and its project dependencies will be installed. Then, `cd` into your project folder.
29+
Your app will be cloned from the respective [JavaScript](https://github.com/slack-samples/bolt-js-starter-template) or [Python](https://github.com/slack-samples/bolt-python-starter-template) project template on our Slack Platform Sample Code repository, and its project dependencies will be installed. Then, `cd` into your project folder.
3030

3131
:::info
3232

3333
For Bolt for Python projects, automatic project dependency installation is currently unsupported, and will need to be done manually. For more information, refer to [Getting started with Bolt for Python](https://tools.slack.dev/bolt-python/getting-started).
3434

3535
:::
3636

37-
To run your new app, use the `slack run` command with the experiment flag as follows:
37+
To run your new app, use the `slack run` command as follows:
3838

3939
```
4040
slack run
4141
```
4242

43-
You'll be prompted to choose your team/workspace, and then your app should let you know that it's up and running. 🎉
43+
You'll be prompted to choose your team/workspace, and then your app should let you know that it's up and running. 🎉

docs/reference/experiments.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ The Slack CLI has an experiment flag, behind which we put features under develop
66

77
The following is a list of currently available experiments. We may remove an experiment once the feature is released.
88

9-
* `read-only-collaborators`: enables creating and modifying collaborator permissions via the `slack collaborator` commands.
9+
* `bolt-install`: enables creating, installing, and running Bolt projects that manage their app manifest on app settings (remote manifest).
10+
* `read-only-collaborators`: enables creating and modifying collaborator permissions via the `slack collaborator` commands.

internal/experiment/experiment.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ type Experiment string
3232
const (
3333
// BoltFrameworks experiment adds CLI support for Bolt JavaScript & Bolt Python.
3434
// These frameworks will be introducing remote function support.
35-
BoltFrameworks = "bolt"
35+
BoltFrameworks Experiment = "bolt"
36+
37+
// BoltInstall experiment enables developerInstall to work with Bolt projects that
38+
// manage their app manifest on app settings (remote manifest).
39+
BoltInstall Experiment = "bolt-install"
3640

3741
// The ReadOnlyAppCollaborators experiment enables creating and modifying collaborator
3842
// permissions via the `collaborator` commands.
@@ -46,6 +50,7 @@ const (
4650
// AllExperiment is a list of all available experiments that can be enabled
4751
var AllExperiments = []Experiment{
4852
BoltFrameworks,
53+
BoltInstall,
4954
ReadOnlyAppCollaborators,
5055
Placeholder,
5156
}

internal/pkg/apps/install_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ func TestInstall(t *testing.T) {
539539
clientsMock.AppClient.Manifest = manifestMock
540540
mockProjectConfig := config.NewProjectConfigMock()
541541
if tt.mockBoltExperiment {
542-
clientsMock.Config.ExperimentsFlag = append(clientsMock.Config.ExperimentsFlag, experiment.BoltFrameworks)
542+
clientsMock.Config.ExperimentsFlag = append(clientsMock.Config.ExperimentsFlag, string(experiment.BoltFrameworks))
543543
clientsMock.Config.LoadExperiments(ctx, clientsMock.IO.PrintDebug)
544544
mockProjectConfig.On("GetManifestSource", mock.Anything).Return(tt.mockManifestSource, nil)
545545
}
@@ -982,7 +982,7 @@ func TestInstallLocalApp(t *testing.T) {
982982
clientsMock.AppClient.Manifest = manifestMock
983983
mockProjectConfig := config.NewProjectConfigMock()
984984
if tt.mockBoltExperiment {
985-
clientsMock.Config.ExperimentsFlag = append(clientsMock.Config.ExperimentsFlag, experiment.BoltFrameworks)
985+
clientsMock.Config.ExperimentsFlag = append(clientsMock.Config.ExperimentsFlag, string(experiment.BoltFrameworks))
986986
clientsMock.Config.LoadExperiments(ctx, clientsMock.IO.PrintDebug)
987987
mockProjectConfig.On("GetManifestSource", mock.Anything).Return(tt.mockManifestSource, nil)
988988
}

0 commit comments

Comments
 (0)