simp-rake-helpers 6.0.0 → 6.0.1

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: a5c6dcd39818c575a5e55c997ea3425895952a3913e743f8472f1368c86324c5
4
- data.tar.gz: 562f3641c404e562a1d64cec2fa4b11f4e3206d9a0c4c1605c2f60651f87a0b0
3
+ metadata.gz: 6c2d53a38c2de737dc4cdb29dab1a6d362fb826d338553f4885769d68e6c4a51
4
+ data.tar.gz: 0c58a8d0201d7769eb87d6e850f577c265417816e2642821e0a536df0479f2db
5
5
  SHA512:
6
- metadata.gz: 365f2731d24ee8ea5d830a6d055ecd024bf2a1bf448bfffdb259a88126244ae81ea3fbd4704d2b92241380a7ba45ce3962beb2d58bc2213a3dd537820604b5eb
7
- data.tar.gz: c2f1258d8ee380d03667c852f48222e4f4b2de2865d49abf9ee5a95d523c3c4a36f972e1edf8562a590c254e493e0d6edb798213e2f21914f3b90017eb919764
6
+ metadata.gz: fc790074c35b763dcc443c802f3bd6fdd5feec39bf6875e1450ac0393b42b10cadf38264c651c509da4703956b2f276695c161e16eef26000067789042573c9e
7
+ data.tar.gz: 8821a81110d60f0c28a689cc9e2e35ef4c32b5c5fbd57e48b56a491dc40e90fc49843c9d510ae6e1fa23eaac46649d10b1d1d8bca5b39752615e5be051fd4d68
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ### 6.0.1 / 2026-08-26
2
+ - Fixed
3
+ - `pkg:check_version` no longer misreads CHANGELOG versions with a two-digit
4
+ major. It parsed the entry with its own regex whose greedy leading match
5
+ consumed the first digit of the major, so `12.2.1` was read as `2.2.1` and
6
+ reported as out of date. It now uses
7
+ `Simp::ComponentInfo::CHANGELOG_ENTRY_REGEX`, the same entry regex used by
8
+ `Simp::ComponentInfo` and `Simp::RelChecks`. Affected every component
9
+ released since `10.0.0`; single-digit majors were unaffected.
10
+ - `pkg:check_version` now reports a malformed newest CHANGELOG entry instead
11
+ of skipping it. Skipping fell through to an older entry and reported that
12
+ entry's stale version as out of date, pointing at the wrong problem.
13
+ - The deprecated top-level `compare_latest_tag` task now uses the
14
+ `CHANGELOG_ENTRY_REGEX` constant already defined in its own class instead of
15
+ an inline copy that had drifted (it required a zero-padded day).
16
+
1
17
  ### 6.0.0 / 2026-06-25
2
18
  - Added
3
19
  - `pupmod:build` rake task using `puppet-modulebuilder`, replacing `pdk build`
