Compare commits

...

42 Commits

Author SHA1 Message Date
Petr Korolev
6406168b15 Merge branch 'release/1.3.11' 2015-03-21 02:13:09 +02:00
Petr Korolev
7b38f0f56a Update gemspec to version 1.3.11 2015-03-21 02:13:09 +02:00
Petr Korolev
7704dc9ecd Add rescue fallback with warning message to prevent crash in case of exceed Rate Limit (temporary workaround for #71) 2015-03-21 02:12:58 +02:00
Petr Korolev
25ee41bc8c add github logo 2015-03-21 02:12:58 +02:00
Petr Korolev
219f4b9748 update readme 2015-03-21 02:12:58 +02:00
brb
de33edd3ce Update README.md 2015-03-21 02:12:58 +02:00
Petr Korolev
6db717a5ee add link to issue 2015-03-21 02:12:58 +02:00
Petr Korolev
5fb5832cf5 ad xkcd link 2015-03-21 02:12:58 +02:00
Eric Dill
a55b938ccf MNT: Fix travis badge 2015-03-21 02:12:58 +02:00
Petr Korolev
d1b3e09da3 add faq 2015-03-21 02:12:58 +02:00
Petr Korolev
4d094ba211 cm 2015-03-21 02:12:58 +02:00
Petr Korolev
3d7aa0b7c5 cm 2015-03-21 02:12:58 +02:00
Petr Korolev
ada6f13de5 upate 2015-03-21 02:12:58 +02:00
Petr Korolev
9479979fed update 2015-03-21 02:12:58 +02:00
Petr Korolev
30e9ab0ec3 update 2015-03-21 02:12:58 +02:00
Petr Korolev
8d5bdbcca7 update 2015-03-21 02:12:58 +02:00
Petr Korolev
a514224625 update 2015-03-21 02:12:58 +02:00
Petr Korolev
4162bc8659 update readme 2015-03-21 02:12:57 +02:00
Petr Korolev
06d49a1e44 add github logo 2015-03-21 01:15:45 +02:00
Petr Korolev
dbb385d049 update readme 2015-03-20 23:44:18 +02:00
Petr Korolev
abe19eedbe Merge pull request #74 from briantigerchow/patch-1
Update README.md
2015-03-20 23:34:42 +02:00
brb
32149b8a2c Update README.md 2015-03-20 14:28:48 -07:00
Petr Korolev
e5f6670a07 add link to issue 2015-03-20 18:42:22 +02:00
Petr Korolev
83e406ca5f ad xkcd link 2015-03-20 18:42:22 +02:00
Petr Korolev
8c7f1a7390 Merge pull request #73 from ericdill/fix-travis-badge
MNT: Fix travis badge
2015-03-20 16:09:56 +02:00
Eric Dill
f248e1c718 MNT: Fix travis badge 2015-03-20 09:56:54 -04:00
Petr Korolev
fdcf5ccf7e add faq 2015-03-20 13:05:00 +02:00
Petr Korolev
2b46ba2a11 cm 2015-03-18 16:06:27 +02:00
Petr Korolev
f6388903b7 cm 2015-03-18 16:04:42 +02:00
Petr Korolev
e51bceda05 upate 2015-03-18 15:59:44 +02:00
Petr Korolev
165e8d4e9f update 2015-03-18 15:57:34 +02:00
Petr Korolev
79f16947b7 update 2015-03-18 15:52:46 +02:00
Petr Korolev
432f12af70 update 2015-03-18 15:45:51 +02:00
Petr Korolev
a1b19044c2 update 2015-03-18 15:43:11 +02:00
Petr Korolev
70e8c287f5 update readme 2015-03-18 15:36:01 +02:00
Petr Korolev
78ca34ff7c Merge branch 'hotfix/update' into develop 2015-03-18 15:26:52 +02:00
Petr Korolev
2f3e754a6b Merge branch 'hotfix/update' 2015-03-18 15:26:51 +02:00
Petr Korolev
8c20913af4 update readme 2015-03-18 15:26:32 +02:00
Petr Korolev
f14b081126 Merge branch 'hotfix/update-changelog' into develop 2015-03-18 10:28:52 +02:00
Petr Korolev
315a92b7b3 Merge branch 'hotfix/update-changelog' 2015-03-18 10:28:52 +02:00
Petr Korolev
cca51aa19f Update changelog for version 1.3.10 2015-03-18 10:28:51 +02:00
Petr Korolev
56b1398081 Merge branch 'release/1.3.10' into develop 2015-03-18 10:27:30 +02:00
5 changed files with 152 additions and 65 deletions

View File

@@ -1,5 +1,17 @@
# Change Log # Change Log
## [1.3.10](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.10) (2015-03-18)
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.9...1.3.10)
**Fixed bugs:**
- Exclude closed PR's from changelog. [\#69](https://github.com/skywinder/Github-Changelog-Generator/issues/69)
**Merged pull requests:**
- Fix termination in case of empty unreleased section with `--unreleased-only` option. [\#70](https://github.com/skywinder/Github-Changelog-Generator/pull/70) ([skywinder](https://github.com/skywinder))
## [1.3.9](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.9) (2015-03-06) ## [1.3.9](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.9) (2015-03-06)
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.8...1.3.9) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.8...1.3.9)
@@ -10,7 +22,7 @@
**Merged pull requests:** **Merged pull requests:**
- Concurrency problem in case of issues \> 2048 [\#65](https://github.com/skywinder/Github-Changelog-Generator/pull/65) ([skywinder](https://github.com/skywinder)) - Resolved concurrency problem in case of issues \> 2048 [\#65](https://github.com/skywinder/Github-Changelog-Generator/pull/65) ([skywinder](https://github.com/skywinder))
## [1.3.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.8) (2015-03-05) ## [1.3.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.8) (2015-03-05)

View File

@@ -1,8 +1,7 @@
[![Gem Version](https://badge.fury.io/rb/github_changelog_generator.svg)](http://badge.fury.io/rb/github_changelog_generator) [![Gem Version](https://badge.fury.io/rb/github_changelog_generator.svg)](http://badge.fury.io/rb/github_changelog_generator)
[![Build Status](https://travis-ci.org/skywinder/Github-Changelog-Generator.svg?branch=master)](https://travis-ci.org/skywinder/Github-Changelog-Generator) [![Build Status](https://travis-ci.org/skywinder/github-changelog-generator.svg?branch=master)](https://travis-ci.org/skywinder/github-changelog-generator)
GitHub Changelog Generator GitHub Changelog Generator ![GitHub Logo](../master/images/logo.jpg)
================== ==================
- [Installation](#installation) - [Installation](#installation)
@@ -13,14 +12,23 @@ GitHub Changelog Generator
- [Features and advantages of this project](#features-and-advantages-of-this-project) - [Features and advantages of this project](#features-and-advantages-of-this-project)
- [Alternatives](#alternatives) - [Alternatives](#alternatives)
- [Projects using this library](#projects-using-this-library) - [Projects using this library](#projects-using-this-library)
- [Am I missed some essential feature?](#am-i-missed-some-essential-feature) - [Am I missing some essential feature?](#am-i-missing-some-essential-feature)
- [Contributing](#contributing) - [Contributing](#contributing)
- [License](#license) - [License](#license)
Changelog generation has never been so easy. ### Changelog generation has never been so easy:
**Fully automate changelog generation** - This gem generate change log file based on tags, issues and merged pull requests from **Github issue tracker**. This generator complies all [change log format guidelines](http://keepachangelog.com/). **Fully automate changelog generation** - This gem generates change log file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according labels) from :octocat: GitHub Issue Tracker.
Since now you don't have to fill your `CHANGELOG.md` manually: just run the script, relax and take a cup of :coffee: before your next release! :tada:
>### *Whats the point of a change log?*
To make it easier for users and contributors to see precisely what notable changes have been made between each release (or version) of the project.
### *Why should I care?*
Because software tools are for people. If you dont care, why are you contributing to open source? Surely, there must be a kernel (ha!) of care somewhere in that lovely little brain of yours.
> :copyright: *[http://keepachangelog.com](http://keepachangelog.com/)*
## Installation ## Installation
@@ -57,7 +65,7 @@ Changelog generation has never been so easy.
## Usage ## Usage
**It's really simple**: **It's really simple**:
- If your **git remote** `origin` refer to your GitHub repo, then just go to your project folder and run: - If your **git remote** `origin` refers to your GitHub repo, then just go to your project folder and run:
github_changelog_generator github_changelog_generator
@@ -96,7 +104,7 @@ Type `github_changelog_generator --help` for detailed usage.
### GitHub token ### GitHub token
Since GitHub allow to make only 50 requests without authentication it's recommended to run this script with token Since GitHub allows you to make only 50 requests without authentication it's recommended to run this script with a token (`-t, --token` option)
**You can easily [generate it here](https://github.com/settings/applications)**. **You can easily [generate it here](https://github.com/settings/applications)**.
@@ -115,23 +123,27 @@ So, if you got error like this:
It's time to create this token or wait for 1 hour before GitHub reset the counter for your IP. It's time to create this token or wait for 1 hour before GitHub reset the counter for your IP.
##Features and advantages of this project ##Features and advantages of this project
- Generate canonical change log file, followed by [keepachangelog.com guidlines](http://keepachangelog.com/) - Generate canonical, neat change log file, followed by [basic change log guidlines](http://keepachangelog.com/) :gem:
- Possible to generate **Unreleased** changes (closed issues that have not released yet) - Possible to generate **Unreleased** changes (closed issues that have not released yet) :dizzy:
- **GitHub Enterprise support** via command line options! - **GitHub Enterprise support** via command line options! :factory:
- Flexible format **customisation**: - Flexible format **customisation**:
- **Customize** issues, that **should be added** to changelog - **Customize** issues, that **should be added** to changelog :eight_spoked_asterisk:
- **Custom date format** supported - **Custom date format** supported (but get in mind [ISO 8601](http://xkcd.com/1179/) ) :date:
- Ability to manually specify in which version issue was fixed (in case, when closed date is not match) by setting `milestone` of issue the same name as tag of required version - Ability to manually specify in which version issue was fixed (in case, when closed date is not match) by setting `milestone` of issue the same name as tag of required version :pushpin:
- Ability to **exclude specific issues** from change log (by labels) - Automatically **exclude specific issues**, not-related to change log (any issue, that has label `question` `duplicate` `invalid` `wontfix`by default) :scissors:
- **Automatically exclude "questions"** - issues marked as `question` labels (and other issues, that shouldn't be in change log file: with `duplicate invalid wontfix` labels) - **Distinguish** issues **according labels**. :mag_right:
- **Distinguish** bug fixes, enchantments, and closed issues **according labels**. - Merged pull requests (all `merged` pull-requests) :twisted_rightwards_arrows:
- Issues (closed issues w/o any labels) - Bug fixes (by label `bug` in issue) :beetle:
- Merged pull-requests (all merged pull-requests) - Enhancements (by label `enhancement` in issue) :star2:
- Bug-fixes (by label `bug` in issue) - Issues (closed issues `w/o any labels`) :non-potable_water:
- Enhancements (by label `enhancement` in issue)
- You can manually set which labels should be included/excluded. :wrench:
- Apply a lot of other customisations, to fit changelog for your personal style :tophat:
(*look `github_changelog_generator --help` for details)*
###Alternatives ###Alternatives
Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives), that I found. But no one was satisfy my requirements. Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives), that I found. But none satisfied my requirements.
*If you know other projects - feel free to edit this Wiki page!* *If you know other projects - feel free to edit this Wiki page!*
@@ -141,13 +153,38 @@ Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Ch
*If you are using `github_changelog_generator` for generation change log in your project or know another project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.* *If you are using `github_changelog_generator` for generation change log in your project or know another project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
## Am I missed some essential feature? ## Am I missing some essential feature?
**Nothing is impossible!** - **Nothing is impossible!**
Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make generator better together! - Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make generator better together!
*Bug reports, feature requests, patches, well-wishes are always welcome!* - *Bug reports, feature requests, patches, well-wishes are always welcome* :heavy_exclamation_mark:
## FAQ
- ***I already use GitHub Releases. Why do I need this?***
GitHub Releases is a very good thing. And it's very good practice to maintain it (not so much people using it yet)! :congratulations:
*BDW: I would like to support GitHub Releases in [next releases](https://github.com/skywinder/github-changelog-generator/issues/56) ;)*
I'm not try to compare quality of auto-generated and manually generated logs.. but:
The auto generated Changelog really helps even if you manually fill Releases notes!
For example:
When I found a closed bug - it's very useful to understand, in which release it was fixed. In that case you can easily find this issue by \# in `CHANGELOG.md`.
- it's not so quite easy to find it in manually filled Releases notes.
- this file can also help you to build your Release note and not miss features in manually-filled list.
In the end:
I think, that GitHub Releases is more for end-users.
But `CHANGELOG.md` could stay in the repo for developers with detailed list of changes.
And it's nothing bad to combine GitHub Releases and `CHANGELOG.md` file together in that manner.
## Contributing ## Contributing
@@ -157,6 +194,7 @@ Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/n
4. Commit your changes (`git commit -am 'Add some feature'`) 4. Commit your changes (`git commit -am 'Add some feature'`)
5. Push to the branch (`git push origin my-new-feature`) 5. Push to the branch (`git push origin my-new-feature`)
6. Create a new Pull Request 6. Create a new Pull Request
7. Profit! :white_check_mark:
## License ## License

BIN
images/logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@@ -27,7 +27,11 @@ module GitHubChangelogGenerator
github_options[:endpoint] = options[:github_endpoint] unless options[:github_endpoint].nil? github_options[:endpoint] = options[:github_endpoint] unless options[:github_endpoint].nil?
github_options[:site] = options[:github_endpoint] unless options[:github_site].nil? github_options[:site] = options[:github_endpoint] unless options[:github_site].nil?
@github = Github.new github_options begin
@github = Github.new github_options
rescue
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
end
@generator = Generator.new(@options) @generator = Generator.new(@options)
@@ -88,7 +92,11 @@ module GitHubChangelogGenerator
issue[:actual_date] = issue[:closed_at] issue[:actual_date] = issue[:closed_at]
else else
begin begin
commit = @github.git_data.commits.get @options[:user], @options[:project], event[:commit_id] begin
commit = @github.git_data.commits.get @options[:user], @options[:project], event[:commit_id]
rescue
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
end
issue[:actual_date] = commit[:author][:date] issue[:actual_date] = commit[:author][:date]
rescue rescue
puts "Warning: can't fetch commit #{event[:commit_id]} probably it referenced from another repo." puts "Warning: can't fetch commit #{event[:commit_id]} probably it referenced from another repo."
@@ -110,16 +118,22 @@ module GitHubChangelogGenerator
if @options[:verbose] if @options[:verbose]
print "Fetching merged dates...\r" print "Fetching merged dates...\r"
end end
response = @github.pull_requests.list @options[:user], @options[:project], :state => 'closed'
pull_requests = [] pull_requests = []
page_i = 0 begin
response.each_page do |page| response = @github.pull_requests.list @options[:user], @options[:project], :state => 'closed'
page_i += PER_PAGE_NUMBER page_i = 0
count_pages = response.count_pages response.each_page do |page|
print "Fetching merged dates... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r" page_i += PER_PAGE_NUMBER
pull_requests.concat(page) count_pages = response.count_pages
end print "Fetching merged dates... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r"
pull_requests.concat(page)
end
rescue
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
end
print " \r" print " \r"
@pull_requests.each { |pr| @pull_requests.each { |pr|
@@ -276,7 +290,11 @@ module GitHubChangelogGenerator
end end
def is_megred(number) def is_megred(number)
@github.pull_requests.merged? @options[:user], @options[:project], number begin
@github.pull_requests.merged? @options[:user], @options[:project], number
rescue
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
end
end end
def get_all_tags def get_all_tags
@@ -285,20 +303,26 @@ module GitHubChangelogGenerator
print "Fetching tags...\r" print "Fetching tags...\r"
end end
response = @github.repos.tags @options[:user], @options[:project]
tags = [] tags = []
page_i = 0
count_pages = response.count_pages begin
response.each_page do |page| response = @github.repos.tags @options[:user], @options[:project]
page_i += PER_PAGE_NUMBER page_i = 0
print "Fetching tags... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r" count_pages = response.count_pages
tags.concat(page) response.each_page do |page|
end page_i += PER_PAGE_NUMBER
print " \r" print "Fetching tags... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r"
if @options[:verbose] tags.concat(page)
puts "Found #{tags.count} tags" end
end print " \r"
if @options[:verbose]
puts "Found #{tags.count} tags"
end
rescue
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
end
tags tags
end end
@@ -512,7 +536,11 @@ module GitHubChangelogGenerator
return @tag_times_hash[tag_name['name']] return @tag_times_hash[tag_name['name']]
end end
github_git_data_commits_get = @github.git_data.commits.get @options[:user], @options[:project], tag_name['commit']['sha'] begin
github_git_data_commits_get = @github.git_data.commits.get @options[:user], @options[:project], tag_name['commit']['sha']
rescue
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
end
time_string = github_git_data_commits_get['committer']['date'] time_string = github_git_data_commits_get['committer']['date']
@tag_times_hash[tag_name['name']] = Time.parse(time_string) @tag_times_hash[tag_name['name']] = Time.parse(time_string)
end end
@@ -558,17 +586,22 @@ module GitHubChangelogGenerator
if @options[:verbose] if @options[:verbose]
print "Fetching closed issues...\r" print "Fetching closed issues...\r"
end end
response = @github.issues.list user: @options[:user], repo: @options[:project], state: 'closed', filter: 'all', labels: nil
issues = [] issues = []
page_i = 0
count_pages = response.count_pages begin
response.each_page do |page| response = @github.issues.list user: @options[:user], repo: @options[:project], state: 'closed', filter: 'all', labels: nil
page_i += PER_PAGE_NUMBER page_i = 0
print "Fetching issues... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r" count_pages = response.count_pages
issues.concat(page) response.each_page do |page|
end page_i += PER_PAGE_NUMBER
print "Fetching issues... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r"
issues.concat(page)
end
rescue
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
end
print " \r" print " \r"
@@ -610,7 +643,11 @@ module GitHubChangelogGenerator
issues.each_slice(max_thread_number) { |issues_slice| issues.each_slice(max_thread_number) { |issues_slice|
issues_slice.each { |issue| issues_slice.each { |issue|
threads << Thread.new { threads << Thread.new {
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number'] begin
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number']
rescue
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
end
issue[:events] = obj.body issue[:events] = obj.body
print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r" print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r"
i +=1 i +=1

View File

@@ -1,3 +1,3 @@
module GitHubChangelogGenerator module GitHubChangelogGenerator
VERSION = '1.3.10' VERSION = '1.3.11'
end end