FIX: Small tweak to percentiles based on feedback

This commit is contained in:
Robin Ward 2019-05-16 13:45:20 -04:00
parent f41aa5cb98
commit 225593d445
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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