-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fixes #4505 Remove reliance on getting product version for model.zip/version.txt from FileVersionInfo and replace with using assembly custom attributes #4512
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
Conversation
…from FileVersionInfo and replace with using assembly custom attributes (dotnet#4505)
Any chance this could be PR'd? the change is pretty minor. |
{ | ||
var assembly = typeof(RepositoryWriter).Assembly; | ||
|
||
var assemblyInternationalVersionAttribute = assembly.CustomAttributes.FirstOrDefault(a => |
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.
assemblyInternationalVersionAttribute [](start = 16, length = 37)
Nit: Can this be renamed assemblyInformationalVersionAttribute
?
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.
OK sure
|
||
if (assemblyInternationalVersionAttribute == null) | ||
{ | ||
throw new ApplicationException($"Cannot determine product version from assembly {assembly.FullName}."); |
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.
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 was only to keep consistency with how it was behaving before - I prefer the approach you have suggested though it should not fail because of 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.
Please confirm @eerhardt @harishsk @yaeldekel and I'll make the change.
Hey @r0ss88, is still still something you would like to see merged in? You mention to refer to the original issue, but I don't see one linked. Which issue is it? |
Nevermind, I see it in the title not the description. Let me take a look at it real fast. |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Codecov Report
@@ Coverage Diff @@
## master #4512 +/- ##
==========================================
- Coverage 74.91% 68.30% -6.62%
==========================================
Files 908 1130 +222
Lines 160097 240132 +80035
Branches 17226 24921 +7695
==========================================
+ Hits 119934 164011 +44077
- Misses 35363 69664 +34301
- Partials 4800 6457 +1657
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
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 and we need this. Not sure why it wasn't followed up on.
. The only failing test is a stale badge that won't refresh. Merging anyways. |
Refer to original issue for further details of the reasons for this change.
I have used AssemblyInformationalVersionAttribute to match the same behaviour as was introduced with the change to reliance of FileVersionInfo.GetVersionInfo. There is already a test covering -ModelFiles.DetermineNugetVersionFromModel in Microsoft.ML.FunctionalTests.