Skip to content

Conversation

@bhack
Copy link
Contributor

@bhack bhack commented Feb 1, 2025

fixes #238697

@deepak1556 deepak1556 assigned rzhao271 and unassigned deepak1556 Feb 3, 2025
@deepak1556 deepak1556 added this to the February 2025 milestone Feb 3, 2025
@bhack bhack requested a review from 818Nawaf February 3, 2025 19:42
@wcbing
Copy link

wcbing commented Feb 4, 2025

Your method uses the modernize-sources subcommand to check, but several versions will prompt without this subcommand. So, I think it's better to determine it by the apt version number.

In fact, even Debian and Ubuntu versions that are not EOL now support DEB822 sources, so perhaps there's no need for the check.


You also need to modify the if-elif blocks on here to facilitate migration from old repository, or else they will conflict.

@bhack
Copy link
Contributor Author

bhack commented Feb 4, 2025

but several versions will prompt without this subcommand

I have not bisected this what is the starting point of this notification?

In my experience It seems to me very connected to modernize introduction.

@wcbing
Copy link

wcbing commented Feb 4, 2025

The missing Signed-By warning and migration consideration started with version 2.9.24, while the modernize-sources subcommand was added in 2.9.26.

In fact, even Debian and Ubuntu versions that are not EOL now support DEB822 sources, so perhaps there's no need for the check.

Do you think this is right?

@bhack
Copy link
Contributor Author

bhack commented Feb 4, 2025

I suppose it was introduced since APT 1.1

@bhack
Copy link
Contributor Author

bhack commented Feb 4, 2025

I will wait for the vscode team's official feedback about what kind of behaviour we want to adopt.

@wcbing
Copy link

wcbing commented Feb 4, 2025

You did not change the gpg key location or embed it in the sources file as I mentioned.

@bhack
Copy link
Contributor Author

bhack commented Feb 4, 2025

You did not change the gpg key location or embed it in the sources file as I mentioned.

Cause I think this will require to handle also the removal case of the existing key.

So I think this could be introduced eventually in another PR.

@rzhao271 rzhao271 modified the milestones: February 2025, March 2025 Feb 21, 2025
@rzhao271
Copy link
Collaborator

rzhao271 commented Mar 3, 2025

Hi all, I finally got a chance to read through the PR.
I'm OK with the PR using the modernize-sources check, unless that check misses entire distributions that have apt stuck between 2.9.24 and 2.9.26 for some reason.
Could the PR also change the GPG key location to /usr/share/keyrings?

@bhack
Copy link
Contributor Author

bhack commented Mar 4, 2025

@rzhao271 Can you check now? Or we need to also migrate they key?

@rzhao271
Copy link
Collaborator

rzhao271 commented Mar 4, 2025

Saving the key to the new location looks good.
If the save is successful, I wonder whether it is safe to delete the old key from the old directory?

@rzhao271
Copy link
Collaborator

rzhao271 commented Mar 4, 2025

I confirmed the key is for packages.microsoft.com in general.
Could the postinst script also delete the key at the old location, /etc/apt/trusted.gpg.d/?
The postrm script also has to update CODE_TRUSTED_PART to point to the new location, /usr/share/keyrings.

@bhack
Copy link
Contributor Author

bhack commented Mar 5, 2025

It Is already pointing to that path. Do you want to add a removal?

@rzhao271
Copy link
Collaborator

rzhao271 commented Mar 5, 2025

Let me rephrase.

  1. Could postinst.template also delete the key at the old location, /etc/apt/trusted.gpg.d/, once the key has been saved to the new location, /usr/share/keyrings?
  2. Could postrm.template (which is not yet part of your PR) set CODE_TRUSTED_PART to the new location, /usr/share/keyrings?

@bhack
Copy link
Contributor Author

bhack commented Mar 18, 2025

Do you plan to make another review?

@rzhao271
Copy link
Collaborator

Not yet, because you haven't implemented either of #239390 (comment). I currently plan to merge the PR early next month.

@rzhao271 rzhao271 modified the milestones: March 2025, April 2025 Mar 18, 2025
@rzhao271
Copy link
Collaborator

rzhao271 commented Apr 4, 2025

Thanks for the addition, bhack!
I have been busy this week with some other items, meaning it might take me until next Week 1 aka debt week for me to test and then approve this PR.

@bhack
Copy link
Contributor Author

bhack commented Apr 4, 2025

I don't have a local env to test it so it is a bit of a black box PR that it rely on CI for verification.

@rzhao271
Copy link
Collaborator

rzhao271 commented Apr 4, 2025

No problem. The change also requires a custom build to fully test, and I have been creating custom builds behind the scenes and testing them on a Linux VM.

I have confirmed that this PR requires some more changes.

  1. The script currently assumes that if the user has already written their own source file, that we don't have to move the key for them, either. In reality, if the key is in the old location, we should rewrite the user's source file anyway and move the key for them.
  2. The postrm script currently removes the .list file, but it does not remove the new .source file. It should now remove the new .source file instead.

Edit: I have added more specific comments to the PR files themselves.

bhack and others added 3 commits April 5, 2025 01:30
Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
Check new key path
@bhack
Copy link
Contributor Author

bhack commented May 6, 2025

New apt updated the user message

Policy will reject signature within a year, see --audit for details
N: Some sources can be modernized. Run 'apt modernize-sources' to do so.

@rzhao271
Copy link
Collaborator

rzhao271 commented May 6, 2025

Confirmed with a custom Insiders build that the changes LGTM.

@rzhao271 rzhao271 enabled auto-merge (squash) May 6, 2025 23:03
@rzhao271 rzhao271 merged commit 76c064b into microsoft:main May 6, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jun 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VS Code APT sources.list: add signed-by field and remove unnecessary architectures

5 participants