remove issues with other milstones

This commit is contained in:
Petr Korolev 2014-12-22 15:14:01 +02:00
parent 135c48a494
commit e6bb728355
2 changed files with 27 additions and 4 deletions

View File

@ -243,6 +243,29 @@ module GitHubChangelogGenerator
filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time, older_tag_time) filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time, older_tag_time)
end end
#delete excess irrelevant issues (according milestones)
filtered_issues.select!{ |issue|
if issue.milestone.nil?
true
else
#check, that this milestone in tag list:
milestone_is_tag = @all_tags.find{|tag|
tag.name == issue.milestone.title
}
if milestone_is_tag.nil?
true
else
issue.milestone.title == newer_tag_name
end
end
}
#add missed issues (according milestones)
self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time) self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time)
end end
@ -395,7 +418,7 @@ module GitHubChangelogGenerator
if @options[:add_issues_wo_labels] if @options[:add_issues_wo_labels]
issues_wo_labels = issues.select { issues_wo_labels = issues.select {
# add issues without any labels # add issues without any labels
|issue| !issue.labels.map { |label| label.name }.any? |issue| !issue.labels.map { |label| label.name }.any?
} }
filtered_issues.concat(issues_wo_labels) filtered_issues.concat(issues_wo_labels)
end end

View File

@ -10,10 +10,10 @@ module GitHubChangelogGenerator
merge = "#{@options[:merge_prefix]}#{encapsulated_title} [\\##{pull_request[:number]}](#{pull_request.html_url})" merge = "#{@options[:merge_prefix]}#{encapsulated_title} [\\##{pull_request[:number]}](#{pull_request.html_url})"
if @options[:author] if @options[:author]
if !pull_request.user.nil? if pull_request.user.nil?
merge += " ([#{pull_request.user.login}](#{pull_request.user.html_url}))\n\n"
else
merge += " ({Null user})\n\n" merge += " ({Null user})\n\n"
else
merge += " ([#{pull_request.user.login}](#{pull_request.user.html_url}))\n\n"
end end
else else
merge += "\n\n" merge += "\n\n"