-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lab mr create crashes when assigning to unknown usernames #827
Comments
Thanks for the well-written bug report and I can understand your pain :) ISTR we do save buffer output on errors with 'lab edit'. I think this should be possible to do with 'lab create'. I'll look into this. |
@twouters would be it be better to create the MR, and then write an error message to the console indicating that the user could not be found? |
Maybe also mention that the assignee can be changed with |
|
'lab mr create -a <username>' panics if someone specifies a username that doesn't exist: [prarit@prarit kernel-test]$ ~/Other/github/lab/lab mr create -a prarit123456 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc942b8] goroutine 1 [running]: github.com/zaquestion/lab/cmd.getUserIDs(0xc000242420, 0x1, 0x1, 0xc000034700, 0x0, 0x0) /home/prarit/Other/github/lab/cmd/util.go:662 +0x98 github.com/zaquestion/lab/cmd.runMRCreate(0x14a2940, 0xc0000fe540, 0x0, 0x2) /home/prarit/Other/github/lab/cmd/mr_create.go:347 +0x10e9 github.com/spf13/cobra.(*Command).execute(0x14a2940, 0xc0000fe520, 0x2, 0x2, 0x14a2940, 0xc0000fe520) /home/prarit/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x2c2 github.com/spf13/cobra.(*Command).ExecuteC(0x149c2c0, 0xc0000bc050, 0x5, 0x5) /home/prarit/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x375 github.com/spf13/cobra.(*Command).Execute(...) /home/prarit/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902 github.com/zaquestion/lab/cmd.Execute(0xc000790500) /home/prarit/Other/github/lab/cmd/root.go:218 +0xf5 main.main() /home/prarit/Other/github/lab/main.go:27 +0x74 Fix the panic and output a warning that the username doesn't exist, and continue to create the merge request. Fixes zaquestion#827 Reported-by: GitHub User twouters Signed-off-by: Prarit Bhargava <prarit@redhat.com>
'lab mr create -a <username>' panics if someone specifies a username that doesn't exist: [prarit@prarit kernel-test]$ ~/Other/github/lab/lab mr create -a prarit123456 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xc942b8] goroutine 1 [running]: github.com/zaquestion/lab/cmd.getUserIDs(0xc000242420, 0x1, 0x1, 0xc000034700, 0x0, 0x0) /home/prarit/Other/github/lab/cmd/util.go:662 +0x98 github.com/zaquestion/lab/cmd.runMRCreate(0x14a2940, 0xc0000fe540, 0x0, 0x2) /home/prarit/Other/github/lab/cmd/mr_create.go:347 +0x10e9 github.com/spf13/cobra.(*Command).execute(0x14a2940, 0xc0000fe520, 0x2, 0x2, 0x14a2940, 0xc0000fe520) /home/prarit/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:860 +0x2c2 github.com/spf13/cobra.(*Command).ExecuteC(0x149c2c0, 0xc0000bc050, 0x5, 0x5) /home/prarit/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x375 github.com/spf13/cobra.(*Command).Execute(...) /home/prarit/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:902 github.com/zaquestion/lab/cmd.Execute(0xc000790500) /home/prarit/Other/github/lab/cmd/root.go:218 +0xf5 main.main() /home/prarit/Other/github/lab/main.go:27 +0x74 Fix the panic and output a warning that the username doesn't exist, and continue to create the merge request. Fixes #827 Reported-by: GitHub User twouters Signed-off-by: Prarit Bhargava <prarit@redhat.com>
lab mr create -a <username>
throws a segmentation fault when a username doesn't exist on a gitlab instance (because of typo's or just forgetting the actual username or whatever).This is especially annoying because I usually run into this after writing lengthy MR descriptions and have to start typing it all over again.
Could it be changed to first check if users actually exist before initiating the editor to edit MERGEREQ_EDITMSG, or catch these (or similar) errors and save/cache the submitted MR description somewhere so that it can be retried?
The text was updated successfully, but these errors were encountered: