-
Notifications
You must be signed in to change notification settings - Fork 1k
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
install latest plugin when the modules are not released for the latest neo-cli #3229
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the warning
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you test it @superboyiii ? LGTM
{ | ||
// If the corresponding version of the plugin is not found, get the latest version | ||
jsonRelease = json.AsArray() | ||
.OrderByDescending(s => Version.Parse(s["tag_name"]!.GetValue<string>()?.TrimStart('v'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version.Parse
will crash if it's null
. or we have a tag_name
that isn't valid format.
We should wait for |
This has nothing to do with modules. I am just dealing with something else. |
Maybe we should download from |
@Jim8y |
if (latestVersion < pluginVersion) | ||
{ | ||
// If the latest version is lower than the locally passed version, use https://github.com/neo-project/neo-modules/releases/latest/download to get the latest version | ||
var latestDownloadUrl = $"https://github.com/neo-project/neo-modules/releases/latest/download/{pluginName}.zip"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to change the url to neo now, also for DownloadUrl
, could you do it @Jim8y ?
…gins * 'latest-plugins' of github.com:Jim8y/neo: (21 commits) fix: custom plugins won't shown by command `plugins` (neo-project#3269) COVERALL: Improve maintenance and readbility of some variables (neo-project#3248) Update nuget (neo-project#3262) [**Part-2**] Neo module/master fixes (neo-project#3244) Fix `dotnet pack` error (neo-project#3266) Fix and Update devcontainer.json to use Dockerfile (neo-project#3259) Add optimization to template (neo-project#3247) Optimize plugin's models (neo-project#3246) fix CancelTransaction !signers.Any() (neo-project#3263) COVERALL: fix broken by changing report from lcov to cobertura (neo-project#3252) fix TraverseIterator count (neo-project#3261) Native: include DeprecatedIn hardfork into usedHardforks (neo-project#3245) [**Part-1**] `neo-module/master` (neo-project#3232) Make `ApplicationEngine.LoadContext` protection level `public` (neo-project#3243) improve parse method in neo-cli (neo-project#3204) Fix neo-project#3239 (neo-project#3242) Neo.CLI: enable hardforks for NeoFS mainnet (neo-project#3240) v3.7.4 (neo-project#3237) fix hardfork issues (neo-project#3234) Update src/Neo.CLI/CLI/MainService.Plugins.cs ... # Conflicts: # src/Neo.CLI/CLI/MainService.Plugins.cs
.Where(s => s?["prerelease"]?.GetValue<bool>() == prerelease) | ||
.Select(s => | ||
{ | ||
var tagName = s["tag_name"]?.GetValue<string>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix Dereference of a possibly null reference
warning.
s?["tag_name"]?.GetValue<string>()
i think s?
was needed.
Co-authored-by: Christopher Schuchardt <[email protected]>
Co-authored-by: Christopher Schuchardt <[email protected]>
@superboyiii will need you to release a plugin version at this repo to test. |
He can release on his own repo and change the |
I will check this |
@Jim8y Just a little worried about if someone use v3.7.4 CLI to install v3.7.5 Plugins, they may not want to upgrade CLI if there're only hotfixes on plugins.... If we consider the title situation, we should consider this situation as well. Or maybe we should release both cli and plugins everytime, it can also solve these. |
if (latestVersion < pluginVersion) | ||
{ | ||
var latestDownloadUrl = $"https://github.com/neo-project/neo/releases/download/v{latestVersion}/{pluginName}.zip"; | ||
ConsoleHelper.Info($"Could not find the corresponding version, installing the latest: v{latestVersion}"); | ||
return await httpClient.GetStreamAsync(latestDownloadUrl); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need take care of (latestVersion > pluginVersion)
, why not always pick the latestVersion
?
I think with the release of @Jim8y Resolve conflicts |
|
||
if (jsonRelease != null) | ||
{ | ||
var latestVersion = Version.Parse(jsonRelease["tag_name"]!.GetValue<string>()[1..]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this 1? Start with v?
|
||
if (jsonRelease != null) | ||
{ | ||
var latestVersion = Version.Parse(jsonRelease["tag_name"]!.GetValue<string>()[1..]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Version.TryParse
instead of Version.Parse
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version.TryParse
is good
Co-authored-by: Anna Shaleva <[email protected]>
Description
Cli will not able to install plugin if the modules are not yet released. So this pr will help the cli to install the latest plugin that can find on github.
Fixes # (issue)
Type of change
Test Configuration:
Checklist: