-
Notifications
You must be signed in to change notification settings - Fork 881
chore: propose coder dotfiles command #1696
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
Conversation
I'm in favor of this approach for the community MVP 👍🏼 This ensures the workspace lifecycle is fully-managed at the template level, but also does not remove support for dotfiles (which has first class support in other remote development platforms). |
I really like this approach, especially that we can bake it into the
What do we do if something "weird" happens and we can't fast-forward to the remote branch? Bail? Force-reset? |
My default plan is to fallback to whatever the current personalize script from V1 does, which I think is just present the git error. Very much open to input on handling cases. |
I think just keeping v1 behaviour is legit for starts 👍 Down the line, I could imagine some additional fanciness, such as:
In both of those cases, we'd want to warn the user. |
I had no idea that GitHub documented a list of places to check for dotfiles init scripts, but that's really cool. I really like the simple addition of a command, and this integrates ✨ beautifully ✨ with |
It's simple UX, market-driven, easy to implement, etc. I did a cursory glance but I like the proposed solution. I defer to the other smart people in this thread to make the right call. |
I may be misunderstanding this, but it sounds like the above implementation is Terraform-specific. I also am not thrilled about this being under the project owner's control rather than the user's. |
It is not terraform specific, the It is up to the template owners to implement the call to |
I do understand that there's a use case where customers want the same dotfiles for everyone, so this serves that. I guess it doesn't get in the way of something user-driven. That just leaves me with the concern about it being Terraform specific. I think this is a good opportunity to consider the workspace lifecycle hooks idea. I think it's not too different in complexity, especially if we're just doing a start event initially, but it's more flexible and more general. |
Yes it will support any kind of commands for the startup script, so you could have it be: Up to the template owner. The |
I'm in favor of this approach as a first-step. |
This seems like a possible point of incompatibility. I'm not sure about Codespaces, but I just tested how dotfiles work on Gitpod, and it looks like they preserve the I guess ultimately, the decision of how to handle this is up to the template author. But if we plan to ship templates where the home directory is persistent, then to maximize compatibility, maybe we should provide a Or we could just punt on it for now, and warn users that the script may be run an undefined number of times. |
@dwahler that is a great point. I appreciate you doing this research into how others have solved similar problems. We currently have the expectation of idempotent install scripts in V1 (not that it's a total authority, but an existing expectation), and the coder dotfiles command itself is also idempotent. I feel pretty okay with that requirement today but I do see the divergence from the way others handle it. Another point is we don't really have an opinion on what persists, it's completely up to the template. I can see this being a good case for letting the command take in an argument for where to store the repo, so the caller can place it somewhere ephemeral if they'd like to. |
If we see this as the first lifecycle hook, I think we should reconsider the name |
I agree, but we should discuss in a dedicated issue so we can prioritize it correctly. I think it's doable to make these changes before community if we find it valuable. |
Closing now that the implementation is merged. |
This draft is an example of how a customer would interact with the coder dotfiles feature.
Talking with @jsjoeio and @bpmct we tried to come up with an ideal user experience for dotfiles. We want to support a simple dotfiles flow but don't want to require it on users or get in the way of them customizing the flow.
What I'm proposing:
startup_script
variable to add a script that callscoder dotfiles <url>
coder dotfiles
command to our cli that follows the following algorithms:example
directory of a template using thecoder dotfiles
flow.The general flow of the
coder dotfiles
command will be:.
You would fill in the dotfiles url during workspace creation like we currently do with "region" in dogfood:
