gitkraken / gk-cli

GitKraken CLI Releases and Documentation
https://www.gitkraken.com
Other
122 stars 48 forks source link

[BUG] `gk focus` panic in local workspace #31

Closed Elkiwa closed 8 months ago

Elkiwa commented 8 months ago

Description

  1. Having a default local workspace with 2 repos, I added Github as a provider
  2. Use gk focus command
PS D:\dev\Elkiwa\Main> gk settings
- Default workspace: ScoopInstaller
- Max display items: 30
- Max concurrency: 3
- Clone protocol: ssh
- Open default:

GitKraken CLI Version

1.2.2

OS Version

Git Version

git version 2.43.0.windows.1

Logs, Screenshots, Screen Captures, URLs, etc

PS D:\dev\Elkiwa\Main> gk focus
Using default workspace: ScoopInstaller
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x40 pc=0x18cb134]

goroutine 1 [running]:
github.com/gitkraken/cli/pkg/infrastructure/domain.UserRestRepository.GetProviderUserInfo({{_, _}, {_, _}, {_, _}, {_, _}}, {{0xc000031050, 0x24}, ...}, ...)
        /Users/runner/work/cli/cli/pkg/infrastructure/domain/user_rest_repository.go:94 +0xf4
github.com/gitkraken/cli/pkg/cmd/focus.NewCmdFocus.func2(0xc000144000, {0x1b7115b?, 0x4?, 0x1b71083?})
        /Users/runner/work/cli/cli/pkg/cmd/focus/focus.go:69 +0x448
github.com/spf13/cobra.(*Command).execute(0xc000144000, {0x375c5e0, 0x0, 0x0})
        /Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x87c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000145500)
        /Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x3a5
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext(0xc000122db0?, {0x2b0df88?, 0x375c5e0?})
        /Users/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:961 +0x47
main.main()
        /Users/runner/work/cli/cli/cmd/gk/main.go:55 +0x63a
trevor-polidore commented 8 months ago

Hi @Elkiwa, thanks for reporting this issue - the fix will be in the next release!

In the meantime, note that gk focus does not work with Local Workspaces. You must first convert it to a Cloud Workspace with gk ws create, selecting the "Cloud" option, and answering "Y" to the next question.

Elkiwa commented 8 months ago

Confirmed the issue has been resolved in version 1.3.0