-
Notifications
You must be signed in to change notification settings - Fork 12
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
🐛 attempt to fix banded scoring with exceptions #1359
Conversation
@@ -490,22 +468,22 @@ func (c *bandedScoreCalculator) Add(score *Score, impact *explorer.Impact) { | |||
|
|||
if category <= 10 { | |||
c.critMax += score.Weight | |||
if score.Value == 100 { | |||
if score.Value < 100 { |
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.
based on my understanding the counter should only increase if the score is not Pass
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.
based on the Calculate
function, I think c.crit
and the rest are supposed to count the number of failures:
if c.crit != 0 {
res.Value = uint32(math.Floor(float64(50) * pcrCrit))
} else if c.high != 0 {
res.Value = uint32(math.Floor(float64(50)*pcrHigh)) + 10
If there failures, we need to fall into the first category with failures.
So this all seems right to me
Signed-off-by: Ivan Milchev <[email protected]>
ddc8456
to
d6623c9
Compare
// 10 high checks | ||
{Value: &explorer.ImpactValue{Value: 80}}, | ||
}, | ||
out: &Score{Value: 100, ScoreCompletion: 100, DataCompletion: 66, Weight: 20, Type: ScoreType_Result}, |
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 a case with all passing checks. I would expect if everything passed, then the policy score should also be 100. In the original code that is not the case. It works now, however, the values for the other cases changed too...
@@ -67,28 +67,6 @@ func AddSpecdScore(calculator ScoreCalculator, s *Score, found bool, impact *exp | |||
return | |||
} | |||
|
|||
// everything else is modify or activate | |||
|
|||
if impact.Scoring == explorer.ScoringSystem_IGNORE_SCORE { |
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.
in #1350 I already made sure all the calculators handle exceptions properly, so this workaround shouldn't be needed anymore
Second attempt at fixing banded scoring, after #1350 didn't fully work