Skip to content

chore: improve coder server ux #14761

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

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Sep 23, 2024

Closes coder/internal#54.

Currently, coder server doesn't take any steps to ensure the access URL it outputs stands out among the initial stream of logs.
To address this, this PR:

  • Wraps the access URL in a colourful box (ANSI bright blue (12) box, ANSI magenta (5) hyperlink)
    image

  • Opens the access URL in the default browser, if the BROWSER env var is set, and if outputting to a TTY. Can be disabled using --no-open. This is the same behaviour as coder login.

  • Improves the naming of some loggers, as some logs were previously duplicated with no indication as to why.

  • Changes some startup logs from info to debug

The full startup output is now:

$ coder server
Coder v2.15.0-devel+0dc2a89b9 - Your Self-Hosted Remote Development Platform
Started HTTP listener at http://127.0.0.1:3000
Using built-in PostgreSQL (/home/coder/.config/coderv2/postgres)
╔═════════════════════════════╗
║      View the Web UI:       ║
║   https://www.example.com   ║
╚═════════════════════════════╝

==> Logs will stream in below (press ctrl+c to gracefully exit):
2024-09-23 13:46:54.105 [info]  provisionerd-dev-0: successfully connected to coderd
2024-09-23 13:46:54.105 [info]  provisionerd-dev-1: successfully connected to coderd
2024-09-23 13:46:54.107 [info]  provisionerd-dev-2: successfully connected to coderd
2024-09-23 13:46:54.128 [info]  provisionerd-dev-2: detected terraform version  installed_version=1.9.2  min_version=1.1.0  max_version=1.9.9
2024-09-23 13:46:54.128 [info]  provisionerd-dev-0: detected terraform version  installed_version=1.9.2  min_version=1.1.0  max_version=1.9.9
2024-09-23 13:46:54.129 [info]  provisionerd-dev-1: detected terraform version  installed_version=1.9.2  min_version=1.1.0  max_version=1.9.9

I'd argue the remaining info level logs are appropriate, I think something like how many provisioners are running, and what terraform version they're running are worth outputting by default, but very much open to thoughts.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ethanndickson and the rest of your teammates on Graphite Graphite

@ethanndickson ethanndickson force-pushed the 09-23-chore_improve_coder_server_ux branch from bf8650d to 0dc2a89 Compare September 23, 2024 05:36
@ethanndickson ethanndickson marked this pull request as ready for review September 23, 2024 05:42
@ethanndickson ethanndickson force-pushed the 09-23-chore_improve_coder_server_ux branch from 0dc2a89 to c628077 Compare September 23, 2024 13:50
@ammario
Copy link
Member

ammario commented Sep 23, 2024

Looks clean. Thank you.

@ethanndickson ethanndickson merged commit b894407 into main Sep 24, 2024
27 checks passed
@ethanndickson ethanndickson deleted the 09-23-chore_improve_coder_server_ux branch September 24, 2024 03:16
@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2024
@dannykopping
Copy link
Contributor

@ethanndickson heads up: this seems to open the access URL even if it's a slim build (and therefore has no UI bundled).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate preventing log spam from burying access URL on initial setup
5 participants