Skip to content

cli: add quickstart flow for new users#7807

Merged
marcosnils merged 1 commit into
dagger:mainfrom
marcosnils:feat/cli_quickstart
Jul 4, 2024
Merged

cli: add quickstart flow for new users#7807
marcosnils merged 1 commit into
dagger:mainfrom
marcosnils:feat/cli_quickstart

Conversation

@marcosnils
Copy link
Copy Markdown
Contributor

@marcosnils marcosnils commented Jul 2, 2024

This commit changes the CLI so it prints a custom Dagger Cloud trace URL
when the user is not logged in or no DAGGER_CLOUD_TOKEN has been set.

Additionally, a custom message gets printed at the end of dagger init
and fro any commands that the user supplied the -v or --debug flags.

Fixes DEV-4269 DEV-4268

Here's some screenshots about how the feature looks:

Log-in message when init is called and CLI is not authenticated
image

Full logged out trace URL:
image

Log-in message when -v is supplied:
image

The custom /traces/$id URL will take the user to the quickstart flow which will create a Dagger Cloud organization after logging in.

Signed-off-by: Marcos Lilljedahl marcosnils@gmail.com

@marcosnils marcosnils requested review from jpadams, levlaz, shykes and vito July 2, 2024 15:33
Comment thread engine/telemetry/cloud.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol 😆

Comment thread engine/client/client.go Outdated
@marcosnils marcosnils force-pushed the feat/cli_quickstart branch from 83fde7c to 6f09ee7 Compare July 4, 2024 14:43
@marcosnils
Copy link
Copy Markdown
Contributor Author

@jedevc just reverted the call prints and changed the URL to be more clear about signup. Mind taking one more quick 👀 ?

@marcosnils marcosnils requested a review from jedevc July 4, 2024 14:45
@jedevc
Copy link
Copy Markdown
Contributor

jedevc commented Jul 4, 2024

LGTM once lint/tests are passing 🎉 Also FYI to @helderco since you've been the person working on the cobra part of the CLI the most.

@marcosnils marcosnils force-pushed the feat/cli_quickstart branch 3 times, most recently from c01ed82 to f13d704 Compare July 4, 2024 17:01
This commit changes the CLI so it prints a custom Dagger Cloud trace URL
when the user is not logged in or no DAGGER_CLOUD_TOKEN has been set.

Additionally, a custom message gets printed at the end of `dagger init`
and fro any commands that the user supplied the `-v` or `--debug` flags.

Fixes DEV-4269 DEV-4268

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
@marcosnils marcosnils force-pushed the feat/cli_quickstart branch from f13d704 to 381b927 Compare July 4, 2024 18:22
@marcosnils marcosnils merged commit 240771e into dagger:main Jul 4, 2024
@marcosnils marcosnils deleted the feat/cli_quickstart branch July 4, 2024 19:08
@marcosnils
Copy link
Copy Markdown
Contributor Author

marcosnils commented Jul 4, 2024

merging as-is since the test failure is a flake.

Comment thread cmd/dagger/call.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: now this prints "Saved output to ..." instead of "Saved to ..." for Container, Directory, and File, which sounds a bit different, not sure if intentional (cc @helderco)

Copy link
Copy Markdown
Contributor Author

@marcosnils marcosnils Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was my bad since I didn't rebase with main before merging and this is something helder fixed recently. Will revert in a follow-up PR. Thx for bringing this up Alex.

Comment thread cmd/dagger/main.go
Comment on lines +176 to +184
case !ok &&
cmd.Flags().Changed("verbose") ||
cmd.Flags().Changed("debug") ||
cmd == moduleInitCmd:
fmt.Fprintf(cmd.ErrOrStderr(), `
Log-in or create an account to visualize %s in Dagger Cloud:
https://dagger.cloud/signup?quickstart=true

`, highlight.Render(`pipeline traces`))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this now - this should be !ok && (...) - since && has a higher precedence, it means that even when logged in, the message is still shown for debug and moduleInitCmd.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted, thx for reporting this one Justin <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants