-
Notifications
You must be signed in to change notification settings - Fork 881
feat: store dotfiles url by user #10478
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
Comments
I really like option 2. It's a clean abstraction that can be per-template for users that create a lot of workspaces. |
For option 2. Could we also use browser cache/storage? cc: @BrunoQuaresma |
My understanding of option 2 is we would suggest the list of previously used values for the same parameter name (regardless of whether it's "dotfiles_url")? @matifali — I think we should lean on the DB here to provide a consistent experience since we already have the parameter data there. |
@ammario if we do want to use database then I think option 1 is better. We can just allow a user to specify their dotfiles in their account settings page. We can also run |
Option 1 is a non-starter to me, as it adds a new, opinionated "dotfiles" primitive to the product. I also don't see how using the database would make Option 1 better. We can go with Option 2 using what we already store in the DB. |
Option 3 would be awesome! I know that is the one that requires more development, but it is the more and predictable solution. Even we could do something like: data "coder_parameter" "dotfiles_uri" {
name = "What dotfiles repo would you like to use for your workspace?"
description = "Dotfiles repo URI (optional). See https://dotfiles.github.io"
icon = "/emojis/1f9f0.png"
default = "https://github.com/example/dotfiles.git"
+ default_env = "DOTFILES_URI" # This will load the environment variable configured in the user profile
mutable = false
} The cool thing about this approach is that we can extend it to whatever |
I agree that option 3 for generic user-specified |
This PR solves #10478 by auto-filling previously used template values in create and update workspace flows. I decided against explicit user values in settings for these reasons: * Autofill is far easier to implement * Users benefit from autofill _by default_ — we don't need to teach them new concepts * If we decide that autofill creates more harm than good, we can remove it without breaking compatibility
Problem statement
Currently developers must re-enter their Dotfiles URL every time they create a new workspace. Most developers are not using a diverse set of dotfile repositories, so this action becomes repetitive. To avoid tedious repetition, we can reduce the number of times Dotfiles URLs are repeated.
Implementation notes
Customers have suggested a few methods to allow users to store or cache their Dotfiles by account rather than by workspace.
Option 1 - User Storage
A straightforward system would allow users to store their dotfiles URL in the account settings. Then, the coder_parameter would be automatically filled with the account dotfiles URL, or simply be a boolean checkbox to “Clone Dotfile repository from account”.
Option 2 - Caching last used Dotfiles URL
The customer suggested that the Dotfiles parameter text could simply be pre-filled with the last repository entered for a given user. To extend this, the text field could also have a drop-down (possibly searchable) list of previously-entered Dotfile URLs sorted by usage. This list would be appended to with each new repository entered.
Option 3 - Generic user-wide parameters
To extend the capability of option 1, a generic user-wide parameter list could be created to store any variable currently used in coder_parameter's, similarly to how tokens are configured now. This functionality is better described here.
Impact
This is an annoyance for users that costs time during the creation of workspaces. For a more empirical measurement of impact, our Dotfiles module on the registry has over 2300 installs.
The text was updated successfully, but these errors were encountered: