Skip to content
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

User Scripts #5891

Closed
JRedOW opened this issue Sep 27, 2021 · 4 comments
Closed

User Scripts #5891

JRedOW opened this issue Sep 27, 2021 · 4 comments
Labels
meta: stale This issue/PR is stale and will be closed soon

Comments

@JRedOW
Copy link

JRedOW commented Sep 27, 2021

Explanation

Currently, there are user extensions, user vscode settings, and user environment variables. I propose that user tasks are added. They would be run at command (or in their own step), and can be configured in the dashboard like environment variables with a scope.

Reasoning

There are many tasks a user may want run in their workspaces without adding it to all their projects' configs (or other people's configs, which can't be edited by the user). A few examples I can think of are setting up gpg git signing, adding a WakaTime key, and installing some tool the user likes. There are many issues already that this feature would solve including #666.

Storage

User Tasks should be editable in the dashboard like user environment variables. The best way I can think to store them is as values like the current user environment variable system or editable bash files (I think this would be better, as they would be extremely flexible and easy to implement using prism).

If this issue shows some interest, I may try and implement a simple proof of concept.

@iQQBot
Copy link
Contributor

iQQBot commented Sep 28, 2021

user command or dotfiles repo? #5198
dotfiles also contain some init script

https://docs.github.com/en/codespaces/customizing-your-codespace/personalizing-codespaces-for-your-account#dotfiles

@svenefftinge
Copy link
Member

user command or dotfiles repo?

That's a really good question. One could argue that running a script is the more powerful abstraction, as I could clone any (dotfile) repo and run arbitrary initializers. OTOH automatically (and conveniently) applying the conventions of a user's dotfile repo certainly makes sense, too.

@JRedOW
Copy link
Author

JRedOW commented Sep 28, 2021

Dotfiles are definitely a possible alternative. In my opinion a mixing of the two ideas like the second storage option I listed (editable bash files in dashboard) would be the best option, as it gives almost as much customization as dotfiles, without the issue of loading a repository. Perhaps the user could even mark if the script was an init task or a command, matching the dotfile system. The one issue I see with dotfiles is the repository, as gitpod currently has no builtin system for mixing repositories (correct me if I'm wrong.) With all the different platforms to support (and hopefully soon regular git repositories) it seems like it would be a lot of extra work (and time) for the system to download the repo, search through the files, run them, then add the files to PATH. This would just increase the workspace start time (even with prebuilds), which is a major selling point of gitpod. I'd think it would be much easier and faster to just reuse the code from user environment variables and start tasks to run the scripts or add them to the PATH from the user settings. (Again, correct me if I am wrong.) This also allows for the individual scripts to have scopes too, which can't be done in dotfiles.

TL;DR Dotfiles in the Dashboard stored internally. Each script can be marked as init or command. Init ones are run at startup, command ones are stored in the PATH directory. This allows for scoped scripts that do not majorly increase start time.

PS: I'm changing the name to user scripts as I agree that scripts would be much more useful.

@JRedOW JRedOW changed the title User Tasks User Scripts Sep 28, 2021
@stale
Copy link

stale bot commented Dec 28, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Dec 28, 2021
@stale stale bot closed this as completed Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta: stale This issue/PR is stale and will be closed soon
Projects
None yet
Development

No branches or pull requests

3 participants