From f57f8767078d6f4ee07ed25849d6ebd9ac798486 Mon Sep 17 00:00:00 2001 From: Michael Brooks Date: Thu, 14 May 2026 16:24:18 -0700 Subject: [PATCH 1/2] fix: disable upgrade notification for the manifest info command --- internal/update/update.go | 16 ++++++++++------ internal/update/update_test.go | 11 ++++++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/internal/update/update.go b/internal/update/update.go index 0498e611..2059b58e 100644 --- a/internal/update/update.go +++ b/internal/update/update.go @@ -19,11 +19,11 @@ import ( "net/http" "os" "reflect" + "strings" "sync" "time" "github.com/slackapi/slack-cli/internal/api" - "github.com/slackapi/slack-cli/internal/goutils" "github.com/slackapi/slack-cli/internal/shared" "github.com/slackapi/slack-cli/internal/slackerror" "github.com/spf13/cobra" @@ -223,13 +223,17 @@ func (u *UpdateNotification) isCI() bool { // isIgnoredCommand returns true when the process is in the list of commands. func (u *UpdateNotification) isIgnoredCommand() bool { - ignoredCommands := []string{"_fingerprint", "api", "version"} - osStr := os.Args[0:] - if len(osStr) < 2 { + ignoredCommands := []string{"_fingerprint", "api", "manifest info", "version"} + if len(os.Args) < 2 { return false } - commandName := osStr[1] - return goutils.Contains(ignoredCommands, commandName, true) + commandStr := strings.Join(os.Args[1:], " ") + for _, ignored := range ignoredCommands { + if commandStr == ignored || strings.HasPrefix(commandStr, ignored+" ") { + return true + } + } + return false } // isLastUpdateCheckedAtGreaterThan returns true when the time since the last update check is greater diff --git a/internal/update/update_test.go b/internal/update/update_test.go index f1e28ab6..9f1b5c1b 100644 --- a/internal/update/update_test.go +++ b/internal/update/update_test.go @@ -17,6 +17,7 @@ package update import ( "context" "os" + "strings" "testing" "github.com/slackapi/slack-cli/internal/config" @@ -165,6 +166,14 @@ func Test_UpdateNotification_isIgnoredCommand(t *testing.T) { command: "version", expected: true, }, + "manifest info command": { + command: "manifest info", + expected: true, + }, + "manifest validate command": { + command: "manifest validate", + expected: false, + }, "auth command": { command: "auth", expected: false, @@ -172,7 +181,7 @@ func Test_UpdateNotification_isIgnoredCommand(t *testing.T) { } { t.Run(name, func(t *testing.T) { if tc.command != "" { - os.Args = []string{"placeholder", tc.command} + os.Args = append([]string{"placeholder"}, strings.Split(tc.command, " ")...) } else { os.Args = []string{"placeholder"} } From 33d7e0ce8baf25e4d25cd43185b45eacbeefa477 Mon Sep 17 00:00:00 2001 From: Michael Brooks Date: Fri, 15 May 2026 09:34:15 -0700 Subject: [PATCH 2/2] fix: also ignore the manifest command for upgrade notifications The top-level `manifest` command is an alias that runs `manifest info`, so it should also be ignored for upgrade notification checks. Co-Authored-By: Eden Zimbelman --- cmd/manifest/manifest.go | 2 ++ internal/update/update.go | 17 +++++++++++++++-- internal/update/update_test.go | 12 ++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/cmd/manifest/manifest.go b/cmd/manifest/manifest.go index 9f9d3a57..c2c2f3d7 100644 --- a/cmd/manifest/manifest.go +++ b/cmd/manifest/manifest.go @@ -72,6 +72,8 @@ func NewCommand(clients *shared.ClientFactory) *cobra.Command { clients.Config.SetFlags(cmd) return cmdutil.IsValidProjectDirectory(clients) }, + // DEPRECATED(semver:major): remove RunE so this command prints help like other parent commands + // and remove "manifest" from the ignore list in internal/update/update.go RunE: func(cmd *cobra.Command, args []string) error { return runInfoCommand(cmd, clients) }, diff --git a/internal/update/update.go b/internal/update/update.go index 2059b58e..1980fd02 100644 --- a/internal/update/update.go +++ b/internal/update/update.go @@ -223,15 +223,28 @@ func (u *UpdateNotification) isCI() bool { // isIgnoredCommand returns true when the process is in the list of commands. func (u *UpdateNotification) isIgnoredCommand() bool { - ignoredCommands := []string{"_fingerprint", "api", "manifest info", "version"} + // "manifest" is included because it's an alias that runs "manifest info" + ignoredCommands := []string{"_fingerprint", "api", "manifest", "manifest info", "version"} if len(os.Args) < 2 { return false } commandStr := strings.Join(os.Args[1:], " ") for _, ignored := range ignoredCommands { - if commandStr == ignored || strings.HasPrefix(commandStr, ignored+" ") { + if commandStr == ignored { return true } + // Match commands with additional flags (e.g. "manifest info --source local") + // but not subcommands (e.g. "manifest validate" should not match "manifest") + if strings.HasPrefix(commandStr, ignored+" ") { + rest := commandStr[len(ignored)+1:] + if strings.HasPrefix(rest, "-") { + return true + } + // Allow prefix match for multi-word commands (e.g. "manifest info --flag") + if strings.Contains(ignored, " ") { + return true + } + } } return false } diff --git a/internal/update/update_test.go b/internal/update/update_test.go index 9f1b5c1b..5799e7b7 100644 --- a/internal/update/update_test.go +++ b/internal/update/update_test.go @@ -166,10 +166,22 @@ func Test_UpdateNotification_isIgnoredCommand(t *testing.T) { command: "version", expected: true, }, + "manifest command": { + command: "manifest", + expected: true, + }, + "manifest command with flags": { + command: "manifest --source local", + expected: true, + }, "manifest info command": { command: "manifest info", expected: true, }, + "manifest info command with flags": { + command: "manifest info --source local", + expected: true, + }, "manifest validate command": { command: "manifest validate", expected: false,