Merge branch '2.2.x' into 2.3.x

Closes gh-22351
pull/22996/head
Scott Frederick 4 years ago
commit 1bc0d6fbe1

@ -62,16 +62,17 @@ def find_milestone(username, password, repository, title)
milestones = JSON.parse(response.body)
if title.end_with?(".x")
prefix = title.delete_suffix('.x')
$log.debug "Finding latest milestone from candidates starting with #{prefix}"
$log.debug "Finding nearest milestone from candidates starting with #{prefix}"
titles = milestones.map { |milestone| milestone['title'] }
titles = titles.select{ |title| title.start_with?(prefix) unless title.end_with?('.x')}
titles.sort_by { |v| Gem::Version.new(v) }
titles = titles.sort_by { |v| Gem::Version.new(v) }
$log.debug "Considering candidates #{titles}"
if(titles.empty?)
puts "Cannot find latest for milestone #{title}"
puts "Cannot find nearest milestone for prefix #{title}"
exit 1
end
title = titles.last
$log.debug "Found latest milestone #{title}"
title = titles.first
$log.debug "Found nearest milestone #{title}"
end
milestones.each do |milestone|
$log.debug "Considering #{milestone['title']}"

Loading…
Cancel
Save