@@ -8,4 +8,4 @@ gem_sources = ENV.key?('SIMP_GEM_SERVERS') ? ENV['SIMP_GEM_SERVERS'].split(/[,
8
8
 
9
9
  gem_sources.each { |gem_source| source gem_source }
10
10
 
11
- gem 'simp-rake-helpers', '~> 5.0'
11
+ gem 'simp-rake-helpers', '~> 6.0'
@@ -4,5 +4,5 @@ module Simp; end
4
4
  module Simp::Rake; end
5
5
 
6
6
  class Simp::Rake::Helpers
7
- VERSION = '6.0.0'
7
+ VERSION = '6.0.1'
8
8
  end
data/lib/simp/rake/pkg.rb CHANGED
@@ -9,6 +9,7 @@ require 'rake/clean'
9
9
  require 'rake/tasklib'
10
10
  require 'fileutils'
11
11
  require 'find'
12
+ require 'simp/componentinfo'
12
13
  require 'simp/relchecks'
13
14
  require 'simp/rpm'
14
15
  require 'simp/rake/helpers/rpm_spec'
@@ -475,15 +476,35 @@ class Simp::Rake::Pkg < Rake::TaskLib
475
476
  changelog = File.read('CHANGELOG')
476
477
  changelog_version = nil
477
478
 
478
- # Find the first date line
479
+ # Only the newest entry is considered; it is the one that
480
+ # has to agree with metadata.json.
481
+ #
482
+ # Use the shared entry regex rather than an ad hoc one: a
483
+ # greedy leading match swallows the first digit of a
484
+ # two-digit major version (12.2.1 parsed as 2.2.1).
485
+ #
486
+ # Report a malformed newest entry instead of skipping it.
487
+ # Skipping falls through to an older entry and blames its
488
+ # stale version, pointing at the wrong problem.
489
+ malformed_entry = nil
490
+
479
491
  changelog.each_line do |line|
480
- if line =~ %r{\*.*(\d+\.\d+\.\d+)(-\d+)?\s*$}
481
- changelog_version = ::Regexp.last_match(1)
482
- break
492
+ next unless line.start_with?('*')
493
+
494
+ match = Simp::ComponentInfo::CHANGELOG_ENTRY_REGEX.match(line)
495
+
496
+ if match
497
+ changelog_version = match[3]
498
+ else
499
+ malformed_entry = line.strip
483
500
  end
501
+
502
+ break
484
503
  end
485
504
 
486
- if changelog_version
505
+ if malformed_entry
506
+ puts "#{@pkg_name}: Error: Malformed CHANGELOG entry: '#{malformed_entry}'"
507
+ elsif changelog_version
487
508
  if changelog_version == mod_version
488
509
  puts success_msg
489
510
  else
@@ -367,7 +367,7 @@ class Simp::Rake::Pupmod::Helpers < Rake::TaskLib
367
367
  # determine latest version from CHANGELOG, which will present
368
368
  # for all SIMP Puppet modules
369
369
  line = File.readlines('CHANGELOG')[0]
370
- match = line.match(%r{^\*\s+((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{2} \d{4})\s+(.+<.+>)(?:\s+|\s*-\s*)?(\d+\.\d+\.\d+)})
370
+ match = line.match(CHANGELOG_ENTRY_REGEX)
371
371
  unless match
372
372
  raise("ERROR: Invalid CHANGELOG entry. Unable to extract version from '#{line}'")
373
373
  end
@@ -34,6 +34,17 @@ describe 'Simp::ComponentInfo changelog regex' do
34
34
  expect(result[3]).to eq '3.8.0'
35
35
  expect(result[4]).to be_nil
36
36
  end
37
+
38
+ # A greedy leading match consumes the first digit of the major version,
39
+ # yielding '2.2.1' here. Guards the ad hoc regex that pkg:check_version
40
+ # used to carry.
41
+ it 'captures the full major version of a two-digit major without a release qualifier' do
42
+ line = '* Mon Aug 24 2026 Tom Smith <tom.smith@simp-project.com> - 12.2.1'
43
+ result = line.match(Simp::ComponentInfo::CHANGELOG_ENTRY_REGEX)
44
+ expect(result).not_to be_nil
45
+ expect(result[3]).to eq '12.2.1'
46
+ expect(result[4]).to be_nil
47
+ end
37
48
  end
38
49
 
39
50
  context 'invalid initial changelog lines' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-rake-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
8
8
  - Trevor Vaughan
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-25 00:00:00.000000000 Z
11
+ date: 2026-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simp-beaker-helpers
@@ -637,7 +637,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
637
637
  - !ruby/object:Gem::Version
638
638
  version: '0'
639
639
  requirements: []
640
- rubygems_version: 4.0.10
640
+ rubygems_version: 4.0.16
641
641
  specification_version: 4
642
642
  summary: SIMP rake helpers
643
643
  test_files: []