dragnet 5.4.1 → 6.0.0

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: e401f3864f8d30d24e60a21ad9d8751e6be22cf0b82e8defecd49e3b019bd9f3
4
- data.tar.gz: ad197e8038918748dd9deee612a89acdfe99f12776e56bf6bdb9f105139659c5
3
+ metadata.gz: f7d753aca8090f87852e9d4e85f021c6ce0a8500210385337651316119b52c44
4
+ data.tar.gz: 8feb400e7bc41e1f41bc8987d1777273ee8dd7075a8c6ffcbc3d7d5091e01a8b
5
5
  SHA512:
6
- metadata.gz: 93c72bfe1da3aaf68bc674953ff8201a99a6f1fbc5677e401ca215c0d005641b782634fdb5b9225b321601fae6642802275094b781d2549b695d096b2f896999
7
- data.tar.gz: 2243730c112f9319941b95939b424f83b1be678b51d3fe90276c6a577d6a156c270583818dc9971fde2cda98984694c0751d4b04383e5e11b074cc63f38dd653
6
+ metadata.gz: 76d385680a7d5a5610f8d959f23e1e3c9f73fd4adf8dca34aa8ab82b7dd65ded853aa20b7361f93443d02626e954079784d5ee036694ee8de2076bbeb18d2df5
7
+ data.tar.gz: fce543298fcc34525a61abbc2c268b86eb971a95cd842a5cce5f0bc503b38cfa36310ebffb642957c5b2706b55d54d21437f23ba2f5f212339b2d482618fab79
@@ -17,10 +17,10 @@ jobs:
17
17
 
18
18
  steps:
19
19
  - uses: actions/checkout@v4
20
- - name: Set up Ruby 2.7
20
+ - name: Set up Ruby 3.1
21
21
  uses: ruby/setup-ruby@v1
22
22
  with:
23
- ruby-version: 2.7.7
23
+ ruby-version: 3.1.0
24
24
  - name: Build
25
25
  run: |
26
26
  bundler install
@@ -22,7 +22,7 @@ jobs:
22
22
  - name: Set up Ruby
23
23
  uses: ruby/setup-ruby@v1
24
24
  with:
25
- ruby-version: '2.7'
25
+ ruby-version: '3.1'
26
26
  - name: Install Gems
27
27
  run: |
28
28
  bundler install
@@ -22,7 +22,7 @@ jobs:
22
22
  runs-on: ubuntu-latest
23
23
  strategy:
24
24
  matrix:
25
- ruby-version: ['2.7', '3.0']
25
+ ruby-version: ['3.1']
26
26
 
27
27
  steps:
28
28
  - uses: actions/checkout@v4
@@ -25,7 +25,7 @@ jobs:
25
25
  # uses: ruby/setup-ruby@v1
26
26
  uses: ruby/setup-ruby@v1
27
27
  with:
28
- ruby-version: 2.7.7
28
+ ruby-version: 3.1.0
29
29
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
30
30
  - name: Test Results and Coverage
31
31
  run:
@@ -22,7 +22,7 @@ jobs:
22
22
  - name: Set up Ruby
23
23
  uses: ruby/setup-ruby@v1
24
24
  with:
25
- ruby-version: '2.7'
25
+ ruby-version: '3.1'
26
26
  - name: Install Gems
27
27
  run: |
28
28
  bundler install
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.7
1
+ 3.1.0
data/CHANGELOG.md CHANGED
@@ -8,6 +8,17 @@ Please mark backwards incompatible changes with an exclamation mark at the start
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [6.0.0] - 2025-09-23
12
+
13
+ ### Changed
14
+ - ! Updated the `git` gem dependency from `~> 1.8` to `~> 3`
15
+ - ! Set the minimum Ruby version requirement to `3.1.0`
16
+
17
+ ## [5.4.2] - 2025-05-22
18
+
19
+ ### Fixed
20
+ - Dragnet no longer crashes when an invalid / non-existing SHA1 is used in a MTR.
21
+
11
22
  ## [5.4.1] - 2025-04-23
12
23
 
13
24
  ### Fixed
data/README.md CHANGED
@@ -43,7 +43,7 @@ any platform or use one of the official Docker images.
43
43
 
44
44
  ## Requirements
45
45
 
46
- * Ruby >= 2.7.0 (MRI)
46
+ * Ruby >= 3.1.0 (MRI)
47
47
  * Bundler >= 2.4.0
48
48
  * Git >= 2.0.0
49
49
 
data/dragnet.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  'performed.'
16
16
  spec.homepage = 'https://github.com/esrlabs/dragnet'
17
17
  spec.license = 'MIT'
18
- spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
18
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.1.0')
19
19
 
20
20
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
21
 
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  spec.add_runtime_dependency 'activesupport', '~> 7'
27
27
  spec.add_runtime_dependency 'colorize', '~> 0.8'
