-
Notifications
You must be signed in to change notification settings - Fork 1k
Report _from_ version in addition to _to_ version #6108
Conversation
Consolidating ISystemInformation, UpdateInfoExtensionNode and IUpdateInfoGenerator into ProductInformationProvider so that we only have one way to retrieve product information. Fixes VSTS #664616
853fd6e to
33c681c
Compare
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.
Please move to MonoDevelop.Ide.Updater namespace and folder.
33c681c to
ff45acf
Compare
|
|
||
| public override string ApplicationId => "c07628e8-5521-4c1a-aa3a-f860e664f0a9"; | ||
|
|
||
| protected override string UpdateInfoFile => throw new NotImplementedException (); |
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.
Shouldn't this return null?
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.
Ah, I see, GetUpdateInfo overrules this.
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.
Not sure. It's not used anywhere so I don't think it matters. I think throwing might be better, but happy to change it.
| /// <summary> | ||
| /// Path to the updateinfo file. | ||
| /// </summary> | ||
| protected abstract string UpdateInfoFile { get; } |
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 we make this a virtual method that returns null? That way, implementors don't have to implement it with NotImplementedException.
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.
Reason behind this is that:
If we ever change UpdateInfoFile to be queried from anywhere else, the NIE will end up biting us.
| { | ||
| } | ||
|
|
||
| public readonly string File; |
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.
To allow future changes, please make these readonly properties.
public string File { get; }
| string url = null; | ||
| s = f.ReadLine (); | ||
| if (s != null) { | ||
| if (s.StartsWith ("source-url:")) |
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.
introduce a constant for "source-url:".
const string sourceUrl = "source-url:";
if (s.StartsWith (sourceUrl)) {
url = s.Substring (sourceUrl.Length).Trim ();
}
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProductInformationProvider.cs
Show resolved
Hide resolved
76ecd87 to
6e31b86
Compare
|
|
||
| public override string Description => GetDescription (); | ||
|
|
||
| public override string Version => DotNetCoreSdk.Versions.FirstOrDefault().ToString (); |
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.
This should be either FirstOrDefault()?.ToString () or First().ToString ()
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.
I considered using System.Version for this, but Updater has a single digit version number that is too short.
I'll add the null check.
| </Extension> | ||
|
|
||
| <Extension path = "/MonoDevelop/Core/SystemInformation"> | ||
| <Class class = "MonoDevelop.Ide.RuntimeVersionInfo" /> |
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.
You can register this class in the extension just above, no need to define a new one.
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.
Good spot!
slluis
left a comment
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.
Looks good!
|
@monojenkins backport release-7.7 |
|
@monojenkins backport release-7.6 |
|
@nosami backporting to release-7.6 failed, the patch results in conflicts: Please backport manually! |
Consolidating ISystemInformation, UpdateInfoExtensionNode and
IUpdateInfoGenerator into ProductInformationProvider so that we only
have one way to retrieve product information.
Fixes VSTS #664616