-
Notifications
You must be signed in to change notification settings - Fork 635
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
DYN-7728 Add Wild Card Syntax #15591
Conversation
|
||
if (splitVersion.Length == 2) | ||
{ | ||
var newVersion = splitVersion[0] + ".1000.0"; |
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.
Maybe 1000 is not enough.... Could be 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.
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.
With that said, this is what we expect (from the current wiki, link in the description above) "For year based versions like in revit, civil3d etc:
Major version should be a 4 digit number (<= 9999)
Minor version should be at most a 2 digit number (<= 99)
Patch version should be at most a 2 digit number (<=99)
For dynamo versions:
Major/Minor/Patch versions should be at most a 2 digit number (<= 99)"
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.
Ahh we should probably bump this to a bit higher just to be really out of range. Maybe 99999?
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.
@zeusongit maybe we need to adjust the rules on versions
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.
Just to confirm here in writing and for posterity @saintentropy - the major/minor/patch
maximum value for .Net is 2,147,483,647. The revision
is 65,535.
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 are validating Revit/Civil and other hosts versions, not the package versions itself, so this does not apply.
- more tests added to cover edge cases - added the new wildcard static method to the API - extracted the '1000' max wildcard version value into a separate const variable to allow for ease of access later on (based on comment if value should be higher) - added small utility method to append wildcard version
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.
@saintentropy you have done everything! I only added a few minor edge-case tests, and a couple more things like:
Assert.IsTrue(PackageManagerSearchElement.IsVersionCompatible(compatibility, compatibleVersion), | ||
"Expected compatibility to be true when version is within the min and max wildcard range."); | ||
|
||
Assert.IsFalse(PackageManagerSearchElement.IsVersionCompatible(compatibility, incompatibleVersion), |
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 added this test to also highlight the fact that, differentiating between the minor and build wildcard values covers the respective 'domain' of that wildcard. Meaning .. well, meaning the above case is currently valid, I just wanted to make this explicit.
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 updated when we start updating compatibility from client, it is fine for now.
UI Smoke TestsTest: success. 11 passed, 0 failed. |
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.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-7341
/// <summary> | ||
/// The maximum version we check against when substituting a wildcard | ||
/// </summary> | ||
private const string WILDCARD_MAX_VERSION = "99999"; |
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 is different for major and minor versions. Also for Dynamo versions, this is too large.
Is this part of the defensive coding? @saintentropy
This makes 2.9999 valid, but it will be rejected by the server
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.
The goal here is just to transform an asterisk into a Version object that obviously larger then the data in the system. This is only for the comparison syntax. The idea is we make a fake Max version that is just a really really big version vs coding the logic for actual infinity. We could actually push it to the theoretical max you pointed out -> 2,147,483,647 and then we would be good.
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.
Got it, I think we are just displaying//comparing the data at this point so not a problem.
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 did push it to the max.... Also had to fix the test. This way it's at the theoretical limit.
/// <summary> | ||
/// The maximum version we check against when substituting a wildcard | ||
/// </summary> | ||
private const string WILDCARD_MAX_VERSION = "2147483647"; |
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 int.MaxValue.ToString()
instead?
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.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-7728
Co-authored-by: Deyan Nenov <dnenov@archilizer.com>
Purpose
This PR adds
wildcard
support for version compatibility calculation. Based on the current scheme explained here.Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
WildCardParse
methodReviewers
@zeusongit
@QilongTang
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of