inventory_refresh 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba062c3d0e3f8355def18ece2eab7ad2c9ee6e2eb98420473f4101d2d2945a65
4
- data.tar.gz: c3fcc1bfc13384de18fc20db6a315f8a9fa8c205153de9b21b7877a9a8e02929
3
+ metadata.gz: b6942604d2501cd3b0bf5245144f1a90cf2c63d314774eae29a7d0a76af5c82e
4
+ data.tar.gz: 881b3474280819e6fec3a222bd460d47bb757926e265c04232eb3b9c2632ddc3
5
5
  SHA512:
6
- metadata.gz: ae6d904a94d75f73699a614f8b3e5dd83f4c53e39874eda2df37c900856da26b16b5d0bdf93917b495de2aef599ab08ad6959c935413a1caa223a114a01c9d11
7
- data.tar.gz: 784a2b2c2e154bcf6b827a6a51ce7a09d6533dedefea0457313d0efe325284621a5a3a7988393c6b6cb5652909f5c3756269d98dfea0437cfe666e6a858462b6
6
+ metadata.gz: 7d831efe8b6f4e3ca0a9187ea133ad7c0da372aa80b86d0219fccf77abb8b870e4ccce2a4acbd4d4a39cfe0d86cecaf15b7f3ecd7812d52b0fdbfa537674345e
7
+ data.tar.gz: de6d47d1e11c101ede913c66f74a589d14500ce5c96be8e7ba85adbd91be8a57f21850ae4aee57af736dbe1917616481164e1ffe596793bf6abdf373da61a987
data/.codeclimate.yml CHANGED
@@ -12,7 +12,7 @@ plugins:
12
12
  rubocop:
13
13
  enabled: true
14
14
  config: ".rubocop_cc.yml"
15
- channel: rubocop-0-82
15
+ channel: rubocop-1-56-3
16
16
  brakeman:
17
17
  enabled: false
18
18
  bundler-audit:
@@ -12,20 +12,17 @@ jobs:
12
12
  strategy:
13
13
  matrix:
14
14
  ruby-version:
15
- - '2.7'
16
15
  - '3.0'
17
16
  - '3.1'
17
+ - '3.2'
18
+ - '3.3'
18
19
  rails-version:
19
- # rails 6.1 supports ruby >= 2.5
20
- # rails 7.0 supports ruby >= 2.7
21
- - '6.1'
22
20
  - '7.0'
23
- include:
24
- # rails 6.0 (security EOL 6/23?) supports ruby < 2.8 (2.7 EOL 3/23?;)
25
- - ruby-version: '2.6'
26
- rails-version: '6.0'
27
- - ruby-version: '2.7'
28
- rails-version: '6.0'
21
+ - '7.1'
22
+ - '7.2'
23
+ exclude:
24
+ - ruby-version: '3.0'
25
+ rails-version: '7.2'
29
26
  services:
30
27
  postgres:
31
28
  image: manageiq/postgresql:13
@@ -54,6 +51,6 @@ jobs:
54
51
  - name: Run tests
55
52
  run: bundle exec rake
56
53
  - name: Report code coverage
57
- if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '2.7' && matrix.rails-version == '6.1' }}
54
+ if: ${{ github.ref == 'refs/heads/master' && matrix.ruby-version == '3.1' && matrix.rails-version == '7.0' }}
58
55
  continue-on-error: true