28
- spec.add_runtime_dependency 'git', '~> 1.8'
28
+ spec.add_runtime_dependency 'git', '~> 3'
29
29
  spec.add_runtime_dependency 'thor', '~> 1.1'
30
30
 
31
31
  # Specify which files should be added to the gem when it is released.
@@ -1,12 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative '../verification_result'
4
+ require_relative 'mixins/git_error_handling'
4
5
  require_relative 'repository_verifier'
5
6
 
6
7
  module Dragnet
7
8
  module Verifiers
8
9
  # Checks for changes in the repository since the creation of the MTR Record
9
10
  class ChangesVerifier < Dragnet::Verifiers::RepositoryVerifier
11
+ include ::Dragnet::Verifiers::Mixins::GitErrorHandling
12
+
10
13
  attr_reader :test_records
11
14
 
12
15
  # @param [Dragnet::TestRecord] test_record The +TestRecord+ object to
@@ -33,6 +36,8 @@ module Dragnet
33
36
  return unless diff.size.positive?
34
37
 
35
38
  find_changes(diff)
39
+ rescue Git::FailedError => e
40
+ result_from_git_error(e)
36
41
  end
37
42
 
38
43
  private
@@ -44,7 +49,7 @@ module Dragnet
44
49
  # the details of the changes found in the repository, or +nil+ if no
45
50
  # changes were found.
46
51
  def find_changes(diff)
47
- diff.stats[:files].each do |file, _changes|
52
+ diff.stats[:files].each_key do |file|
48
53
  next if mtr_files.include?(file) # Changes to MTR files are ignored.
49
54
 
50
55
  return Dragnet::VerificationResult.new(
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative '../verification_result'
4
+ require_relative 'mixins/git_error_handling'
4
5
  require_relative 'repository_verifier'
5
6
 
6
7
  module Dragnet
@@ -8,6 +9,8 @@ module Dragnet
8
9
  # Checks if any of the files listed in the MTR have changed since the MTR
9
10
  # was created.
10
11
  class FilesVerifier < Dragnet::Verifiers::RepositoryVerifier
12
+ include ::Dragnet::Verifiers::Mixins::GitErrorHandling
13
+
11
14
  # Executes the verification process.
12
15
  # Checks the changes in the repository. If a change in one of the files
13
16
  # is detected a +:result+ key is added to the MTR, including the detected
@@ -26,6 +29,8 @@ module Dragnet
26
29
  end
27
30
 
28
31
  result_from(changes) if changes.any?
32
+ rescue Git::FailedError => e
33
+ result_from_git_error(e)
29
34
  end
30
35
 
31
36
  private
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Dragnet
4
+ module Verifiers
5
+ module Mixins
6
+ # A mixin that provides methods to gracefully handle errors during Git's
7
+ # execution.
8
+ module GitErrorHandling
9
+ private
10
+
11
+ # @param [Git::FailedError] error The error that occurred during the
12
+ # verification.
13
+ # @return [Dragnet::VerificationResult] A +VerificationResult+ object that
14
+ # encapsulates the occurred error so that it can be presented to the
15
+ # user.
16
+ def result_from_git_error(error)
17
+ Dragnet::VerificationResult.new(
18
+ status: :failed,
19
+ reason: "Unable to diff the revisions: #{shorten_sha1(sha1)}..#{shorten_sha1(repository.head.sha)}: " \
20
+ "#{error.result.stdout}"
21
+ )
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dragnet
4
- VERSION = '5.4.1'
4
+ VERSION = '6.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dragnet
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.1
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ESR Labs GmbH
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-23 00:00:00.000000000 Z
11
+ date: 2025-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.8'
47
+ version: '3'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.8'
54
+ version: '3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -155,6 +155,7 @@ files:
155
155
  - lib/dragnet/verifiers.rb
156
156
  - lib/dragnet/verifiers/changes_verifier.rb
157
157
  - lib/dragnet/verifiers/files_verifier.rb
158
+ - lib/dragnet/verifiers/mixins/git_error_handling.rb
158
159
  - lib/dragnet/verifiers/repos_verifier.rb
159
160
  - lib/dragnet/verifiers/repository_verifier.rb
160
161
  - lib/dragnet/verifiers/result_verifier.rb
@@ -177,14 +178,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
177
178
  requirements:
178
179
  - - ">="
179
180
  - !ruby/object:Gem::Version
180
- version: 2.7.0
181
+ version: 3.1.0
181
182
  required_rubygems_version: !ruby/object:Gem::Requirement
182
183
  requirements:
183
184
  - - ">="
184
185
  - !ruby/object:Gem::Version
185
186
  version: '0'
186
187
  requirements: []
187
- rubygems_version: 3.1.6
188
+ rubygems_version: 3.3.3
188
189
  signing_key:
189
190
  specification_version: 4
190
191
  summary: A gem to verify, validate and analyse MTR (Manual Test Record) files.