Git Product home page Git Product logo

pluginmanager's Introduction

PluginManager

NuGet based universal plugin manager

Preview

Nightly builds of PluginManager available at Appveyor - https://ci.appveyor.com/nuget/pluginmanager.

Appveyor

Build status

Command line arguments

PluginManager is designed to be a reusable tool to manage plugins distributed as nuget packages. As a standalone application, PluginManager supports these command line arguments:

  • --path (required) - A root path to a directory where to install packages.
  • --selfpackageid (optional) - A package id to indicate which package should be treated as a package for self update.
  • --dependencies (optional) - A comma separated list of package ids and versions that are required in package to be compatible (Eg. PluginContracts-v3.0,TestA,TestB-v1).
  • --monikers (optional) - A comma separated list of .NET framework monikers to filter package content during extraction (Eg. net461,netstandard2.0).
  • --processnamestokillbeforechange - A comma separated list of process names to be killed before any changes being processed (it is used to kill all instances of target application before installing/uninstalling dlls, that might be locked).

Icons

Some icons by Yusuke Kamiyamane.
Some other by Material Design.

pluginmanager's People

Contributors

dependabot[bot] avatar maraf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pluginmanager's Issues

Filtering packages only relevant to GitExtensions

When starting PackageManager from GitExtensions plugin, we should pass required dependency (to GitExtensions meta package), version of such package and required framework moniker.

TODO:

  • Filter by framework moniker.
  • Filter by required dependency.

Install any version of package

So those cases when user finds that latest version doesn't work and wants to try previous.

TODO:

  • NuGetInstallService.IsInstalled must check version.
  • Update to concrete version on Updates tab.
  • Remove Uninstall and Reinstall buttons from Browser tab.

"Package source" must remember user feeds

Whenever the manager is launched a user must type package feeds over and over.

It would be great if "Package source" remembered all user feeds in a similar fashion VS remembers all NuGet feeds.
It would also be great if user could browse multiple feeds at the same time, e.g. "All" feeds.

Install plugin

Extract NuGet package content from folder for .NET Framework.
Also download dependencies.

TODO:

  • Pass in target framework monikers.
  • Refactor repository creation.
  • Download required dependencies.
  • Handle errors Moved to #10.

Plugin versioning and GE compatibility

Right now I use these assumptions when pairing plugin version with GE version.

  • All patch versions are backward compatible.

    • Example: Plugin written for GE-v3.1.0 should be compatible with GE-v3.1.*.
  • Major and minor releases are in general considered not backward compatible.

    • Example: Plugin written for GE-v3.1.0 may not be compatible with GE-v3.2.*, nor GE-v4.*.*.
    • Plugin author should publish new version for each GE major and minor release.

This corresponds with plugin package dependency on GitExtensions.Plugins which is now typically defined as [2.51,2.52) and [3.0,3.1).

@RussKie Is it correct according to your experiences with GE versions?

Simplify bulk commands

As AsyncCommand has public method returning Task, we can use to implement bulk operations.

Crashes, if behind proxy

I tried the v0.2.0 version with GE v2.51 and it seems to crash...

  • I downloaded build artifacts from the release
  • I copied the build artifacts to <path>\GitExtensions\bin\Debug\Plugins
  • I started GE and loaded the plugin manager
  • I attempted to load artifacts (as per the screenshot on the main page) from https://www.myget.org/F/neptuo-gitextensions/api/v2
  • the plugin crashed
Unhandled Exception: NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://www.myget.org/F/neptuo-gitextensions/api/v2. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote name could not be resolved: 'proxy.bla.bla.bla.bla'
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
   at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.ProxyAuthenticationHandler.<SendAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.StsAuthenticationHandler.<SendAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.HttpSourceAuthenticationHandler.<SendAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Net.Http.HttpClient.<FinishSendAsyncUnbuffered>d__59.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.TimeoutUtility.<StartWithTimeout>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at NuGet.Protocol.HttpRetryHandler.<SendAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.HttpSource.<GetThrottledResponse>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.HttpSource.<ProcessResponseAsync>d__18`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ODataServiceDocumentUtils.<CreateODataServiceDocumentResourceV2>d__0.MoveNext()
   --- End of inner exception stack trace ---
   at ODataServiceDocumentUtils.<CreateODataServiceDocumentResourceV2>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.ODataServiceDocumentResourceV2Provider.<TryCreate>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__16`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.PackageSearchResourceV2FeedProvider.<TryCreate>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__16`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at PackageManager.Services.NuGetSearchService.<SearchAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at PackageManager.ViewModels.Commands.SearchCommand.<ExecuteAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Neptuo.Observables.Commands.AsyncCommand.<Execute>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at PackageManager.App.Main()

It looks like the plugin is unable to work behin proxy.

Expected:

  • the plugin handles errors gracefully and does not crash
  • the plugin works behind proxy

Tests

View models and commands

  • Install
  • Reinstall
  • Uninstall
  • UninstallAll
  • Update
  • UpdateAll

NuGet integration

  • NuGetSearchService
  • NuGetPackageContent
  • NuGetInstallService

Logging

Integrate logging into services.
Right now we have no way to determine why package is not included in search results.

  • Pass logger into NuGet library.
  • Log package filtering.
  • Log files being extracted/removed.
  • Display log somewhere.

Isn't compatible with GE v3

I've installed the plugin manager into GE v3 (the current master version) and it didn't appear under Plugins menu.
I haven't investigated it, I suspect the plugin may be missing MEF [Export(typeof(IGitPlugin))] decoration.

Stop search after some pages

When empty search term is allowed, we should stop search after some number of pages without result.

Why?
When user tries to search GE plugins in nuget.org feed, it will "never" stop the search.

Support multiple feeds

Replace "Package Source" textbox with dropdown (accepting new items as user input).
Include option "All feeds".

Feeds could also be named as in VS.
image

TODO:

  • CRUD for package sources.
  • Remove PackageSourceUrl parameter from plugin.
  • Remove PackageSourceUrl parameter from manager.
  • UI for selecting active source.
  • Validate unique source name.
  • Apply selected source in BL.
  • Update CLI.

Icon

As GE-v3 supports icon for plugins, add one.

Number of deployed files

The manager contains 120 files.
I can't help but think that bundling of the manager with GE may be a challenge because of this.

Is there a reason for shipping netstandard.dll, System.*.dll and Microsoft.*.dll?
I can somewhat understand Nuget.*.dll, and even though I think they can be bundled up into a single assembly with ILMerge (e.g. like https://gist.github.com/thoemmi/3724333)

Move the "Package sources" field into the "Browse" tab

I'd like to request a change to the main layout.

image

Right now a user needs to type in a URL to a feed in to the "Package source" field and then click a button on the "Browse" tab right of the "Search" field. This is an awkward UX.
The source field doesn't (feel like it) have any real connection to "Installed" or "Updates" tabs either.

Could you please move the "Package sources" field into the "Browse" tab above the "Search field".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.