59
- uses: paambaati/codeclimate-action@v5
56
+ uses: paambaati/codeclimate-action@v9
data/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.2.0] - 2024-09-30
9
+ ### Changed
10
+ - Drop old versions of ruby and rails, add ruby 3.3 and rails 7.2 ([#139](https://github.com/ManageIQ/inventory_refresh/pull/139))
11
+
12
+ ## [2.1.1] - 2024-08-06
13
+ ### Fixed
14
+ - Fix rails 7 deprecation on ActiveRecord::Base.default_timezone ([#124](https://github.com/ManageIQ/inventory_refresh/pull/124))
15
+ - Fix missing constant OpenStruct in tests ([#131](https://github.com/ManageIQ/inventory_refresh/pull/131))
16
+
17
+ ### Added
18
+ - Test with ruby 3.2 and rails 7.1 ([#122](https://github.com/ManageIQ/inventory_refresh/pull/122))
19
+ - Log destroy result when duplicate record is found ([#120](https://github.com/ManageIQ/inventory_refresh/pull/120))
20
+ - Use ruby 3.1 and rails 7 for code coverage ([#136](https://github.com/ManageIQ/inventory_refresh/pull/136))
21
+
8
22
  ## [2.1.0] - 2024-02-08
9
23
  ### Changed
10
24
  - Update GitHub Actions versions ([#117](https://github.com/ManageIQ/inventory_refresh/pull/117))
data/Gemfile CHANGED
@@ -6,11 +6,14 @@ require File.join(Bundler::Plugin.index.load_paths("bundler-inject")[0], "bundle
6
6
  # Specify your gem's dependencies in inventory_refresh.gemspec
7
7
  gemspec
8
8
 
9
- case ENV['TEST_RAILS_VERSION']
10
- when "5.2"
11
- gem "activerecord", "~>5.2.6"
12
- when "6.0"
13
- gem "activerecord", "~>6.0.4"
14
- when "6.1"
15
- gem "activerecord", "~>6.1.4"
16
- end
9
+ minimum_version =
10
+ case ENV['TEST_RAILS_VERSION']
11
+ when "7.2"
12
+ "~>7.2.1"
13
+ when "7.1"
14
+ "~>7.1.4"
15
+ else
16
+ "~>7.0.8"
17
+ end
18
+
19
+ gem "activerecord", minimum_version
@@ -22,7 +22,8 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
  spec.metadata['rubygems_mfa_required'] = 'true'
24
24
 
25
- spec.add_dependency "activerecord", ">=5.0", "<7.1"
25
+ spec.required_ruby_version = '>= 3.0'
26
+ spec.add_dependency "activerecord", ">=7.0.8", "<8.0"
26
27
  spec.add_dependency "more_core_extensions", ">=3.5", "< 5"
27
28
  spec.add_dependency "pg", "> 0"
28
29
 
@@ -30,7 +31,7 @@ Gem::Specification.new do |spec|
30
31
  spec.add_development_dependency "bundler", "~> 2.0"
31
32
  spec.add_development_dependency "factory_bot", "~> 4.11.1"
32
33
  spec.add_development_dependency "manageiq-style"
33
- spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "rake", "~> 13.2"
34
35
  spec.add_development_dependency "rspec", "~> 3.0"
35
36
  spec.add_development_dependency "simplecov", ">= 0.21.2"
36
37
  end
@@ -111,7 +111,8 @@ module InventoryRefresh
111
111
 
112
112
  raise ArgumentError, "only one of manager_uuid or manager_uuid_hash must be passed" unless !!manager_uuid ^ !!manager_uuid_hash.present?
113
113
 
114
- ActiveSupport::Deprecation.warn("Passing a hash for options is deprecated and will be removed in an upcoming release.") if opts.present?
114
+ # TODO: switch to ActiveSupport.deprecator.warn once 7.1+ is a minimum, see: https://github.com/rails/rails/pull/47354
115
+ ActiveSupport::Deprecation.new.warn("Passing a hash for options is deprecated and will be removed in an upcoming release.") if opts.present?
115
116
 
116
117
  manager_uuid ||= manager_uuid_hash
117
118
 
@@ -269,14 +269,8 @@ module InventoryRefresh::SaveCollection
269
269
  true
270
270
  end
271
271
 
272
- # @return [Time] A rails friendly time getting config from ActiveRecord::Base.default_timezone (can be :local
273
- # or :utc)
274
272
  def time_now
275
- if ActiveRecord::Base.default_timezone == :utc
276
- Time.now.utc
277
- else
278
- Time.zone.now
279
- end
273
+ Time.current
280
274
  end
281
275
 
282
276
  # Enriches data hash with timestamp columns
@@ -43,9 +43,9 @@ module InventoryRefresh::SaveCollection
43
43
  if unique_db_indexes.include?(index) # Include on Set is O(1)
44
44
  # We have a duplicate in the DB, destroy it. A find_each method does automatically .order(:id => :asc)
45
45
  # so we always keep the oldest record in the case of duplicates.
46
- logger.warn("A duplicate record was detected and destroyed, inventory_collection: "\
46
+ destroyed = record.destroy ? "and destroyed" : "but could not be destroyed"
47
+ logger.warn("A duplicate record was detected #{destroyed}, inventory_collection:" \
47
48
  "'#{inventory_collection}', record: '#{record}', duplicate_index: '#{index}'")
48
- record.destroy
49
49
  return false
50
50
  else
51
51
  unique_db_indexes << index
@@ -1,3 +1,3 @@
1
1
  module InventoryRefresh
2
- VERSION = "2.1.0".freeze
2
+ VERSION = "2.2.0".freeze
3
3
  end
data/renovate.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:recommended"
5
+ ]
6
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inventory_refresh
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ManageIQ Developers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-08 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: 7.0.8
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.1'
22
+ version: '8.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '5.0'
29
+ version: 7.0.8
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.1'
32
+ version: '8.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: more_core_extensions
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -126,14 +126,14 @@ dependencies:
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '10.0'
129
+ version: '13.2'
130
130
  type: :development
131
131
  prerelease: false
132
132
  version_requirements: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
- version: '10.0'
136
+ version: '13.2'
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: rspec
139
139
  requirement: !ruby/object:Gem::Requirement
@@ -233,6 +233,7 @@ files:
233
233
  - lib/inventory_refresh/target.rb
234
234
  - lib/inventory_refresh/target_collection.rb
235
235
  - lib/inventory_refresh/version.rb
236
+ - renovate.json
236
237
  homepage: https://github.com/ManageIQ/inventory_refresh
237
238
  licenses:
238
239
  - Apache-2.0
@@ -246,7 +247,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
246
247
  requirements:
247
248
  - - ">="
248
249
  - !ruby/object:Gem::Version
249
- version: '0'
250
+ version: '3.0'
250
251
  required_rubygems_version: !ruby/object:Gem::Requirement
251
252
  requirements:
252
253
  - - ">="