avrolution 0.7.0 → 0.8.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 +4 -4
- data/.github/CODEOWNERS +1 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +13 -1
- data/README.md +18 -0
- data/avrolution.gemspec +3 -2
- data/lib/avrolution/compatibility_check.rb +1 -4
- data/lib/avrolution/discover_schemas.rb +12 -0
- data/lib/avrolution/rake/add_compatibility_break_task.rb +1 -1
- data/lib/avrolution/rake/check_compatibility_task.rb +1 -1
- data/lib/avrolution/rake/rails_avrolution.rake +2 -0
- data/lib/avrolution/rake/register_all_schemas_task.rb +29 -0
- data/lib/avrolution/rake/register_schemas_task.rb +1 -1
- data/lib/avrolution/register_schemas.rb +9 -5
- data/lib/avrolution/version.rb +1 -1
- data/lib/avrolution.rb +1 -0
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b3862a46dc91450657388a917173dcbb34f5afde6712d2a851f705024fe4513
|
4
|
+
data.tar.gz: ad4f92d05e689c1b5730af204dcabb45b3eaf3473904be2cb099a2063f364f5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1474ccedad91e3150272cecc235307694e470ef1c31e8d178b3eb7e8b87d42daf3ff20ee88e47fb61acc9a4981216f42bbcd9422b0554fecd89e57d8f7413808
|
7
|
+
data.tar.gz: 4370cfba23e467501af31a88451c5986013b1f9ac8fb53f98988e1cd7f00d9d778056aa5b7f8160604f4c3568fb01849f6d80eef602aaea9f5ddb13697021a53
|
data/.github/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @jturkel @tjwp
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,20 @@
|
|
1
1
|
# avrolution
|
2
2
|
|
3
|
+
## v0.8.0
|
4
|
+
|
5
|
+
- Added the ability to register all schemas found under `Avrolution.root` with the task
|
6
|
+
`rake avro:register_all_schemas`.
|
7
|
+
|
8
|
+
## v0.7.2
|
9
|
+
- Fix a bug related to Ruby 3.0 keyword arguments in
|
10
|
+
AvroSchemaRegistry::Client#register_without_lookup.
|
11
|
+
|
12
|
+
## v0.7.1
|
13
|
+
- Adjust Rake task definitions to work with Ruby 3.0.
|
14
|
+
|
3
15
|
## v0.7.0
|
4
16
|
- Add support for Ruby 3.0.
|
5
|
-
- Drop support for Ruby < 2.
|
17
|
+
- Drop support for Ruby < 2.6.
|
6
18
|
- Use frozen string literals.
|
7
19
|
|
8
20
|
## v0.6.1
|
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,13 +19,14 @@ 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 = '
|
28
|
-
spec.executables = spec.files.grep(%r{^
|
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
32
|
spec.required_ruby_version = '>= 2.6'
|
@@ -39,10 +39,7 @@ module Avrolution
|
|
39
39
|
private
|
40
40
|
|
41
41
|
def check_schemas(path)
|
42
|
-
|
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
|
@@ -40,11 +40,15 @@ module Avrolution
|
|
40
40
|
compatibility_break = compatibility_breaks[[fullname, fingerprint]]
|
41
41
|
|
42
42
|
begin
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
if compatibility_break
|
44
|
+
schema_registry.register_without_lookup(
|
45
|
+
fullname,
|
46
|
+
json,
|
47
|
+
**compatibility_break.register_options
|
48
|
+
)
|
49
|
+
else
|
50
|
+
schema_registry.register_without_lookup(fullname, json)
|
51
|
+
end
|
48
52
|
rescue Excon::Error::Conflict
|
49
53
|
raise IncompatibleSchemaError.new(fullname)
|
50
54
|
end
|
data/lib/avrolution/version.rb
CHANGED
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.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salsify, Inc
|
8
|
-
autorequire:
|
9
|
-
bindir:
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -237,13 +237,12 @@ dependencies:
|
|
237
237
|
description: Support for the evolution of Avro schemas stored in a schema registry.
|
238
238
|
email:
|
239
239
|
- engineering@salsify.com
|
240
|
-
executables:
|
241
|
-
- console
|
242
|
-
- setup
|
240
|
+
executables: []
|
243
241
|
extensions: []
|
244
242
|
extra_rdoc_files: []
|
245
243
|
files:
|
246
244
|
- ".circleci/config.yml"
|
245
|
+
- ".github/CODEOWNERS"
|
247
246
|
- ".gitignore"
|
248
247
|
- ".overcommit.yml"
|
249
248
|
- ".rspec"
|
@@ -261,11 +260,13 @@ files:
|
|
261
260
|
- lib/avrolution/compatibility_breaks_file.rb
|
262
261
|
- lib/avrolution/compatibility_check.rb
|
263
262
|
- lib/avrolution/configuration.rb
|
263
|
+
- lib/avrolution/discover_schemas.rb
|
264
264
|
- lib/avrolution/railtie.rb
|
265
265
|
- lib/avrolution/rake/add_compatibility_break_task.rb
|
266
266
|
- lib/avrolution/rake/base_task.rb
|
267
267
|
- lib/avrolution/rake/check_compatibility_task.rb
|
268
268
|
- lib/avrolution/rake/rails_avrolution.rake
|
269
|
+
- lib/avrolution/rake/register_all_schemas_task.rb
|
269
270
|
- lib/avrolution/rake/register_schemas_task.rb
|
270
271
|
- lib/avrolution/register_schemas.rb
|
271
272
|
- lib/avrolution/version.rb
|
@@ -276,7 +277,8 @@ licenses:
|
|
276
277
|
- MIT
|
277
278
|
metadata:
|
278
279
|
allowed_push_host: https://rubygems.org
|
279
|
-
|
280
|
+
rubygems_mfa_required: 'true'
|
281
|
+
post_install_message:
|
280
282
|
rdoc_options: []
|
281
283
|
require_paths:
|
282
284
|
- lib
|
@@ -291,8 +293,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
291
293
|
- !ruby/object:Gem::Version
|
292
294
|
version: '0'
|
293
295
|
requirements: []
|
294
|
-
rubygems_version: 3.
|
295
|
-
signing_key:
|
296
|
+
rubygems_version: 3.2.22
|
297
|
+
signing_key:
|
296
298
|
specification_version: 4
|
297
299
|
summary: Support for the evolution of Avro schemas stored in a schema registry.
|
298
300
|
test_files: []
|