Skip to content

Commit 90a234c

Browse files
Merge latest main while preserving docs search functionality
Made-with: Cursor
2 parents 7987235 + 1ab5496 commit 90a234c

112 files changed

Lines changed: 2894 additions & 1177 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CLAUDE.local.md
2+
settings.local.json
3+
worktrees/
4+
plans/

.claude/CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ make lint # Run golangci-lint
3131
golangci-lint --version # Verify linter version
3232
```
3333

34+
### Formatting
35+
36+
Always run `gofmt -w` on changed Go files after making edits to ensure proper formatting.
37+
3438
### Other Commands
3539

3640
```bash

.github/workflows/dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
ref: main
5757
token: ${{ steps.credentials.outputs.token }}
5858
- name: Install Golang
59-
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
59+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
6060
with:
6161
go-version: "stable"
6262
- name: Get the latest version

.github/workflows/e2e_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- name: Trigger CircleCI 'local' workflow
2424
if: ${{ github.event.inputs.status == 'false' }}
25-
uses: promiseofcake/circleci-trigger-action@496d15304c6aa005448272c214d59928560de90c # v2.0.4
25+
uses: promiseofcake/circleci-trigger-action@a72a9ff0b0c663613c13e47d53301ea55d7da5d9 # v3.0.1
2626
with:
2727
user-token: ${{ secrets.CIRCLECI_TOKEN }}
2828
project-slug: slackapi/slack-cli
@@ -31,7 +31,7 @@ jobs:
3131
payload: '{"run_local_build_test_workflow": true}'
3232
- name: Trigger CircleCI 'e2e' workflow
3333
if: ${{ github.event.inputs.status == 'true' }}
34-
uses: promiseofcake/circleci-trigger-action@496d15304c6aa005448272c214d59928560de90c # v2.0.4
34+
uses: promiseofcake/circleci-trigger-action@a72a9ff0b0c663613c13e47d53301ea55d7da5d9 # v3.0.1
3535
with:
3636
user-token: ${{ secrets.CIRCLECI_TOKEN }}
3737
project-slug: slackapi/slack-cli

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fetch-depth: 0
2424
persist-credentials: false
2525
- name: Set up Go
26-
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
26+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
2727
with:
2828
go-version: "1.26.0"
2929
- name: Lint
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
persist-credentials: false
5757
- name: Set up Go
58-
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
58+
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
5959
with:
6060
go-version: "1.26.0"
6161
- name: Report health score

.gitignore

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
bin/
33
slack
44
slack-cli
5-
hermes
6-
hermes-project*
5+
slack-cli.exe
76
my-slack-app*
87
coverage.out
98

109
# Release artifacts
1110
.gon.hcl
1211

1312
# Slack app files
14-
.hermes
1513
.slack/
1614
environments.yaml
1715

@@ -39,7 +37,3 @@ package-lock.json
3937

4038
# End to End Test files
4139
test-e2e
42-
43-
# Claude Code local files
44-
.claude/settings.local.json
45-
CLAUDE.local.md

cmd/app/add.go

Lines changed: 4 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ package app
1616

