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

Rely on UUIDs for extension identification #34812

Closed
joaomoreno opened this issue Sep 22, 2017 · 6 comments
Closed

Rely on UUIDs for extension identification #34812

joaomoreno opened this issue Sep 22, 2017 · 6 comments
Assignees
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality on-testplan
Milestone

Comments

@joaomoreno
Copy link
Member

Extension identification is essential to the update mechanism. It is through an identifier that we're able to match several extension versions against one another.

We are currently using the publisher.name tuple as an identifier. This is very beneficial in some scenarios such as VSIX side-loading, in which updates would still work seamlessly.

The Marketplace team intends to provide publisher/extension renames. This will break our assumptions that the publisher.name tuple is valid during its entire lifecycle. So we must only rely on the marketplace UUID returned from the Marketplace, which will stay consistent in renaming situations.

This needs to be adopted in a few places:

  • We should store the marketplace UUID into the extension's manifest, as soon as we are aware of it. Installing extensions from the Marketplace should immediately store that UUID.
  • Internally, extension matching should always be based on UUID. This should be the stored marketplace UUID or, in case it is nonexistent, the tuple publisher.name.
  • Our outdated mechanism currently prevents the loading of and deletes older versions of an extension, if multiple versions are installed into the user's extensions folder.
  • At startup, whenever an installed extension is found without UUID, we should attempt to match it against a marketplace extension and, if matched, store that UUID.
  • At VSIX installation time, we should attempt to match the extension against a marketplace extension and, if installed and matched, store that UUID.

cc @sandy081

@joaomoreno joaomoreno added extensions Issues concerning extensions feature-request Request for new features or functionality labels Sep 22, 2017
@joaomoreno joaomoreno added this to the Backlog milestone Sep 22, 2017
@jens1o
Copy link
Contributor

jens1o commented Sep 22, 2017

Maybe then you can implement that an extension can be renamed. @Binaryify had that problem.

@Binaryify
Copy link

@jens1o
you are awesome!

@seanmcbreen
Copy link

Adding a few more items (so I don't forget)

  • any related recommendations should be updated as soon as feasible e.g. we should use the UUID for these not publisher.name
  • any place on the website where we have a curated list will also need to be updated
  • we should also check for any links we have in the docs
  • the welcome page has a few extensions in there we need to also update those
  • ActivatePlugin, 'ext:install', 'ext:update', 'ext:delete' should also include UUID

Sean

@sandy081 sandy081 self-assigned this Oct 24, 2017
@sandy081 sandy081 modified the milestones: Backlog, October 2017 Oct 24, 2017
@sandy081
Copy link
Member

sandy081 commented Oct 24, 2017

Implementation

  • Market place extensions and Installed extensions has a combined identifier called IExtensionIdentifier that contains UUID provided by Market place and id that is pub.name.

  • An Extensions identity function to compare two IExtensionIdentifers. They are called same if both have UUIDs and are same or both ids are same.

  • Market place extensions will have both UUID and id whereas Installed extension has id and might have UUID (An extension installed from Market place will have UUID but a VSIX installed extension will not have).

  • An Installed extension is mapped to a Market place extension primarily by its UUID if exist, otherwise by pub.name.

  • Extension enablement deals with only IExtensionIdentfier. Its storage is migrated from pub.name to IExtensionIdentifer.

  • Run time extensions also contain UUID and id similar to IExtensionIdentifier and can be used in the extension identity function.

  • An Extension defined in workspace recommendations and dependencies is treated unpublished, if it is renamed.

Test cases

Extensions Installed from Marketplace

An extension is installed from Marketplace and

  1. syncs with Marketplace and has no updates
  2. syncs with Marketplace and has a normal update
  3. syncs with Marketplace and has a rename
  4. syncs with Marketplace and has a rename and update

VSIX Extensions

An extension is installed through VSIX and

  1. does not sync with Marketplace
  2. syncs with Marketplace and has no updates
  3. syncs with Marketplace and has a normal update
  4. syncs with Marketplace that has a rename, if rename has happened after VSIX was installed

Update

  1. Update an extension when an update available and not renamed.
  2. Update an extension that is renamed and an update is available.

Enablement / Disablement

  1. An extension that was disabled and is not renamed
  2. An extension that was disabled and got renamed
  3. An extension is shown disabled if it is installed but not running.
  4. Disabling an extension per workspace or globally and enable back.

Recommendations and Dependencies

  1. An Extension defined in workspace recommendations and dependencies is treated unpublished and ignored, if it is renamed.

@shanalikhan
Copy link

shanalikhan commented Oct 31, 2017

and "settings sync" extension is broken for insiders with this change 😄
As currently i am not using CLI for downloading extension ( i have on backlog though )
shanalikhan/code-settings-sync#428

@sandy081
Copy link
Member

@shanalikhan Not sure if I understand, Can you explain how does this change broke your extension?

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality on-testplan
Projects
None yet
Development

No branches or pull requests

6 participants