diff --git a/database/scripts/lib/buildfarm_tools.rb b/database/scripts/lib/buildfarm_tools.rb index bed0464..b197f99 100644 --- a/database/scripts/lib/buildfarm_tools.rb +++ b/database/scripts/lib/buildfarm_tools.rb @@ -131,7 +131,7 @@ def self.jobs_last_success_date(older_than_days: 0) out end - def self.test_regressions_known + def self.test_regressions_known(sort_by: 'priority') out = known_issues(status: 'open') out.concat known_issues(status: 'disabled') out = out.group_by { |e| e["github_issue"] }.to_a.map { |e| e[1] } @@ -141,6 +141,10 @@ def self.test_regressions_known error["priority"] = priority end end + + unless sort_by.nil? + out.sort_by! { |r| -r.first['priority'] } + end out end