Skip to content

A platform for community discussion. Free, open, simple.

FIX: Small tweak to percentiles based on feedback

Robin Ward225593d44569
diff --git a/app/jobs/scheduled/reviewable_priorities.rb b/app/jobs/scheduled/reviewable_priorities.rb
index 7ba3fc3ee97..f67698a21d1 100644
--- a/app/jobs/scheduled/reviewable_priorities.rb
+++ b/app/jobs/scheduled/reviewable_priorities.rb
@@ -7,8 +7,8 @@ class Jobs::ReviewablePriorities < Jobs::Scheduled
# We calculate the percentiles here for medium and high. Low is always 0 (all)
res = DB.query_single(<<~SQL)
- SELECT COALESCE(PERCENTILE_DISC(0.4) WITHIN GROUP (ORDER BY score), 0.0) AS medium,
- COALESCE(PERCENTILE_DISC(0.8) WITHIN GROUP (ORDER BY score), 0.0) AS high
+ SELECT COALESCE(PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY score), 0.0) AS medium,
+ COALESCE(PERCENTILE_DISC(0.85) WITHIN GROUP (ORDER BY score), 0.0) AS high
FROM reviewables
SQL
diff --git a/spec/jobs/reviewable_priorities_spec.rb b/spec/jobs/reviewable_priorities_spec.rb
index a1f60f13101..b3962a24014 100644
--- a/spec/jobs/reviewable_priorities_spec.rb
+++ b/spec/jobs/reviewable_priorities_spec.rb
@@ -10,7 +10,7 @@ describe Jobs::ReviewablePriorities do
expect(Reviewable.min_score_for_priority('low')).to eq(0.0)
expect(Reviewable.min_score_for_priority('medium')).to eq(3.0)
- expect(Reviewable.min_score_for_priority('high')).to eq(5.0)
+ expect(Reviewable.min_score_for_priority('high')).to eq(6.0)
end
it "will return 0 if no reviewables exist" do