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

Enable auto update #40

Merged
merged 2 commits into from
Oct 28, 2019
Merged

Enable auto update #40

merged 2 commits into from
Oct 28, 2019

Conversation

mast-eu
Copy link
Member

@mast-eu mast-eu commented Oct 25, 2019

Proposed change

  • Re-enable the self-update functionality that has been temporarily disabled in Disable PM auto update #24.
  • Add the license file to the NuGet package. This has no functional impact, but is just to avoid warnings when checking the package.

@mast-eu mast-eu added this to the 1.1.0 milestone Oct 25, 2019
@mast-eu mast-eu self-assigned this Oct 25, 2019
@mast-eu
Copy link
Member Author

mast-eu commented Oct 25, 2019

@maraf : I tried to test this with the following setup:

  1. Create a local test feed with an "artificial" package PluginManager v2.0.0 (just modified version number and re-built the package locally).
  2. Launch the PM built from this PR (i.e. with auto-update enabled as in the original version).
  3. Add the test feed from step 1) to the list of package sources and search it for packages.

-> it finds the PluginManager v2.0.0 as expected, but I cannot install it. The button is always grayed out.
image

First I thought I messed up the local feed somehow. Thus I added another package (GitExtensions.SVN) to it. This one can be installed and updated as expected.
image
Therefore I think there must be some problem specific to the self-update mechanism, but I fail to see it. Any hints?
For cross-checking, here is the test feed that I created and used for testing: TestFeed.zip

@maraf
Copy link
Member

maraf commented Oct 26, 2019

@mast-eu Updates can be done only on the tab "Updates". I think there is something in behind why I had to implement it this way.
At least, we should somehow tell this to the end user.

@mast-eu
Copy link
Member Author

mast-eu commented Oct 26, 2019

You're right that it's an update, not a fresh install. I should have included other screenshots.

However, the PM is not shown neither in the "Updates" tab:
image

nor in the "Installed" tab:
image

The packages.config file looks ok to me:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="GitExtensions.PluginManager" version="0.0.0.1" />
  <package id="GitExtensions.SVN" version="0.2.1.24" />
</packages>

The log file confirms that the packages were found as expected:

27/10/2019 00:00:11 root.Search(DEBUG)

Searching - user text:''; feed query:' tags:GitExtensions'.

27/10/2019 00:00:11 root.Search(DEBUG)

Loading page '0'.

27/10/2019 00:00:11 root.Search(DEBUG)

Searching in 'file:///C:/Users/Martin/Desktop/TestFeed'.

27/10/2019 00:00:11 root.Search(DEBUG)

Found 'GitExtensions.PluginManager.2.0.0.1'.

27/10/2019 00:00:11 root.Search(DEBUG)

Package added.

27/10/2019 00:00:11 root.Search(DEBUG)

Found 'GitExtensions.SVN.0.2.3.26'.

27/10/2019 00:00:11 root.Search(DEBUG)

Package added.

27/10/2019 00:00:11 root.Search(DEBUG)

Search completed. Found '2' items.

So I expected to be able to update to PM 2.0.0, but that's not working. Or at least I cannot figure out how to make it work.

@maraf
Copy link
Member

maraf commented Oct 27, 2019

I'll take a look.

@maraf
Copy link
Member

maraf commented Oct 27, 2019

Well, update works in a quite complicated way...

Quick solution:

Place package with PM in currently installed version in the test feed.

image

image

How it works

Aft first, update uses NuGetInstallService.GetInstalledAsync to get list of installed packages. The source of truth is packages.confg, but there is not enough information, so it also uses currently selected feed(s) to fetch all data it requires. This is the problem here. If user selects feed without current version of installed package, it just ignores that package.

Than it uses selected feed(s) to look for newer versions on installed packages and offers udpates.

In a production environment it works quite good, because package X is in feed A, and also the newer version is in the same feed.

failed.log
success.log

@mast-eu
Copy link
Member Author

mast-eu commented Oct 28, 2019

Place package with PM in currently installed version in the test feed.

Confirm it's working. Thanks.

If user selects feed without current version of installed package, it just ignores that package.

This means that the package for v1.1.0 already needs to be published on nuget.org. Otherwise any later self-update would not work.
That's not a problem. Just something to be aware of while preparing the release.

@mast-eu mast-eu changed the title WIP: Enable auto update Enable auto update Oct 28, 2019
@mast-eu mast-eu requested a review from maraf October 28, 2019 17:32
@mast-eu mast-eu merged commit 35e16e6 into gitextensions:master Oct 28, 2019
@mast-eu mast-eu deleted the EnableAutoUpdate branch October 28, 2019 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants