[GenAPI] Give generated attributes a reliable order#5572
Conversation
dougbu
commented
May 27, 2020
- current situation results in inconsistent orders as the CI agent varies
- current situation results in inconsistent orders as the CI agent varies
|
@riarenas @markwilkie is there a way to test this change in and test using it in an aspnetcore branch? The variance is blocking my work in dotnet/aspnetcore#22017. I could turn off ref/ code gen in our build verification but am loath to increase our engineering debt in that way. Much prefer to know a real fix is coming and that it works. Note I can't reproduce the problem locally. Found this broken line by inspection. |
|
Yea. Once this is checked in, you could branch asp and grab arcade from the validate channel... |
|
Thanks @markwilkie❕ I can't think of a potential downside and am hoping @ericstj and @safern agree. |
| public virtual int Compare(T x, T y) | ||
| { | ||
| return string.Compare(GetKey(x), GetKey(y)); | ||
| return string.Compare(GetKey(x), GetKey(y), StringComparison.OrdinalIgnoreCase); |
There was a problem hiding this comment.
Why IgnoreCase? That seems to be a behavior change. It also breaks the comparer contract since GetHashCode would return different values for values that differ only in case (and thus would be treated equal).
There was a problem hiding this comment.
I would have been fine w/ Ordinal but worried that would be inconsistent with
SecurityAction values (an enum) and not entire attribute keys. (Might still be a bug nearby because I'm not sure ISecurityAttribute.Attributes is sorted at all. LMK if that's not a concern for some reason.)
For this line, Ordinal it is…
|
/ping reviewers (Looks like this is going to pass PR validation.) |