-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Print information after login #19029
Conversation
components/local-app/cmd/login.go
Outdated
@@ -66,7 +66,8 @@ var loginCmd = &cobra.Command{ | |||
|
|||
err = auth.SetToken(loginOpts.Host, token) | |||
if err != nil { | |||
slog.Warn("could not write token to keyring, storing in config file instead", "err", err) | |||
slog.Debug("could not write token to keyring, storing in config file instead") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error is omitted 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works like a charm.
#19029 (comment) feels like worth addressing here, but otherwise .
components/local-app/cmd/whoami.go
Outdated
// printWhoami prints information about the currently logged in user | ||
func whoami(ctx context.Context, client *client.Gitpod, gpctx *config.ConnectionContext) ([]whoamiResult, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: there's a mismatch between the function name and its doc
components/local-app/cmd/login.go
Outdated
@@ -66,7 +66,8 @@ var loginCmd = &cobra.Command{ | |||
|
|||
err = auth.SetToken(loginOpts.Host, token) | |||
if err != nil { | |||
slog.Warn("could not write token to keyring, storing in config file instead", "err", err) | |||
slog.Debug("could not write token to keyring, storing in config file instead") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be worth checking slog.Level
here to omit duplicate output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a common function
Description
Once login is successful, we now print more details about the login user. It's essentially the same as running "Who am I?" right after the login.
Summary generated by Copilot
🤖 Generated by Copilot at cffb2f4
This pull request enhances the user experience of the local-app
login
andwhoami
commands. It adds more logging and feedback for thelogin
command, and simplifies the code for both commands by using thecontext
package and a shared helper function.Related Issue(s)
Fixes EXP-886
How to test
Documentation
Preview status
gitpod:summary
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold