reissue 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbf7f6743d0d3f7d9cc6ae1d2daa7b60debf47a437473a01a23d18e50450b3ed
4
- data.tar.gz: 545d45ca3354aa70cba0b3bb01ba5b653d62b26b6c9ee37dd4c398f1384e7fee
3
+ metadata.gz: 497ea9bf5abf5081d1177217a0083ad682edf5d39ed7c729e8949c31e47e1d53
4
+ data.tar.gz: 0c4660c3d271b95fcbc0575bf91a0826a91348d6b48ac383a5ab9058887afdf3
5
5
  SHA512:
6
- metadata.gz: f7f3a5b754e4d9189f1ca8452510129e1b4550dcf9dba385b9d92af1e6dc2e648582d356483648f7e2a9ea766b1efec87e118a9c34def1800e2201f28997ffb9
7
- data.tar.gz: dd3518eebf74b5280eca612148cb8782d591f195e4f8d7f31ba314c7e5ec109c2bcd55aecf91128ac9d22802a36f1feb63671c644835a350f041fa1ca16f1b94
6
+ metadata.gz: 8dcd012366336939860c89e503526a2d46879159ab7e10c9f571d3157142ffe613d2b641da75b67359bd8fa49af8dc2ffd171e09df32794fe230b9da24293910
7
+ data.tar.gz: e90cd39f283c3bb983c24bb45f7a0c3fe2b6519d650adc411c9c0e69572eba8b59535935aabc9e225cb04f70da7401ed99dd74f151ef513b112bd1f494ea2e03
data/CHANGELOG.md CHANGED
@@ -5,37 +5,34 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
- ## [0.4.5] - 2025-11-21
9
-
10
- ### Added
11
-
12
- - NOTIFY_APP_NAME ENV var for CI runs in 5700751d (e2c75ff)
13
- - Support for alphanumery patch version tag matching in 5c17ce36 (e2c75ff)
14
- - Info in the README about adding trailers in development of Reissue (68117e0)
8
+ ## [0.4.7] - 2025-12-10
15
9
 
16
10
  ### Fixed
17
11
 
18
- - Duplicate changelog entries with incorrect release dates. (1e03b68)
12
+ - Git command failures now raise detailed errors with full output (d87ffd3)
13
+ - Bundle install skipped when no Gemfile exists in directory (d87ffd3)
14
+ - Changelog file configuration ignored in reissue task (35b5a30)
15
+
16
+ ### Added
19
17
 
20
- ## [0.4.4] - 2025-10-17
18
+ - Error messages include command, exit status, stdout, and stderr (d87ffd3)
21
19
 
22
20
  ### Changed
23
21
 
24
- - Derive TRAILER_REGEX from VALID_SECTIONS to eliminate duplication (32b963e)
25
- - Updated example Rakefile to include version trailer configuration (4f2a254)
26
- - Replace Qlty with native SimpleCov coverage reporting in CI (764d6ba)
22
+ - All critical git operations now use comprehensive error checking (d87ffd3)
23
+
24
+ ## [0.4.6] - 2025-12-05
27
25
 
28
26
  ### Added
29
27
 
30
- - Version trailer parsing methods to GitFragmentHandler (0434f69)
31
- - Version bump rake task with idempotency protection (9ff858a)
32
- - Build task enhancement to process version trailers before finalize (b5a05b7)
33
- - Release flow integration documentation and verification tests (e038230)
34
- - Version bumping documentation to README.md (4f2a254)
35
- - Version trailer examples and usage guide (4f2a254)
36
- - PR comments showing code coverage percentage and threshold status (bfa4619)
37
- - ChatNotifier to update slack about CI runs (55dfeb8)
28
+ - NOTIFY_APP_NAME ENV var for CI runs in 5700751d (e2c75ff)
29
+ - Support for alphanumery patch version tag matching in 5c17ce36 (e2c75ff)
30
+ - Info in the README about adding trailers in development of Reissue (68117e0)
38
31
 
39
32
  ### Fixed
40
33
 
41
- - Namespace loading problem when building a new release with Gem::Version. (c5fffd0)
34
+ - Duplicate changelog entries with incorrect release dates. (1e03b68)
35
+
36
+ ### Changed
37
+
38
+ - Branch naming convention to use distinct prefixes for finalize vs reissue (d1add14)
@@ -119,16 +119,29 @@ module Reissue
119
119
  commits.each do |commit|
120
120
  sha = commit[:sha]
121
121
  message = commit[:message]
122
+ lines = message.lines
122
123
 
123
- # Split commit message into lines and look for trailers
124
- message.lines.each do |line|
125
- line = line.strip
126
- next if line.empty?
124
+ i = 0
125
+ while i < lines.length
126
+ line = lines[i].rstrip
127
+ i += 1
128
+ next if line.strip.empty?
127
129
 
128
130
  if (match = line.match(TRAILER_REGEX))
129
131
  section_name = normalize_section_name(match[1])
130
132
  trailer_value = match[2].strip
131
133
 
134
+ # Collect continuation lines (non-empty lines that don't start a new changelog trailer)
135
+ while i < lines.length
136
+ next_line = lines[i].rstrip
137
+ # Stop at empty line or another changelog trailer
138
+ break if next_line.strip.empty?
139
+ break if next_line.match(TRAILER_REGEX)
140
+
141
+ trailer_value += " #{next_line.strip}"
142
+ i += 1
143
+ end
144
+
132
145
  result[section_name] ||= []
133
146
  # Append the short SHA in parentheses
134
147
  result[section_name] << "#{trailer_value} (#{sha})"
data/lib/reissue/rake.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rake/tasklib"
4
+ require "open3"
4
5
  require_relative "../reissue"
5
6
 
6
7
  module Reissue
@@ -114,6 +115,20 @@ module Reissue
114
115
  attr_reader :formatter, :tasker
115
116
  private :formatter, :tasker
116
117
 
118
+ # Run a shell command and raise an error with details if it fails
119
+ def run_command(command, error_message)
120
+ stdout, stderr, status = Open3.capture3(command)
121
+ unless status.success?
122
+ error_details = [error_message]
123
+ error_details << "Command: #{command}"
124
+ error_details << "Exit status: #{status.exitstatus}"
125
+ error_details << "STDOUT: #{stdout.strip}" unless stdout.strip.empty?
126
+ error_details << "STDERR: #{stderr.strip}" unless stderr.strip.empty?
127
+ raise error_details.join("\n")
128
+ end
129
+ stdout
130
+ end
131
+
117
132
  def finalize_with_branch?
118
133
  push_finalize == :branch
119
134
  end
@@ -131,7 +146,7 @@ module Reissue
131
146
  end
132
147
 
133
148
  def bundle
134
- if defined?(Bundler)
149
+ if defined?(Bundler) && File.exist?("Gemfile")
135
150
  Bundler.with_unbundled_env do
136
151
  system("bundle install")
137
152
  end
@@ -145,6 +160,7 @@ module Reissue
145
160
  new_version = formatter.call(
146
161
  segment:,
147
162
  version_file:,
163
+ changelog_file:,
148
164
  version_limit:,
149
165
  version_redo_proc:,
150
166
  fragment: fragment
@@ -153,9 +169,9 @@ module Reissue
153
169
 
154
170
  tasker["#{name}:clear_fragments"].invoke
155
171
 
156
- system("git add -u")
172
+ run_command("git add -u", "Failed to stage updated files")
157
173
  if updated_paths&.any?
158
- system("git add #{updated_paths.join(" ")}")
174
+ run_command("git add #{updated_paths.join(" ")}", "Failed to stage additional paths: #{updated_paths.join(", ")}")
159
175
  end
160
176
 
161
177
  bump_message = "Bump version to #{new_version}"
@@ -163,7 +179,7 @@ module Reissue
163
179
  if reissue_version_with_branch?
164
180
  tasker["#{name}:branch"].invoke("reissue/#{new_version}")
165
181
  end
166
- system("git commit -m '#{bump_message}'")
182
+ run_command("git commit -m '#{bump_message}'", "Failed to commit version bump")
167
183
  tasker["#{name}:push"].invoke if push_reissue?
168
184
  else
169
185
  system("echo '#{bump_message}'")
@@ -197,10 +213,11 @@ module Reissue
197
213
  finalize_message = "Finalize the changelog for version #{version} on #{date}"
198
214
  if commit_finalize
199
215
  if finalize_with_branch?
200
- tasker["#{name}:branch"].invoke("reissue/#{version}")
216
+ # Use "finalize/" prefix for the version being released
217
+ tasker["#{name}:branch"].invoke("finalize/#{version}")
201
218
  end
202
- system("git add -u")
203
- system("git commit -m '#{finalize_message}'")
219
+ run_command("git add -u", "Failed to stage finalized changelog")
220
+ run_command("git commit -m '#{finalize_message}'", "Failed to commit finalized changelog")
204
221
  tasker["#{name}:push"].invoke if push_finalize?
205
222
  else
206
223
  system("echo '#{finalize_message}'")
@@ -223,14 +240,14 @@ module Reissue
223
240
  # Delete matching tag if it exists
224
241
  system("git tag -d v#{version} 2>/dev/null || true")
225
242
  # Delete the branch
226
- system("git branch -D #{branch_name}")
243
+ run_command("git branch -D #{branch_name}", "Failed to delete existing branch #{branch_name}")
227
244
  end
228
- system("git checkout -b #{branch_name}")
245
+ run_command("git checkout -b #{branch_name}", "Failed to create and checkout branch #{branch_name}")
229
246
  end
230
247
 
231
248
  desc "Push the current branch to the remote repository."
232
249
  task "#{name}:push" do
233
- system("git push origin HEAD")
250
+ run_command("git push origin HEAD", "Failed to push to remote repository")
234
251
  end
235
252
 
236
253
  desc "Preview changelog entries that will be added from fragments or git trailers"
@@ -287,8 +304,8 @@ module Reissue
287
304
  formatter.clear_fragments(fragment)
288
305
  clear_message = "Clear changelog fragments"
289
306
  if commit_clear_fragments
290
- system("git add #{fragment}")
291
- system("git commit -m '#{clear_message}'")
307
+ run_command("git add #{fragment}", "Failed to stage cleared fragments")
308
+ run_command("git commit -m '#{clear_message}'", "Failed to commit cleared fragments")
292
309
  else
293
310
  system("echo '#{clear_message}'")
294
311
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Reissue
4
- VERSION = "0.4.5"
4
+ VERSION = "0.4.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reissue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay