-
Notifications
You must be signed in to change notification settings - Fork 42
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
fix: hooks not run in NOT_READY/FATAL #1392
Conversation
cd7f5cc
to
539e787
Compare
Signed-off-by: Todd Baert <[email protected]>
539e787
to
72ce106
Compare
Signed-off-by: Todd Baert <[email protected]>
|
if (ProviderState.NOT_READY.equals(state)) { | ||
throw new ProviderNotReadyError("provider not yet initialized"); | ||
} | ||
if (ProviderState.FATAL.equals(state)) { | ||
throw new FatalError("provider is in an irrecoverable error state"); | ||
} |
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.
Throwing these before we ran the hooks and setup the afterHookContext
was the cause of the issue. We just needed to move it later.
@@ -594,6 +594,25 @@ void erroneous_flagResolution_setsAppropriateFieldsInFlagEvaluationDetails() { | |||
assertThat(evaluationDetails.getValue()).isTrue(); | |||
} | |||
|
|||
@Test | |||
void shortCircuit_flagResolution_runsHooksWithAllFields() { |
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 test fails without the fix.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1392 +/- ##
============================================
+ Coverage 92.90% 93.25% +0.35%
- Complexity 470 471 +1
============================================
Files 43 43
Lines 1127 1127
Branches 91 91
============================================
+ Hits 1047 1051 +4
+ Misses 53 48 -5
- Partials 27 28 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes a bug where our "short circuit" logic was "short circuiting" too early, leading to various errors in hooks.
Fixes: #1370