avrolution 0.7.2 → 0.9.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: 444e46752c437b989bfebbf5370818c0fc770acae6e11b41c17846d89c6cc0f4
4
- data.tar.gz: 9b3a81634fea7865ab3189b1a0576a072986b37efe76f22ecf19b7df035495e4
3
+ metadata.gz: 80fc2f8ce1e35eb68aa06fe4172a56c6bdd78d759a20dfc8d0d5537a66c2929f
4
+ data.tar.gz: 11e3e8adcfa4a48723cb56e12b4057bf85747f037fd6860cc58a1a01771740a9
5
5
  SHA512:
6
- metadata.gz: 7aab59b4a3da8b0a429c1b607c072caa8b20a0c88f27943d604f0b3c2e5dba6ae975344fa553eaf194b5c186b09a5edf718260db3139f20e31e5a6eebd5806cb
7
- data.tar.gz: 938cb343916b6a6c85edb46f78526bc760c5339d16cbd586f75dfa0730f17da3d49891841a533a06bcc3db38953465e98161847290f99982f37a86efb9959330
6
+ metadata.gz: f151058641e61ca2446f5bb15cc84f413baa26fbdfb9aef3efb7136299c4e64dafeb59958003a183c5aec3c1bd297b01bbdba8d303ab336a0dda5f19a0aa481b
7
+ data.tar.gz: 96624556c6e65cf0d3f32d1a165ae1fd47363a1c701e1a85b5c851059d1a8feeb5e4a441c255278f0b70df2878cc6d3b12b4aa35865b6efb0e3c2504ec09d099
data/.circleci/config.yml CHANGED
@@ -2,14 +2,14 @@ version: 2.1
2
2
  jobs:
3
3
  lint:
4
4
  docker:
5
- - image: salsify/ruby_ci:2.6.6
6
- working_directory: ~/avromatic
5
+ - image: salsify/ruby_ci:2.7.7
6
+ working_directory: ~/avrolution
7
7
  steps:
8
8
  - checkout
9
9
  - restore_cache:
10
10
  keys:
11
- - v2-gems-ruby-2.6.6-{{ checksum "avromatic.gemspec" }}-{{ checksum "Gemfile" }}
12
- - v2-gems-ruby-2.6.6-
11
+ - v2-gems-ruby-2.7.7-{{ checksum "avrolution.gemspec" }}-{{ checksum "Gemfile" }}
12
+ - v2-gems-ruby-2.7.7-
13
13
  - run:
14
14
  name: Install Gems
15
15
  command: |
@@ -18,7 +18,7 @@ jobs:
18
18
  bundle clean
19
19
  fi
20
20
  - save_cache:
21
- key: v2-gems-ruby-2.6.6-{{ checksum "avromatic.gemspec" }}-{{ checksum "Gemfile" }}
21
+ key: v2-gems-ruby-2.7.7-{{ checksum "avrolution.gemspec" }}-{{ checksum "Gemfile" }}
22
22
  paths:
23
23
  - "vendor/bundle"
24
24
  - "gemfiles/vendor/bundle"
@@ -33,12 +33,12 @@ jobs:
33
33
  - image: salsify/ruby_ci:<< parameters.ruby-version >>
34
34
  environment:
35
35
  CIRCLE_TEST_REPORTS: "test-results"
36
- working_directory: ~/avromatic
36
+ working_directory: ~/avrolution
37
37
  steps:
38
38
  - checkout
39
39
  - restore_cache:
40
40
  keys:
41
- - v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avromatic.gemspec" }}-{{ checksum "Gemfile" }}
41
+ - v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avrolution.gemspec" }}-{{ checksum "Gemfile" }}
42
42
  - v2-gems-ruby-<< parameters.ruby-version >>-
43
43
  - run:
44
44
  name: Install Gems
@@ -48,7 +48,7 @@ jobs:
48
48
  bundle clean
49
49
  fi
50
50
  - save_cache:
51
- key: v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avromatic.gemspec" }}-{{ checksum "Gemfile" }}
51
+ key: v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avrolution.gemspec" }}-{{ checksum "Gemfile" }}
52
52
  paths:
53
53
  - "vendor/bundle"
54
54
  - "gemfiles/vendor/bundle"
@@ -66,6 +66,7 @@ workflows:
66
66
  matrix:
67
67
  parameters:
68
68
  ruby-version:
69
- - "2.6.6"
70
- - "2.7.2"
71
- - "3.0.0"
69
+ - "2.7.7"
70
+ - "3.0.5"
71
+ - "3.1.3"
72
+ - "3.2.0"
@@ -0,0 +1 @@
1
+ * @jturkel @tjwp
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@ inherit_gem:
2
2
  salsify_rubocop: conf/rubocop.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.6
