Fixes #4505 Remove reliance on getting product version for model.zip/version.txt from FileVersionInfo and replace with using assembly custom attributes#4512
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.
assemblyInternationalVersionAttribute [](start = 16, length = 37)
Nit: Can this be renamed assemblyInformationalVersionAttribute?
|
|
||
| if (assemblyInternationalVersionAttribute == null) | ||
| { | ||
| throw new ApplicationException($"Cannot determine product version from assembly {assembly.FullName}."); |
There was a problem hiding this comment.
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.
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). |
michaelgsharp
left a comment
There was a problem hiding this comment.
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.