Compare commits
16 Commits
1.8.0
...
raphink-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f60c19ef2 | ||
|
|
83ae430dd8 | ||
|
|
8c0974200c | ||
|
|
28e3ed2500 | ||
|
|
1bf5644a72 | ||
|
|
bc37d0277b | ||
|
|
c4846b7ef9 | ||
|
|
d09dad30f4 | ||
|
|
31e98fbc41 | ||
|
|
82dd0b3cce | ||
|
|
1ae86e3cb2 | ||
|
|
b3eea83ae1 | ||
|
|
7e4d546f60 | ||
|
|
be62b92fa9 | ||
|
|
0b6d751388 | ||
|
|
410921f673 |
25
CHANGELOG.md
25
CHANGELOG.md
@@ -1,5 +1,30 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [Unreleased](https://github.com/skywinder/github-changelog-generator/tree/HEAD)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.0...HEAD)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Fix issue with missing events \(in case of events for issue \>30\) [\#268](https://github.com/skywinder/github-changelog-generator/pull/268) ([skywinder](https://github.com/skywinder))
|
||||||
|
- Use since\_tag as default for older\_tag [\#267](https://github.com/skywinder/github-changelog-generator/pull/267) ([raphink](https://github.com/raphink))
|
||||||
|
|
||||||
|
## [1.8.0](https://github.com/skywinder/github-changelog-generator/tree/1.8.0) (2015-08-24)
|
||||||
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.7.0...1.8.0)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- Generate change log since/due specific tag [\#254](https://github.com/skywinder/github-changelog-generator/issues/254)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Add `--due-tag` option [\#265](https://github.com/skywinder/github-changelog-generator/pull/265) ([skywinder](https://github.com/skywinder))
|
||||||
|
- Add release\_url to rake task options [\#264](https://github.com/skywinder/github-changelog-generator/pull/264) ([raphink](https://github.com/raphink))
|
||||||
|
- Add a rake task [\#260](https://github.com/skywinder/github-changelog-generator/pull/260) ([raphink](https://github.com/raphink))
|
||||||
|
- Add release\_url option [\#259](https://github.com/skywinder/github-changelog-generator/pull/259) ([raphink](https://github.com/raphink))
|
||||||
|
- Add --base option [\#258](https://github.com/skywinder/github-changelog-generator/pull/258) ([raphink](https://github.com/raphink))
|
||||||
|
- Add --since-tag [\#257](https://github.com/skywinder/github-changelog-generator/pull/257) ([raphink](https://github.com/raphink))
|
||||||
|
|
||||||
## [1.7.0](https://github.com/skywinder/github-changelog-generator/tree/1.7.0) (2015-07-16)
|
## [1.7.0](https://github.com/skywinder/github-changelog-generator/tree/1.7.0) (2015-07-16)
|
||||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.6.2...1.7.0)
|
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.6.2...1.7.0)
|
||||||
|
|
||||||
|
|||||||
11
Gemfile.lock
11
Gemfile.lock
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
github_changelog_generator (1.7.0)
|
github_changelog_generator (1.8.0)
|
||||||
colorize (~> 0.7)
|
colorize (~> 0.7)
|
||||||
github_api (~> 0.12)
|
github_api (~> 0.12)
|
||||||
|
|
||||||
@@ -29,13 +29,13 @@ GEM
|
|||||||
unf (>= 0.0.5, < 1.0.0)
|
unf (>= 0.0.5, < 1.0.0)
|
||||||
faraday (0.9.1)
|
faraday (0.9.1)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
github_api (0.12.3)
|
github_api (0.12.4)
|
||||||
addressable (~> 2.3)
|
addressable (~> 2.3)
|
||||||
descendants_tracker (~> 0.0.4)
|
descendants_tracker (~> 0.0.4)
|
||||||
faraday (~> 0.8, < 0.10)
|
faraday (~> 0.8, < 0.10)
|
||||||
hashie (>= 3.3)
|
hashie (>= 3.4)
|
||||||
multi_json (>= 1.7.5, < 2.0)
|
multi_json (>= 1.7.5, < 2.0)
|
||||||
nokogiri (~> 1.6.3)
|
nokogiri (~> 1.6.6)
|
||||||
oauth2
|
oauth2
|
||||||
hashie (3.4.2)
|
hashie (3.4.2)
|
||||||
http-cookie (1.0.2)
|
http-cookie (1.0.2)
|
||||||
@@ -112,3 +112,6 @@ DEPENDENCIES
|
|||||||
rspec (~> 3.2)
|
rspec (~> 3.2)
|
||||||
rubocop (~> 0.31)
|
rubocop (~> 0.31)
|
||||||
simplecov (~> 0.10)
|
simplecov (~> 0.10)
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.10.6
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- This a PR with a lot of comments and events [\#17](https://github.com/skywinder/changelog_test/pull/17) ([skywinder](https://github.com/skywinder))
|
||||||
|
- PR [\#16](https://github.com/skywinder/changelog_test/pull/16) ([skywinder](https://github.com/skywinder))
|
||||||
- This PR closes 14 from commit [\#15](https://github.com/skywinder/changelog_test/pull/15) ([skywinder](https://github.com/skywinder))
|
- This PR closes 14 from commit [\#15](https://github.com/skywinder/changelog_test/pull/15) ([skywinder](https://github.com/skywinder))
|
||||||
- This PR to close \#12 from body [\#13](https://github.com/skywinder/changelog_test/pull/13) ([skywinder](https://github.com/skywinder))
|
- This PR to close \#12 from body [\#13](https://github.com/skywinder/changelog_test/pull/13) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
|
|||||||
@@ -163,10 +163,13 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
|||||||
issues_slice.each do |issue|
|
issues_slice.each do |issue|
|
||||||
threads << Thread.new do
|
threads << Thread.new do
|
||||||
begin
|
begin
|
||||||
obj = @github.issues.events.list user: @options[:user],
|
response = @github.issues.events.list user: @options[:user],
|
||||||
repo: @options[:project],
|
repo: @options[:project],
|
||||||
issue_number: issue["number"]
|
issue_number: issue["number"]
|
||||||
issue[:events] = obj.body
|
issue[:events] = []
|
||||||
|
response.each_page do |page|
|
||||||
|
issue[:events].concat(page)
|
||||||
|
end
|
||||||
rescue
|
rescue
|
||||||
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
if @options[:issues]
|
if @options[:issues]
|
||||||
# Generate issues:
|
# Generate issues:
|
||||||
log += issues_to_log(issues)
|
log += issues_to_log(issues, pull_requests)
|
||||||
end
|
end
|
||||||
|
|
||||||
if @options[:pulls]
|
if @options[:pulls]
|
||||||
@@ -77,13 +77,14 @@ module GitHubChangelogGenerator
|
|||||||
log
|
log
|
||||||
end
|
end
|
||||||
|
|
||||||
# Generate ready-to-paste log from list of issues.
|
# Generate ready-to-paste log from list of issues and pull requests.
|
||||||
#
|
#
|
||||||
# @param [Array] issues
|
# @param [Array] issues
|
||||||
|
# @param [Array] pull_requests
|
||||||
# @return [String] generated log for issues
|
# @return [String] generated log for issues
|
||||||
def issues_to_log(issues)
|
def issues_to_log(issues, pull_requests)
|
||||||
log = ""
|
log = ""
|
||||||
bugs_a, enhancement_a, issues_a = parse_by_sections(issues)
|
bugs_a, enhancement_a, issues_a = parse_by_sections(issues, pull_requests)
|
||||||
|
|
||||||
log += generate_sub_section(enhancement_a, @options[:enhancement_prefix])
|
log += generate_sub_section(enhancement_a, @options[:enhancement_prefix])
|
||||||
log += generate_sub_section(bugs_a, @options[:bug_prefix])
|
log += generate_sub_section(bugs_a, @options[:bug_prefix])
|
||||||
@@ -95,8 +96,9 @@ module GitHubChangelogGenerator
|
|||||||
# (bugs, features, or just closed issues) by labels
|
# (bugs, features, or just closed issues) by labels
|
||||||
#
|
#
|
||||||
# @param [Array] issues
|
# @param [Array] issues
|
||||||
|
# @param [Array] pull_requests
|
||||||
# @return [Array] tuple of filtered arrays: (Bugs, Enhancements Issues)
|
# @return [Array] tuple of filtered arrays: (Bugs, Enhancements Issues)
|
||||||
def parse_by_sections(issues)
|
def parse_by_sections(issues, pull_requests)
|
||||||
issues_a = []
|
issues_a = []
|
||||||
enhancement_a = []
|
enhancement_a = []
|
||||||
bugs_a = []
|
bugs_a = []
|
||||||
@@ -117,6 +119,24 @@ module GitHubChangelogGenerator
|
|||||||
end
|
end
|
||||||
issues_a.push dict unless added
|
issues_a.push dict unless added
|
||||||
end
|
end
|
||||||
|
|
||||||
|
pull_requests.each do |dict|
|
||||||
|
added = false
|
||||||
|
dict.labels.each do |label|
|
||||||
|
if @options[:bug_labels].include? label.name
|
||||||
|
bugs_a.push dict
|
||||||
|
added = true
|
||||||
|
next
|
||||||
|
end
|
||||||
|
if @options[:enhancement_labels].include? label.name
|
||||||
|
enhancement_a.push dict
|
||||||
|
added = true
|
||||||
|
next
|
||||||
|
end
|
||||||
|
end
|
||||||
|
pull_requests.delete(dict) if added
|
||||||
|
end
|
||||||
|
|
||||||
[bugs_a, enhancement_a, issues_a]
|
[bugs_a, enhancement_a, issues_a]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,11 +48,11 @@ module GitHubChangelogGenerator
|
|||||||
# Fill :actual_date parameter of specified issue by closed date of the commit, if it was closed by commit.
|
# Fill :actual_date parameter of specified issue by closed date of the commit, if it was closed by commit.
|
||||||
# @param [Hash] issue
|
# @param [Hash] issue
|
||||||
def find_closed_date_by_commit(issue)
|
def find_closed_date_by_commit(issue)
|
||||||
unless issue["events"].nil?
|
unless issue[:events].nil?
|
||||||
# if it's PR -> then find "merged event", in case of usual issue -> fond closed date
|
# if it's PR -> then find "merged event", in case of usual issue -> fond closed date
|
||||||
compare_string = issue[:merged_at].nil? ? "closed" : "merged"
|
compare_string = issue[:merged_at].nil? ? "closed" : "merged"
|
||||||
# reverse! - to find latest closed event. (event goes in date order)
|
# reverse! - to find latest closed event. (event goes in date order)
|
||||||
issue["events"].reverse!.each do |event|
|
issue[:events].reverse!.each do |event|
|
||||||
if event[:event].eql? compare_string
|
if event[:event].eql? compare_string
|
||||||
set_date_from_event(event, issue)
|
set_date_from_event(event, issue)
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ module GitHubChangelogGenerator
|
|||||||
def generate_log_between_tags(older_tag, newer_tag)
|
def generate_log_between_tags(older_tag, newer_tag)
|
||||||
filtered_issues, filtered_pull_requests = filter_issues_for_tags(newer_tag, older_tag)
|
filtered_issues, filtered_pull_requests = filter_issues_for_tags(newer_tag, older_tag)
|
||||||
|
|
||||||
older_tag_name = older_tag.nil? ? nil : older_tag["name"]
|
older_tag_name = older_tag.nil? ? detect_since_tag : older_tag["name"]
|
||||||
|
|
||||||
if newer_tag.nil? && filtered_issues.empty? && filtered_pull_requests.empty?
|
if newer_tag.nil? && filtered_issues.empty? && filtered_pull_requests.empty?
|
||||||
# do not generate empty unreleased section
|
# do not generate empty unreleased section
|
||||||
|
|||||||
@@ -63,21 +63,21 @@ module GitHubChangelogGenerator
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Method filter issues, that belong only specified tag range
|
# Method filter issues, that belong only specified tag range
|
||||||
# @param [Array] array of issues to filter
|
# @param [Array] issues issues to filter
|
||||||
# @param [Symbol] hash_key key of date value default is :actual_date
|
# @param [Symbol] hash_key key of date value default is :actual_date
|
||||||
# @param [String] older_tag all issues before this tag date will be excluded. May be nil, if it's first tag
|
# @param [String] older_tag all issues before this tag date will be excluded. May be nil, if it's first tag
|
||||||
# @param [String] newer_tag all issue after this tag will be excluded. May be nil for unreleased section
|
# @param [String] newer_tag all issue after this tag will be excluded. May be nil for unreleased section
|
||||||
# @return [Array] filtered issues
|
# @return [Array] filtered issues
|
||||||
def delete_by_time(array, hash_key = :actual_date, older_tag = nil, newer_tag = nil)
|
def delete_by_time(issues, hash_key = :actual_date, older_tag = nil, newer_tag = nil)
|
||||||
# in case if not tags specified - return unchanged array
|
# in case if not tags specified - return unchanged array
|
||||||
return array if older_tag.nil? && newer_tag.nil?
|
return issues if older_tag.nil? && newer_tag.nil?
|
||||||
|
|
||||||
newer_tag_time = newer_tag && get_time_of_tag(newer_tag)
|
newer_tag_time = newer_tag && get_time_of_tag(newer_tag)
|
||||||
older_tag_time = older_tag && get_time_of_tag(older_tag)
|
older_tag_time = older_tag && get_time_of_tag(older_tag)
|
||||||
|
|
||||||
array.select do |req|
|
issues.select do |issue|
|
||||||
if req[hash_key]
|
if issue[hash_key]
|
||||||
time = Time.parse(req[hash_key]).utc
|
time = Time.parse(issue[hash_key]).utc
|
||||||
|
|
||||||
tag_in_range_old = tag_newer_old_tag?(older_tag_time, time)
|
tag_in_range_old = tag_newer_old_tag?(older_tag_time, time)
|
||||||
|
|
||||||
|
|||||||
@@ -54,11 +54,13 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
# @return [Object] try to find newest tag using #Reader and :base option if specified otherwise returns nil
|
# @return [Object] try to find newest tag using #Reader and :base option if specified otherwise returns nil
|
||||||
def detect_since_tag
|
def detect_since_tag
|
||||||
if @options[:base] && File.file?(@options[:base])
|
@since_tag ||= @options[:since_tag]
|
||||||
|
if @since_tag.nil? && @options[:base] && File.file?(@options[:base])
|
||||||
reader = GitHubChangelogGenerator::Reader.new
|
reader = GitHubChangelogGenerator::Reader.new
|
||||||
content = reader.read(@options[:base])
|
content = reader.read(@options[:base])
|
||||||
return content[0]["version"] if content
|
@since_tag = content[0]["version"] if content
|
||||||
end
|
end
|
||||||
|
@since_tag
|
||||||
end
|
end
|
||||||
|
|
||||||
# Return tags after filtering tags in lists provided by option: --between-tags & --exclude-tags
|
# Return tags after filtering tags in lists provided by option: --between-tags & --exclude-tags
|
||||||
@@ -74,8 +76,7 @@ module GitHubChangelogGenerator
|
|||||||
# @return [Array] filtered tags according :since_tag option
|
# @return [Array] filtered tags according :since_tag option
|
||||||
def filter_since_tag(all_tags)
|
def filter_since_tag(all_tags)
|
||||||
filtered_tags = all_tags
|
filtered_tags = all_tags
|
||||||
tag = @options[:since_tag]
|
tag = detect_since_tag
|
||||||
tag ||= detect_since_tag
|
|
||||||
if tag
|
if tag
|
||||||
if all_tags.map(&:name).include? tag
|
if all_tags.map(&:name).include? tag
|
||||||
idx = all_tags.index { |t| t.name == tag }
|
idx = all_tags.index { |t| t.name == tag }
|
||||||
|
|||||||
Reference in New Issue
Block a user