Skip to content

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

Closed
stirby opened this issue Nov 1, 2023 · 8 comments
Closed

feat: store dotfiles url by user #10478

stirby opened this issue Nov 1, 2023 · 8 comments
Labels
roadmap https://coder.com/roadmap. Only humans may set this. stale This issue is like stale bread.

Comments

@stirby
Copy link
Collaborator

stirby commented Nov 1, 2023

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”.

Screenshot 2023-11-01 at 2 55 21 PM

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.

@stirby stirby added the feature label Nov 1, 2023
@matifali
Copy link
Member

matifali commented Nov 1, 2023

That would be super helpful. Issues #7087 , #7272 and #7280 are similar.

This is a duplicate of #7272. You may close one of these.

@kylecarbs
Copy link
Member

I really like option 2. It's a clean abstraction that can be per-template for users that create a lot of workspaces.

@matifali
Copy link
Member

matifali commented Nov 2, 2023

For option 2. Could we also use browser cache/storage? cc: @BrunoQuaresma
It could also work like password autofill works by suggesting last typed values.

@ammario
Copy link
Member

ammario commented Nov 4, 2023

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.

@matifali
Copy link
Member

matifali commented Nov 4, 2023

@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.
It could be made available via data.coder_workspace.me.dotfiles_url

We can also run coder dotfiles as part of agent init_script if a user has it specified under account settings. This approach will liberate template admins of configuring it in the template.

@ammario
Copy link
Member

ammario commented Nov 5, 2023

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.

@ammario ammario added the roadmap https://coder.com/roadmap. Only humans may set this. label Nov 8, 2023
@fcsonline
Copy link
Contributor

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 coder_parameter we have, not only the dotfiles one.

@aaronlehmann
Copy link
Contributor

I agree that option 3 for generic user-specified coder_parameter defaults would be really valuable. The dotfiles use case presented here makes a lot of sense, and I could also see this being very useful for things like region defaults (East Coast users can select the "US East" region as their default, etc.).

@ammario ammario self-assigned this Jan 12, 2024
ammario added a commit that referenced this issue Jan 30, 2024
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
@github-actions github-actions bot added the stale This issue is like stale bread. label Jul 11, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2024
@ammario ammario removed their assignment Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap https://coder.com/roadmap. Only humans may set this. stale This issue is like stale bread.
Projects
None yet
Development

No branches or pull requests

6 participants