-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Task doesn't run on folder open anymore #160174
Comments
cc @alexr00 you fixed this in the past |
I certainly caused this w the task reconnection - will look into it |
this is working for me now - likely fixed with one of my recent PRs related to automatic tasks |
Sorry, this doesn't work |
@jrieken you need to allow automatic tasks to run. have you run |
autotasks.mov |
Screen.Recording.2022-09-27.at.15.29.13.mov |
Why is this now needed? I have trusted this workspace and I have run this exact task successfully in the past? |
it's always been needed. if you've ever hit disallow, it won't work. once you've allowed for the folder once, you shouldn't have to again |
I doubt that's true. When I hit allow it writes a workspace setting and that wasn't needed, it came in via #154171. I have been using this feature years before this change - albeit infrequently in side projects. I already have the |
#154171 was added to prevent these tasks from running automatically without consent of the user in a workspace that may or may not have been set up /configured by them. |
some people can find it jarring and unwanted if they run automatically - even if they trust the workspace and happen to have that in their tasks.json file |
If I'm remembering right there was always an opt-in via notification (maybe requiring engaging with the task system before it shows?). Whether a task runs on startup is a user preference, so instead of a hidden preference stored in local storage, tasks has moved to a setting. Is the problem that there was no migration to the setting? |
Yes I think so |
Looping in @alexr00 for reference but if I remember correctly this notification was the workaround for the lack of workspace trust. We prompted folks with an FYI to ask them for consent - similar prompts existed for eslint or tsserver and workspace trust is the answer
No. This is a workspace configuration file which means "team preference". It is the same as using source maps for debugging or not. Or what typescript version to use etc. Also, the "Manage Automatic Tasks in Folder" writes a workspace setting not a user setting |
It was added here #64613, derived from this terminal change #23362. The discussion in the terminal feature request is here: #19758. I did remember some of this wrong after digging into it and it was added primarily for security, but it's not the only reason for it now. The UX of this is an important part that was refined over time and carried over to terminal profiles; I have a preference of never wanting a workspace to modify my default terminal profile, regardless of whether I trust it.
@jrieken I disagree, I've always had auto run tasks disabled as I want to control when they run. This was a consideration when the notification was added. Source maps are a bad comparison as if they work they're almost always a better experience (though I often disable them to access ran variable names).
Yes, we simplified it from opt-in to auto running tasks per workspace as that's handled by workspace trust now, to simply "am I a user who wants to enable auto run tasks?". That seems like it aligns with you wanting to have them always enabled and me wanted to have them always disabled. |
I also have many my preferences but the team preferences overrule them: source maps, prettier, lint rules etc pp. That's part of agreeing what are team and personal settings. As a side note: I am not aware that auto tasks have ever been a topic for us (VS Code) and I also don't see any of them in our task.json file. Don't get me wrong: I am happy with a "overrule team decision and go with my preference" path. I think this applies to a few none-critical things, like I want that for source maps. Anyways, the implementation for auto-run task is poor:
|
My initial feeling about this was if the folder is trusted, the tasks should run automatically when configured to do so. Several points I encountered when I raised this were: the manage automatic tasks command has been around for a long time and we didn't want to remove it for those that are used to it The setting would make it easier and more discoverable to manage automatic tasks. I am in favor of removing the prompt per folder and respecting 1) a trusted workspace 2) the setting as configured via the actions or directly. I am also in favor of making this a user setting instead of a workspace/folder specific one. |
I like that but the action shouldn't write a workspace-setting because task.json is already a "workspace setting". I would argue this should only be allowed as user-setting (which I believe our settings model supports). Also, the default should be |
Yes I meant as a user setting and agree with you re untrusted workspaces
|
We're bringing this to the UX sync to decide what the right approach is |
Proposal: Untrusted: ❌ automatic tasks |
Approved in the UX sync |
Storage target will now be user and storage scope will be profile |
task.json
has a"runOn": "folderOpen"
-scriptThe text was updated successfully, but these errors were encountered: