Skip to content

Support for updating extensions from CLI#45533

Merged
sandy081 merged 3 commits intomicrosoft:masterfrom
oriash93:oriash93/45072
Jul 2, 2018
Merged

Support for updating extensions from CLI#45533
sandy081 merged 3 commits intomicrosoft:masterfrom
oriash93:oriash93/45072

Conversation

@oriash93
Copy link
Contributor

resolves #45072

@tomzx
Copy link
Contributor

tomzx commented May 19, 2018

Isn't this missing the addition of a --upgrade-extension command line option?

@oriash93
Copy link
Contributor Author

@tomzx actually I meant to enable updating installed extensions under the same roof as installing.

@tomzx
Copy link
Contributor

tomzx commented May 19, 2018

@oriash93 Right. As per @joaomoreno's comment in #45072, adding an alias (such as --upgrade-extension) would make it clear that it will allow for the upgrade of an extension (while install-extension does not necessarily imply that).

This however points to issues:

  • If I call --install-extension with an already installed extension, should it automatically upgrade the extension to the latest version or should it simply do nothing?
  • If I call --upgrade-extension for an extension not yet installed, should I expect it to fail or should it silently install it?

@oriash93
Copy link
Contributor Author

@tomzx you made good points.

  • If you ask me I'd expect it to automatically upgrade the installed extension.
  • In this case, I'd expect it to fail with a message.

However, it's not my decision to make :)

@sandy081 sandy081 self-requested a review May 25, 2018 13:11
@sandy081 sandy081 added the extensions Issues concerning extensions label May 25, 2018
@sandy081 sandy081 added this to the June 2018 milestone May 25, 2018
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a check to early quit at line 117 if an extension is already installed. That check should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might also downgrade the extension. You should check if there is a newer version of extension in the market place. For eg here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

return TPromise.wrapError(new Error(`${notFound(id)}\n${useId}`));
}

console.log(localize('foundExtension', "Found '{0}' in the marketplace.", id));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the extension is not installed. I assume it will throw an exception now as it is not being checked.

There are three flows:

  1. Extension is not installed
  2. Extension is installed but update required
  3. Extension is installed and no update required.

I do not see where the first case is handled here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@sandy081
Copy link
Member

@oriash93 Changes look good. But before merging, please test if the changes are working and not breaking any other scenarios and let me know.

Thanks

@sandy081
Copy link
Member

@oriash93 Were you able to test if it works?

@oriash93
Copy link
Contributor Author

I meant to, but didn't get to :(

@sandy081
Copy link
Member

Have to wait until you test it for merging.

@sandy081 sandy081 modified the milestones: June 2018, July 2018 Jun 28, 2018
@sandy081 sandy081 closed this Jul 2, 2018
@sandy081 sandy081 reopened this Jul 2, 2018
@sandy081 sandy081 merged commit 6bf20cc into microsoft:master Jul 2, 2018
@oriash93 oriash93 deleted the oriash93/45072 branch July 2, 2018 18:13
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

extensions Issues concerning extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for updating extensions from CLI

4 participants