-
Notifications
You must be signed in to change notification settings - Fork 1.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
Compare tar.gz files between VMR and current .NET builds #47667
Conversation
Adds tar.gz comparison, including assembly version comparison. Because our archives are basically always in the same order between base and diff, we avoid a ton of extra very expensive disk write time by finding the common files between base and diff, then reading the base and diff simultaneously, keeping a map of open streams. Every time we read a new common entry, we attempt to compare assembly versions and the remove the streams. This is drastically faster than extracting.
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.
Pull Request Overview
This PR adds functionality to compare tar.gz archives (in addition to zip archives) between VMR and current .NET builds by comparing both file lists and assembly versions, while also refactoring some common routines.
- Introduces new methods to list tar.gz archive files and compare their assembly versions asynchronously.
- Updates copy stream methods to asynchronous versions and reduces the default parallelism from 16 to 8.
- Refactors file version normalization to support comparisons across different archive formats.
Co-authored-by: Copilot <[email protected]>
} | ||
|
||
/// <summary> | ||
/// This method is called "USE ALL AVAILABLE MEMORY" |
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.
😄
private static string RemoveVersionsNormalized(string path) | ||
{ | ||
string strippedPath = path.Replace("\\", "//"); | ||
string prevPath = path; |
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.
nit: this is overwritten on the next line anyway so initializing to path
is unnecessary
/azp list |
CI/CD Pipelines for this repository: |
/azp run sdk-unified-build |
Azure Pipelines successfully started running 1 pipeline(s). |
/// <summary> | ||
/// Compare the file lists of packages, identifying missing and extra files. | ||
/// </summary> | ||
/// <param name="mapping"></param> |
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.
Nit, what value do empty doc tags provide? It bloats the code and erodes the value of the actual documentation.
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.
None at all...will fix.
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.
Mind if I fix this in the next iteration? There are some more tests to add to 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.
That's fine with me.
Adds tar.gz comparison, including assembly version comparison. Because our archives are basically always in the same order between base and diff, we avoid a ton of extra very expensive disk write time by finding the common files between base and diff, then reading the base and diff simultaneously, keeping a map of open streams. Every time we read a new common entry, we attempt to compare assembly versions and the remove the streams. This is drastically faster than extracting.
Also fixes a bug where version numbers weren't being removed from file paths within nupkgs.