1717
import (
1818
"context"
19-
"fmt"
2019

2120
"github.com/slackapi/slack-cli/internal/app"
2221
"github.com/slackapi/slack-cli/internal/cmdutil"
2322
"github.com/slackapi/slack-cli/internal/config"
2423
"github.com/slackapi/slack-cli/internal/experiment"
25-
"github.com/slackapi/slack-cli/internal/logger"
2624
"github.com/slackapi/slack-cli/internal/pkg/apps"
2725
"github.com/slackapi/slack-cli/internal/prompts"
2826
"github.com/slackapi/slack-cli/internal/shared"
@@ -186,11 +184,8 @@ func RunAddCommand(ctx context.Context, clients *shared.ClientFactory, selection
186184

187185
clients.Config.ManifestEnv = app.SetManifestEnvTeamVars(clients.Config.ManifestEnv, selection.App.TeamDomain, selection.App.IsDev)
188186

189-
// Set up event logger
190-
log := newAddLogger(clients, selection.Auth.TeamDomain)
191-
192187
// Install dev app or prod app to a workspace
193-
installedApp, installState, err := appInstall(ctx, clients, log, selection, orgGrantWorkspaceID)
188+
installedApp, installState, err := appInstall(ctx, clients, selection, orgGrantWorkspaceID)
194189
if err != nil {
195190
return ctx, installState, types.App{}, err // pass the installState because some callers may use it to handle the error
196191
}
@@ -201,74 +196,19 @@ func RunAddCommand(ctx context.Context, clients *shared.ClientFactory, selection
201196
return ctx, installState, installedApp, nil
202197
}
203198

204-
// newAddLogger creates a logger instance to receive event notifications
205-
func newAddLogger(clients *shared.ClientFactory, envName string) *logger.Logger {
206-
return logger.New(
207-
// OnEvent
208-
func(event *logger.LogEvent) {
209-
teamName := event.DataToString("teamName")
210-
appName := event.DataToString("appName")
211-
switch event.Name {
212-
case "app_install_manifest":
213-
// Ignore this event and format manifest outputs in create/update events
214-
case "app_install_manifest_create":
215-
_, _ = clients.IO.WriteOut().Write([]byte(style.Sectionf(style.TextSection{
216-
Emoji: "books",
217-
Text: "App Manifest",
218-
Secondary: []string{
219-
fmt.Sprintf(`Creating app manifest for "%s" in "%s"`, appName, teamName),
220-
},
221-
})))
222-
case "app_install_manifest_update":
223-
_, _ = clients.IO.WriteOut().Write([]byte("\n" + style.Sectionf(style.TextSection{
224-
Emoji: "books",
225-
Text: "App Manifest",
226-
Secondary: []string{
227-
fmt.Sprintf(`Updated app manifest for "%s" in "%s"`, appName, teamName),
228-
},
229-
})))
230-
case "app_install_start":
231-
_, _ = clients.IO.WriteOut().Write([]byte("\n" + style.Sectionf(style.TextSection{
232-
Emoji: "house",
233-
Text: "App Install",
234-
Secondary: []string{
235-
fmt.Sprintf(`Installing "%s" app to "%s"`, appName, teamName),
236-
},
237-
})))
238-
case "app_install_icon_success":
239-
iconPath := event.DataToString("iconPath")
240-
_, _ = clients.IO.WriteOut().Write([]byte(
241-
style.SectionSecondaryf("Updated app icon: %s", iconPath),
242-
))
243-
case "app_install_icon_error":
244-
iconError := event.DataToString("iconError")
245-
_, _ = clients.IO.WriteOut().Write([]byte(
246-
style.SectionSecondaryf("Error updating app icon: %s", iconError),
247-
))
248-
case "app_install_complete":
249-
_, _ = clients.IO.WriteOut().Write([]byte(
250-
style.SectionSecondaryf("Finished in %s", event.DataToString("installTime")),
251-
))
252-
default:
253-
// Ignore the event
254-
}
255-
},
256-
)
257-
}
258-
259199
// printAddSuccess will print a list of the environments
260200
func printAddSuccess(clients *shared.ClientFactory, cmd *cobra.Command, appInstance types.App) error {
261201
return runListCommand(cmd, clients)
262202
}
263203

264204
// appInstall will install an app to a team. It supports both local and deployed app types.
265-
func appInstall(ctx context.Context, clients *shared.ClientFactory, log *logger.Logger, selection *prompts.SelectedApp, orgGrantWorkspaceID string) (types.App, types.InstallState, error) {
205+
func appInstall(ctx context.Context, clients *shared.ClientFactory, selection *prompts.SelectedApp, orgGrantWorkspaceID string) (types.App, types.InstallState, error) {
266206
if selection != nil && selection.App.IsDev {
267207
// Install local dev app to a team
268-
installedApp, _, installState, err := appInstallDevAppFunc(ctx, clients, "", log, selection.Auth, selection.App)
208+
installedApp, _, installState, err := appInstallDevAppFunc(ctx, clients, "", selection.Auth, selection.App)
269209
return installedApp, installState, err
270210
} else {
271-
installState, installedApp, err := appInstallProdAppFunc(ctx, clients, log, selection.Auth, selection.App, orgGrantWorkspaceID)
211+
installState, installedApp, err := appInstallProdAppFunc(ctx, clients, selection.Auth, selection.App, orgGrantWorkspaceID)
272212
return installedApp, installState, err
273213
}
274214
}

cmd/app/delete.go

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020

2121
"github.com/slackapi/slack-cli/internal/cmdutil"
2222
"github.com/slackapi/slack-cli/internal/iostreams"
23-
"github.com/slackapi/slack-cli/internal/logger"
2423
"github.com/slackapi/slack-cli/internal/pkg/apps"
2524
"github.com/slackapi/slack-cli/internal/prompts"
2625
"github.com/slackapi/slack-cli/internal/shared"
@@ -99,30 +98,14 @@ func RunDeleteCommand(ctx context.Context, clients *shared.ClientFactory, cmd *c
9998
}
10099
}
101100

102-
// Set up event logger and execute the command
103-
log := newDeleteLogger(clients, cmd, team)
104-
log.Data["appID"] = selection.App.AppID
105-
env, err := apps.Delete(ctx, clients, log, team, selection.App, selection.Auth)
106-
107-
return env, err
108-
}
101+
// Execute the command
102+
env, teamName, err := apps.Delete(ctx, clients, team, selection.App, selection.Auth)
103+
if err != nil {
104+
return env, err
105+
}
106+
printDeleteApp(ctx, clients, selection.App.AppID, teamName)
109107

110-
// newDeleteLogger creates a logger instance to receive event notifications
111-
func newDeleteLogger(clients *shared.ClientFactory, cmd *cobra.Command, envName string) *logger.Logger {
112-
ctx := cmd.Context()
113-
return logger.New(
114-
// OnEvent
115-
func(event *logger.LogEvent) {
116-
appID := event.DataToString("appID")
117-
teamName := event.DataToString("teamName")
118-
switch event.Name {
119-
case "on_apps_delete_app_success":
120-
printDeleteApp(ctx, clients, appID, teamName)
121-
default:
122-
// Ignore the event
123-
}
124-
},
125-
)
108+
return env, nil
126109
}
127110

128111
func confirmDeletion(ctx context.Context, IO iostreams.IOStreamer, app prompts.SelectedApp) (bool, error) {

cmd/app/uninstall.go

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020

2121
"github.com/slackapi/slack-cli/internal/cmdutil"
2222
"github.com/slackapi/slack-cli/internal/iostreams"
23-
"github.com/slackapi/slack-cli/internal/logger"
2423
"github.com/slackapi/slack-cli/internal/pkg/apps"
2524
"github.com/slackapi/slack-cli/internal/prompts"
2625
"github.com/slackapi/slack-cli/internal/shared"
@@ -94,30 +93,14 @@ func RunUninstallCommand(ctx context.Context, clients *shared.ClientFactory, cmd
9493
}
9594
}
9695

97-
// Set up event logger and execute the command
98-
log := newUninstallLogger(clients, cmd, teamDomain)
99-
log.Data["appID"] = selection.App.AppID
100-
env, err := apps.Uninstall(ctx, clients, log, teamDomain, selection.App, selection.Auth)
101-
102-
return env, err
103-
}
96+
// Execute the command
97+
env, teamName, err := apps.Uninstall(ctx, clients, teamDomain, selection.App, selection.Auth)
98+
if err != nil {
99+
return env, err
100+
}
101+
printUninstallApp(ctx, clients, selection.App.AppID, teamName)
104102