5
+ TargetRubyVersion: 2.7
6
6
  Exclude:
7
7
  - 'vendor/**/*'
8
8
  - 'gemfiles/vendor/**/*'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # avrolution
2
2
 
3
+ ## v0.9.0
4
+ - Add support for Ruby 3.2.
5
+ - Drop support for Ruby 2.6.
6
+ -
7
+ ## v0.8.0
8
+ - Added the ability to register all schemas found under `Avrolution.root` with the task
9
+ `rake avro:register_all_schemas`.
10
+
3
11
  ## v0.7.2
4
12
  - Fix a bug related to Ruby 3.0 keyword arguments in
5
13
  AvroSchemaRegistry::Client#register_without_lookup.
data/README.md CHANGED
@@ -106,6 +106,24 @@ require 'avroluation/rake/register_schemas_task'
106
106
  Avrolution::Rake::RegisterSchemasTask.define
107
107
  ```
108
108
 
109
+ ### Avro Register All Schemas Rake Task
110
+
111
+ This rake task allows you to register all schemas discovered under `Avrolution.root`.
112
+
113
+ Similarly to the task `avro:register_schemas`, it will register them against the configured
114
+ registry. Additionally, this task will be auto included for Rails applications.
115
+
116
+ ```bash
117
+ rake avro:register_all_schemas
118
+ ```
119
+
120
+ For non-Rails projects, tasks can be defined as:
121
+
122
+ ```ruby
123
+ require 'avroluation/rake/register_all_schemas_task'
124
+ Avrolution::Rake::RegisterAllSchemasTask.define
125
+ ```
126
+
109
127
  ### Avro Add Compatibility Break Rake Task
110
128
 
111
129
  There is a rake task add an entry to the `Avrolution.compatibility_breaks_file`.
data/avrolution.gemspec CHANGED
@@ -19,24 +19,27 @@ Gem::Specification.new do |spec|
19
19
  # Set 'allowed_push_post' to control where this gem can be published.
20
20
  if spec.respond_to?(:metadata)
21
21
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
22
+ spec.metadata['rubygems_mfa_required'] = 'true'
22
23
  else
23
24
  raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
24
25
  end
25
26
 
26
27
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
- spec.bindir = 'bin'
28
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
28
+ spec.bindir = 'exe'
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
30
  spec.require_paths = ['lib']
30
31
 
31
- spec.required_ruby_version = '>= 2.6'
32
+ spec.required_ruby_version = '>= 2.7'
32
33
 
33
34
  spec.add_development_dependency 'bundler', '~> 2.0'
34
35
  spec.add_development_dependency 'fakefs'
35
36
  spec.add_development_dependency 'overcommit'
36
37
  spec.add_development_dependency 'rake', '~> 13.0'
37
- spec.add_development_dependency 'rspec', '~> 3.8'
38
+ spec.add_development_dependency 'rspec', '~> 3.12'
38
39
  spec.add_development_dependency 'rspec-its'
39
40
  spec.add_development_dependency 'rspec_junit_formatter'
41
+ # rspec-mocks 3.12.2+ is required for Ruby 3.2.0 support
42
+ spec.add_development_dependency 'rspec-mocks', '>= 3.12.2'
40
43
  spec.add_development_dependency 'salsify_rubocop', '~> 1.0.1'
41
44
  spec.add_development_dependency 'simplecov'
42
45
 
@@ -39,10 +39,7 @@ module Avrolution
39
39
  private
40
40
 
41
41
  def check_schemas(path)
42
- vendor_bundle_path = File.join(path, 'vendor/bundle/')
43
- Dir[File.join(path, '**/*.avsc')].reject do |file|
44
- file.start_with?(vendor_bundle_path)
45
- end.each do |schema_file|
42
+ Avrolution::DiscoverSchemas.discover(path).each do |schema_file|
46
43
  check_schema_compatibility(schema_file)
47
44
  end
48
45
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avrolution
4
+ class DiscoverSchemas
5
+ def self.discover(path)
6
+ vendor_bundle_path = File.join(path, 'vendor/bundle/')
7
+ Dir[File.join(path, '**/*.avsc')].reject do |file|
8
+ file.start_with?(vendor_bundle_path)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -2,8 +2,10 @@
2
2
 
3
3
  require 'avrolution/rake/check_compatibility_task'
4
4
  require 'avrolution/rake/add_compatibility_break_task'
5
+ require 'avrolution/rake/register_all_schemas_task'
5
6
  require 'avrolution/rake/register_schemas_task'
6
7
 
7
8
  Avrolution::Rake::AddCompatibilityBreakTask.define(dependencies: [:environment])
8
9
  Avrolution::Rake::CheckCompatibilityTask.define(dependencies: [:environment])
10
+ Avrolution::Rake::RegisterAllSchemasTask.define(dependencies: [:environment])
9
11
  Avrolution::Rake::RegisterSchemasTask.define(dependencies: [:environment])
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avrolution/rake/base_task'
4
+
5
+ module Avrolution
6
+ module Rake
7
+ class RegisterAllSchemasTask < BaseTask
8
+
9
+ def initialize(**)
10
+ super
11
+ @name ||= :register_all_schemas
12
+ @task_desc ||= 'Register all discovered Avro JSON schemas (using Avrolution.root)'
13
+ end
14
+
15
+ private
16
+
17
+ def perform
18
+ schemas = Avrolution::DiscoverSchemas.discover(Avrolution.root)
19
+
20
+ if schemas.blank?
21
+ puts 'could not find any schemas'
22
+ exit(1)
23
+ else
24
+ Avrolution::RegisterSchemas.call(schemas)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avrolution
4
- VERSION = '0.7.2'
4
+ VERSION = '0.9.0'
5
5
  end
data/lib/avrolution.rb CHANGED
@@ -17,6 +17,7 @@ require 'avrolution/configuration'
17
17
  require 'avrolution/compatibility_break'
18
18
  require 'avrolution/compatibility_breaks_file'
19
19
  require 'avrolution/compatibility_check'
20
+ require 'avrolution/discover_schemas'
20
21
  require 'avrolution/register_schemas'
21
22
 
22
23
  require 'avrolution/railtie' if defined?(Rails)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avrolution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salsify, Inc
8
- autorequire:
9
- bindir: bin
8
+ autorequire:
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-16 00:00:00.000000000 Z
11
+ date: 2023-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.8'
75
+ version: '3.12'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.8'
82
+ version: '3.12'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec-its
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec-mocks
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: 3.12.2
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 3.12.2
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: salsify_rubocop
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -237,13 +251,12 @@ dependencies:
237
251
  description: Support for the evolution of Avro schemas stored in a schema registry.
238
252
  email:
239
253
  - engineering@salsify.com
240
- executables:
241
- - console
242
- - setup
254
+ executables: []
243
255
  extensions: []
244
256
  extra_rdoc_files: []
245
257
  files:
246
258
  - ".circleci/config.yml"
259
+ - ".github/CODEOWNERS"
247
260
  - ".gitignore"
248
261
  - ".overcommit.yml"
249
262
  - ".rspec"
@@ -261,11 +274,13 @@ files:
261
274
  - lib/avrolution/compatibility_breaks_file.rb
262
275
  - lib/avrolution/compatibility_check.rb
263
276
  - lib/avrolution/configuration.rb
277
+ - lib/avrolution/discover_schemas.rb
264
278
  - lib/avrolution/railtie.rb
265
279
  - lib/avrolution/rake/add_compatibility_break_task.rb
266
280
  - lib/avrolution/rake/base_task.rb
267
281
  - lib/avrolution/rake/check_compatibility_task.rb
268
282
  - lib/avrolution/rake/rails_avrolution.rake
283
+ - lib/avrolution/rake/register_all_schemas_task.rb
269
284
  - lib/avrolution/rake/register_schemas_task.rb
270
285
  - lib/avrolution/register_schemas.rb
271
286
  - lib/avrolution/version.rb
@@ -276,7 +291,8 @@ licenses:
276
291
  - MIT
277
292
  metadata:
278
293
  allowed_push_host: https://rubygems.org
279
- post_install_message:
294
+ rubygems_mfa_required: 'true'
295
+ post_install_message:
280
296
  rdoc_options: []
281
297
  require_paths:
282
298
  - lib
@@ -284,15 +300,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
284
300
  requirements:
285
301
  - - ">="
286
302
  - !ruby/object:Gem::Version
287
- version: '2.6'
303
+ version: '2.7'
288
304
  required_rubygems_version: !ruby/object:Gem::Requirement
289
305
  requirements:
290
306
  - - ">="
291
307
  - !ruby/object:Gem::Version
292
308
  version: '0'
293
309
  requirements: []
294
- rubygems_version: 3.1.4
295
- signing_key:
310
+ rubygems_version: 3.3.7
311
+ signing_key:
296
312
  specification_version: 4
297
313
  summary: Support for the evolution of Avro schemas stored in a schema registry.
298
314
  test_files: []