From 225593d445691375284c56fc051b1407e3d192a6 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 16 May 2019 13:45:20 -0400 Subject: [PATCH] FIX: Small tweak to percentiles based on feedback --- app/jobs/scheduled/reviewable_priorities.rb | 4 ++-- spec/jobs/reviewable_priorities_spec.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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