-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Fix: only add apt sources for users that want them (#22145) #221285
Conversation
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rzhao271 can you take this one? We need to be super careful of any changes here as a misstep could mean someone is stuck unknowingly on an old version.
96ed45a
to
5736c7a
Compare
Currently, vscode.list is added to /etc/apt/sources.d/ whenever it doesn't exist. With this patch, the new behaviour is as follows: 1. If the user already has the Microsoft source file installed for apt, sources won't be added 2. If the user sets debconf-set-selections to set code/add-microsoft-repo to false, the sources won't be added 3. If sources might be added, the script checks whether it makes sense to (over)write them (i.e. the file doesn't exist, is old or has been disabled during some OS upgrade) 4. If is makes sense and the code/add-microsoft-repo is not set, the user is asked to cofirm, whether they actually want Microsoft sources to be installed (setting code/add-microsoft-repo to the selected value) 5. Only if it makes sense and the user agrees, the sources are installed This change will mostly affect new users or those reinstalling vscode. Personally, I feel like the whole approach of automatically adding the repo is very invasive, and would prefer that it not be done at all. However, with this change, it is up to the user whether they want it to be installed or not. Since the default is set to true, users that install vscode in noninteractive environments get the current behavior. Existing users will either be asked once or never (depending on whther step 4 above gets triggered). New users will be asked unless they make a decision ahead of time using debconf-set-selections. With this, microsoft#22145 and duplicates should be sufficiently addressed. Signed-off-by: Matthias Breithaupt <m.breithaupt@vogl-electronic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rzhao271 let's make sure this gets verified and documented at the end of the month
This PR has not updated the installation docs https://github.com/microsoft/vscode-docs/blob/main/docs/setup/linux.md but in its current form, it introduced a breaking changed as unattended installations (e.g. CI) will now block and ask for user input
What gives? Hotfix: run |
@rzhao271 we should ensure that unattended installs work, either by explicit flag or the default. This was why the original proposal was an env variable; so those in the know could disable it easily but most users would get the easy "just works" setup. |
@andreineculau I mentioned the change in the release notes but forgot to update the docs. |
@rzhao271 I don't see relevant info in the release, but regardless - I think it's the docs that should be tip-top. As for using code/add-microsoft-repo or an env variable - I don't see that it matters. It may even be more idiomatic to leave it as is. Just 2c Appreciate it! 🙇 |
Currently, vscode.list is added to /etc/apt/sources.d/ whenever it doesn't exist. With this patch, the new behaviour is as follows:
This change will mostly affect new users or those reinstalling vscode. Personally, I feel like the whole approach of automatically adding the repo is very invasive, and would prefer that it not be done at all. However, with this change, it is up to the user whether they want it to be installed or not. Since the default is set to true, users that install vscode in noninteractive environments get the current behavior. Existing users will either be asked once or never (depending on whther step 4 above gets triggered). New users will be asked unless they make a decision ahead of time using debconf-set-selections.
With this, #22145 and duplicates should be sufficiently addressed.