105-
// newUninstallLogger creates a logger instance to receive event notifications
106-
func newUninstallLogger(clients *shared.ClientFactory, cmd *cobra.Command, envName string) *logger.Logger {
107-
ctx := cmd.Context()
108-
return logger.New(
109-
// OnEvent
110-
func(event *logger.LogEvent) {
111-
appID := event.DataToString("appID")
112-
teamName := event.DataToString("teamName")
113-
switch event.Name {
114-
case "on_apps_uninstall_app_success":
115-
printUninstallApp(ctx, clients, appID, teamName)
116-
default:
117-
// Ignore the event
118-
}
119-
},
120-
)
103+
return env, nil
121104
}
122105

123106
func confirmUninstall(ctx context.Context, IO iostreams.IOStreamer, cmd *cobra.Command, selection prompts.SelectedApp) (bool, error) {

cmd/auth/auth_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"testing"
2020

2121
"github.com/slackapi/slack-cli/internal/hooks"
22-
"github.com/slackapi/slack-cli/internal/logger"
2322
"github.com/slackapi/slack-cli/internal/shared"
2423
"github.com/slackapi/slack-cli/internal/shared/types"
2524
"github.com/slackapi/slack-cli/internal/slackcontext"
@@ -32,7 +31,7 @@ type listMockObject struct {
3231
mock.Mock
3332
}
3433

35-
func (m *listMockObject) MockListFunction(ctx context.Context, clients *shared.ClientFactory, log *logger.Logger) ([]types.SlackAuth, error) {
34+
func (m *listMockObject) MockListFunction(ctx context.Context, clients *shared.ClientFactory) ([]types.SlackAuth, error) {
3635
args := m.Called()
3736
return args.Get(0).([]types.SlackAuth), args.Error(1)
3837
}

0 commit comments

Comments
 (0)