-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[DRAFT] Nullability fixes for chaos outcome strategy #2010
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
[DRAFT] Nullability fixes for chaos outcome strategy #2010
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2010 +/- ##
=======================================
Coverage 83.64% 83.64%
=======================================
Files 312 312
Lines 7105 7106 +1
Branches 1054 1053 -1
=======================================
+ Hits 5943 5944 +1
Misses 789 789
Partials 373 373
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
IMHO this isn't the sort of breaking change we should be "sneaking in" on people with a minor version We made a mistake with the original API definition and fixing it should require a version 9. If we still want to eventually fix it, then we should make the change if/when we have a legitimate need for a v9. |
Let's see what will break. Using
|
|
But haven't you changed a |
Yes, there is a lots of |
|
|
When you directly use the This PR has changes to handle the |
|
The operator would only fix in the case of source build though, right? If you update Polly in your own project and reference another library built with 8.3.0, then it won't work and you'd get a The fact we need to change the public API files means we're changing/breaking the contract. I do not think we should do that. |
Shall I close this PR then or will you add a |
|
We can leave this open for discussion on exactly what we want to do about it, but my opinion is currently:
Possible outcomes could be:
My preference would be for 2, essentially, leave it as a TODO for an undetermined point in the future. |
|
I am gravitating towards being lenient on this single instance and do a breaking change by modifying the nullability annotations, while bumping minor version only. My reasons:
Just my 2 cents and thoughts :) |
|
I won't be at a computer for a day or so to actually check to satisfy myself exactly which it is, but as I noted earlier as it's a struct not a class then isn't it actually changing being |
|
Looking at the decompiled assemblies in ILSpy shows that this is indeed a binary-breaking change due to a change of type, not just a change to nullable annotations. Viewing the code as C# 1.0 to make the semantics of the Viewing the same from the package produced in this PR, it is now The key here is that because |
|
@martincostello Martin, I think it was never a question whether it is a breaking change or not. The question was more about whether we can squeeze this into the next release with minor version bump + proper documentation. Due to reasons that was previously listed @martintmk and myself are voting to treat this changeset as a bugfix to gain a more convenient API. |
|
The problem is it's binary breaking, and Martin's comments about the nullability not being visible at runtime don't apply because it's not just nullable annotations. For me this isn't the right kind of change to make outside of a major version regardless of the benefits of doing so. |
|
Thanks Martin, it's indeed a binary breaking change to remove nullability from the struct. Let's drop that change from the PR, we can still keep the others. |
Well the only change which would remain is this (as far as I can see): internal Func<ResilienceContext, Outcome<TResult>> CreateGenerator()
{
if (_factories.Count == 0)
{
// return _ => null; // old
throw new InvalidOperationException("No outcome generators have been added."); |
The nullability contract allows returning null, so this change might not be necessary. However, using What we need to fix is this piece of code:
Returning null outcome results in exception as due to |
|
@martintmk Since you are back I'm closing this PR in favor of your. |


Pull Request
The issue or feature being addressed
Taking over the #1982 from @martintmk
Details on the issue fix or feature implementation
Confirm the following