release-notes 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -1
- data/.travis.yml +2 -2
- data/README.md +7 -3
- data/lib/generators/release/notes/install/templates/README +2 -2
- data/lib/generators/release/notes/install/templates/release_notes.rb +6 -0
- data/lib/release/notes/configuration.rb +12 -1
- data/lib/release/notes/git.rb +0 -4
- data/lib/release/notes/link.rb +1 -1
- data/lib/release/notes/log.rb +16 -10
- data/lib/release/notes/system.rb +6 -1
- data/lib/release/notes/version.rb +1 -1
- data/lib/release/notes/write.rb +6 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11a25ad25c53aea05501c671b7d7e6b56be58408733ffda7537f727682bc4997
|
4
|
+
data.tar.gz: 64cf10fe71b5486a1f8084c1b735cfa539cf709d1f75c98d6dca55bf88181f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07046b845aad862743042afda74fc749a22e97904f86c87ca9717b471e6ef2402e5e4145ad5a469405957fabf6cfda7da3362be22ca647be51ce7de7dafcb0cb
|
7
|
+
data.tar.gz: 56dd24a83704f5a108f2b0730fdf8e7a8155aa57ee0ad1dd20f677571fe3273a15a2b6ca07e57ec06ec9473478a98bd3a96ef3a3a7f97a96c03e3f6ab7deb28b
|
data/.rubocop.yml
CHANGED
@@ -11,11 +11,18 @@ AllCops:
|
|
11
11
|
Metrics/LineLength:
|
12
12
|
Max: 120
|
13
13
|
|
14
|
+
Metrics/MethodLength:
|
15
|
+
Max: 21
|
16
|
+
|
14
17
|
Metrics/BlockLength:
|
15
|
-
Max:
|
18
|
+
Max: 40
|
16
19
|
Exclude:
|
17
20
|
- "./**/spec/**/*"
|
18
21
|
|
22
|
+
Metrics/AbcSize:
|
23
|
+
Exclude:
|
24
|
+
- "lib/release/notes/configuration.rb"
|
25
|
+
|
19
26
|
Style/StringLiterals:
|
20
27
|
EnforcedStyle: double_quotes
|
21
28
|
Exclude:
|
data/.travis.yml
CHANGED
@@ -5,13 +5,13 @@ rvm:
|
|
5
5
|
- 2.4.5
|
6
6
|
- 2.5.3
|
7
7
|
cache: bundler
|
8
|
-
before_install: gem install bundler -v 1.
|
8
|
+
before_install: gem install bundler -v 1.17.1
|
9
9
|
env:
|
10
10
|
global:
|
11
11
|
secure: ovawk+NnGZGW+hOeC3iPMZ9jKY5FvaxfHLj6XX4Vfe12cq0cdGYirW6pk2uKdJZdE0pC5q4sFv1ZTgcNSTySuNpQ9Gkp4xjcGEVr5JSdmVse8DuxttwkeSPt94DemyMK3f0A3dWN8OJF7/NQbacPeUuXryxmusCqJMlWccVYGeSQQNJ21mFfl2pCf6Z9qls4Q3rzXc4hsVQ5G1B/j9YcMjax0EwXI4cEq/6JadK4OmXrGkCw6M/wvBEqNyhLz+R/gcYiJZqYUETdncRuNiH8N6JKiaCnZUFkGY4bggpOvz29lj3JEQV9jY+3UBeqxuYj3glT7buEuf6//ARedY7IDlupkiDNuSpIKJhzIKAgitc/g+cnUflQV8PiImAEseO0OpoAJ7Bsa688EgyvMgo/kYwjHqZetvlUksQI+XyZ+o7/88LF2Qz4pbuBtdFC4DaKaeqQN5afIHSPtxhYwFA/n+GmY4jymj5ZWod9zZasVdlDgCQzgH5M1W7nEGun8mRW93wf8+3wAx+fXVbB67aDbqJFBJfH6zm/aBCN16kGkHUibRxUyb0F52woBQLUcOIr9Kbujp02D7IK3Z7PFz+DtHfA8aYRXxRDIHxx0tw91UxQzBinsq27kH8EWDmEKMHJeZlMRR4X4ijd6+KFoKUobXFblCeVeO0HCIBxpfTc39w=
|
12
12
|
script:
|
13
|
-
- bundle exec rubocop
|
14
13
|
- bundle exec rspec
|
14
|
+
- bundle exec rubocop
|
15
15
|
|
16
16
|
after_success:
|
17
17
|
- bundle exec codeclimate-test-reporter
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
![Imgur](https://i.imgur.com/vTgHEyJ.png)
|
2
|
+
|
1
3
|
# Release::Notes
|
2
4
|
|
3
5
|
[![Build Status](https://travis-ci.org/dvmonroe/release-notes.svg?branch=master)](https://travis-ci.org/dvmonroe/release-notes)
|
@@ -5,7 +7,7 @@
|
|
5
7
|
[![Test Coverage](https://codeclimate.com/github/dvmonroe/release-notes/badges/coverage.svg)](https://codeclimate.com/github/dvmonroe/release-notes/coverage)
|
6
8
|
[![Inline docs](http://inch-ci.org/github/dvmonroe/release-notes.svg?branch=master)](http://inch-ci.org/github/dvmonroe/release-notes)
|
7
9
|
|
8
|
-
|
10
|
+
## Automated release notes based on your project's git log.
|
9
11
|
|
10
12
|
Release::Notes is a small wrapper around your project's git log. The gem is
|
11
13
|
intended to help increase visability to all team members and/or stakeholders with
|
@@ -17,7 +19,7 @@ meant for situations where other team members in your organization need to know
|
|
17
19
|
to the production software. These key changes are determined by the labeling you set forth
|
18
20
|
in the configuration for features, bugs and misc commits.
|
19
21
|
If you're looking for a comprehnsive changelog that reflects resolved github issues and uses the
|
20
|
-
github api, I'd
|
22
|
+
github api, I'd suggest you look at something else like
|
21
23
|
[github-changelog-generator](https://github.com/skywinder/github-changelog-generator).
|
22
24
|
|
23
25
|
Not looking for a tested gem or prefer the rawness of a bash script? Checkout the similar
|
@@ -65,6 +67,7 @@ Release::Notes.configure do |config|
|
|
65
67
|
config.ignore_case = true
|
66
68
|
config.log_format = '- %s'
|
67
69
|
config.extended_regex = true
|
70
|
+
config.header_title = "tag"
|
68
71
|
config.bug_labels = %w(Fix Update)
|
69
72
|
config.feature_labels = %w(Add Create)
|
70
73
|
config.misc_labels = %w(Refactor)
|
@@ -136,7 +139,7 @@ namespace :deploy do
|
|
136
139
|
task :update_release_notes do
|
137
140
|
# use the binstub
|
138
141
|
sh 'bin/release-notes"'
|
139
|
-
|
142
|
+
|
140
143
|
# Then check in your release notes with a commit
|
141
144
|
sh "git commit -am 'Release to production #{Time.zone.now}'"
|
142
145
|
sh "git push origin master"
|
@@ -156,6 +159,7 @@ Useful information can be found here regarding the
|
|
156
159
|
- Linking is opinionated and will link to a URI structure of `#{site-url}/#{issue_number}`. It
|
157
160
|
will ouput something like: `[HONEYBADGER #33150353](https://app.honeybadger.io/projects/9999/faults/33150353)`.
|
158
161
|
This also means that your link_to_labels have to be something like `['HB #']` (PR's to make this more flexible are welcome)
|
162
|
+
- We grep the entire commit message when generating the release notes file. If you include keywords in your commit subject and message that match multiple configured labels, that commit will be listed under all relevant label headers, which could lead to commits being listed under more than one label.
|
159
163
|
|
160
164
|
## Development
|
161
165
|
|
@@ -5,7 +5,7 @@ Next step:
|
|
5
5
|
1. Configure release and tag options :
|
6
6
|
|
7
7
|
# config/initializers/release_notes.rb
|
8
|
-
config.
|
8
|
+
config.header_title = "tag"
|
9
9
|
|
10
10
|
|
11
|
-
*******************************************************************************
|
11
|
+
*******************************************************************************
|
@@ -37,6 +37,12 @@ Release::Notes.configure do |config|
|
|
37
37
|
# @return [Boolean]
|
38
38
|
# config.extended_regex = true
|
39
39
|
|
40
|
+
# Controls the header used in your generated log for all tags.
|
41
|
+
# "tag" and "date" are the two valid options
|
42
|
+
# Defaults to `tag`.
|
43
|
+
# @return [String]
|
44
|
+
# config.header_title = "tag"
|
45
|
+
|
40
46
|
# Allows you to specify what information you want to print from your git log
|
41
47
|
# Defaults to `%s` for subject. For more, see
|
42
48
|
# [Git Log Docs](https://git-scm.com/docs/git-log)
|
@@ -39,6 +39,11 @@ module Release
|
|
39
39
|
# @return [String]
|
40
40
|
attr_accessor :log_format
|
41
41
|
|
42
|
+
# Controls the headers that will be used for your tags
|
43
|
+
# Defaults to `tag`.
|
44
|
+
# @return [String]
|
45
|
+
attr_accessor :header_title
|
46
|
+
|
42
47
|
# Controls the labels grepped for in your commit subjects that will
|
43
48
|
# be add under you bug title
|
44
49
|
# Defaults to `%w(Fix Update)`.
|
@@ -120,13 +125,14 @@ module Release
|
|
120
125
|
# @return [Boolean]
|
121
126
|
attr_accessor :force_rewrite
|
122
127
|
|
123
|
-
def initialize
|
128
|
+
def initialize
|
124
129
|
@output_file = "./RELEASE_NOTES.md"
|
125
130
|
@temp_file = "./release-notes.tmp.md"
|
126
131
|
@include_merges = false
|
127
132
|
@ignore_case = true
|
128
133
|
@extended_regex = true
|
129
134
|
@log_format = "- %s"
|
135
|
+
@header_title = "tag"
|
130
136
|
@bug_labels = %w(Fix Update)
|
131
137
|
@feature_labels = %w(Add Create)
|
132
138
|
@misc_labels = %w(Refactor)
|
@@ -143,6 +149,11 @@ module Release
|
|
143
149
|
@force_rewrite = false
|
144
150
|
end
|
145
151
|
|
152
|
+
# @return [String]
|
153
|
+
def header_title_type
|
154
|
+
@header_title.match?(/^[tag|date]+$/) ? @header_title : "tag"
|
155
|
+
end
|
156
|
+
|
146
157
|
# @return [String]
|
147
158
|
def include_merges?
|
148
159
|
@include_merges ? "" : "--no-merges"
|
data/lib/release/notes/git.rb
CHANGED
data/lib/release/notes/link.rb
CHANGED
data/lib/release/notes/log.rb
CHANGED
@@ -8,13 +8,13 @@ module Release
|
|
8
8
|
attr_reader :writer, :date_formatter
|
9
9
|
attr_reader :all_tags
|
10
10
|
|
11
|
-
delegate :force_rewrite, :all_labels, :log_all, :
|
12
|
-
:bugs, :misc, :feature_title,
|
11
|
+
delegate :force_rewrite, :all_labels, :log_all, :header_title,
|
12
|
+
:header_title_type, :features, :bugs, :misc, :feature_title,
|
13
13
|
:bug_title, :misc_title, :log_all_title,
|
14
14
|
:release_notes_exist?, to: :"Release::Notes.configuration"
|
15
15
|
|
16
16
|
delegate :date_humanized, :format_tag_date, to: :date_formatter
|
17
|
-
delegate :
|
17
|
+
delegate :digest_header, :digest_title, to: :writer
|
18
18
|
|
19
19
|
def initialize
|
20
20
|
@writer = Release::Notes::Write.new
|
@@ -37,13 +37,13 @@ module Release
|
|
37
37
|
# :nocov:
|
38
38
|
private
|
39
39
|
|
40
|
-
def
|
41
|
-
@
|
40
|
+
def git_all_tags
|
41
|
+
@git_all_tags ||= System.all_tags.split("\n")
|
42
42
|
# return Error.new(msg: :missing_tags) unless all_tags.present?
|
43
43
|
end
|
44
44
|
|
45
45
|
# @api private
|
46
|
-
def copy_single_tag_of_activity(tag_from:, tag_to: "HEAD")
|
46
|
+
def copy_single_tag_of_activity(tag_from:, tag_to: "HEAD")
|
47
47
|
[features, bugs, misc].each_with_index do |regex, i|
|
48
48
|
log = system_log(
|
49
49
|
tag_from: tag_from,
|
@@ -70,22 +70,28 @@ module Release
|
|
70
70
|
return false unless system_log(tag_from: last_tag, label: all_labels).present?
|
71
71
|
|
72
72
|
# output the date right now
|
73
|
-
|
73
|
+
header_content date: date_humanized, tag: tag_to
|
74
74
|
copy_single_tag_of_activity(tag_from: last_tag)
|
75
75
|
end
|
76
76
|
|
77
77
|
# @api private
|
78
78
|
def find_all_tags_and_log_all
|
79
|
-
|
80
|
-
previous_tag =
|
79
|
+
git_all_tags.each_with_index do |ta, i|
|
80
|
+
previous_tag = git_all_tags[i + 1]
|
81
81
|
next unless previous_tag.present? &&
|
82
82
|
system_log(tag_from: previous_tag, tag_to: ta, label: all_labels).present?
|
83
83
|
|
84
|
-
|
84
|
+
header_content date: date_humanized(date: System.tag_date(tag: ta)), tag: ta
|
85
85
|
copy_single_tag_of_activity(tag_from: previous_tag, tag_to: ta)
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
+
# @api private
|
90
|
+
def header_content(**date_and_tag)
|
91
|
+
digest_header(date_and_tag[header_title_type.to_sym])
|
92
|
+
end
|
93
|
+
|
94
|
+
# @api private
|
89
95
|
def titles
|
90
96
|
[feature_title, bug_title, misc_title]
|
91
97
|
end
|
data/lib/release/notes/system.rb
CHANGED
@@ -8,9 +8,14 @@ module Release
|
|
8
8
|
extend ActiveSupport::Concern
|
9
9
|
include Git
|
10
10
|
|
11
|
+
delegate :all_labels, to: :"Release::Notes.configuration"
|
12
|
+
|
11
13
|
included do
|
12
14
|
def system_log(**opts)
|
13
|
-
|
15
|
+
if opts.delete(:log_all) == true
|
16
|
+
opts[:label] = all_labels
|
17
|
+
opts[:invert_grep] = " --invert-grep"
|
18
|
+
end
|
14
19
|
|
15
20
|
`#{log(opts)}`
|
16
21
|
end
|
data/lib/release/notes/write.rb
CHANGED
@@ -30,10 +30,10 @@ module Release
|
|
30
30
|
digest(titles)
|
31
31
|
end
|
32
32
|
|
33
|
-
# formats
|
34
|
-
def
|
35
|
-
@
|
36
|
-
digest(
|
33
|
+
# formats the headers to be added to the new file
|
34
|
+
def digest_header(header)
|
35
|
+
@header = header
|
36
|
+
digest(header_present)
|
37
37
|
end
|
38
38
|
|
39
39
|
# append old file to new temp file
|
@@ -49,8 +49,8 @@ module Release
|
|
49
49
|
private
|
50
50
|
|
51
51
|
# @api private
|
52
|
-
def
|
53
|
-
"\n## #{@
|
52
|
+
def header_present
|
53
|
+
"\n## #{@header}\n"
|
54
54
|
end
|
55
55
|
|
56
56
|
# @api private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: release-notes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Drew Monroe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|