Skip to content

Commit

Permalink
Migrate to Circle CI and Update Dependencies (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
jturkel authored Feb 11, 2021
1 parent 6d470e0 commit e3561ad
Show file tree
Hide file tree
Showing 16 changed files with 100 additions and 87 deletions.
77 changes: 77 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
version: 2.1
jobs:
lint:
docker:
- image: salsify/ruby_ci:2.6.6
working_directory: ~/avro-builder
steps:
- checkout
- restore_cache:
keys:
- v2-gems-ruby-2.6.6-{{ checksum "avro-builder.gemspec" }}-{{ checksum "Gemfile" }}
- v2-gems-ruby-2.6.6-
- run:
name: Install Gems
command: |
if ! bundle check --path=vendor/bundle; then
bundle install --path=vendor/bundle --jobs=4 --retry=3
bundle clean
fi
- save_cache:
key: v2-gems-ruby-2.6.6-{{ checksum "avro-builder.gemspec" }}-{{ checksum "Gemfile" }}
paths:
- "vendor/bundle"
- "gemfiles/vendor/bundle"
- run:
name: Run Rubocop
command: bundle exec rubocop
test:
parameters:
gemfile:
type: string
ruby-version:
type: string
docker:
- image: salsify/ruby_ci:<< parameters.ruby-version >>
environment:
CIRCLE_TEST_REPORTS: "test-results"
BUNDLE_GEMFILE: << parameters.gemfile >>
working_directory: ~/avro-builder
steps:
- checkout
- restore_cache:
keys:
- v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avro-builder.gemspec" }}-{{ checksum "<< parameters.gemfile >>" }}
- v2-gems-ruby-<< parameters.ruby-version >>-
- run:
name: Install Gems
command: |
if ! bundle check --path=vendor/bundle; then
bundle install --path=vendor/bundle --jobs=4 --retry=3
bundle clean
fi
- save_cache:
key: v2-gems-ruby-<< parameters.ruby-version >>-{{ checksum "avro-builder.gemspec" }}-{{ checksum "<< parameters.gemfile >>" }}
paths:
- "vendor/bundle"
- "gemfiles/vendor/bundle"
- run:
name: Run Tests
command: |
bundle exec rspec --format RspecJunitFormatter --out $CIRCLE_TEST_REPORTS/rspec/junit.xml --format progress spec
- store_test_results:
path: "test-results"
workflows:
build:
jobs:
- lint
- test:
matrix:
parameters:
gemfile:
- "gemfiles/avro_1.9.gemfile"
- "gemfiles/avro_1.10.gemfile"
ruby-version:
- "2.6.6"
- "2.7.2"
- "3.0.0"
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ AllCops:
- Exclude
NewCops: disable
Exclude:
- "gemfiles/*"
- "gemfiles/**/*"

Style/RaiseArgs:
EnforcedStyle: compact
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.8
2.6.6
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

25 changes: 4 additions & 21 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
# frozen_string_literal: true

appraise 'avro-1.8.2' do
gem 'avro', '1.8.2'
appraise 'avro-1.9' do
gem 'avro', '1.9.2'
end

appraise 'avro-1.9.0' do
gem 'avro', '1.9.0'
end

appraise 'avro-1.9.1' do
gem 'avro', '1.9.1'
end

appraise 'avro-1.10.0' do
gem 'avro', '1.10.0'
end

appraise 'avro-patches-0.x' do
gem 'avro', '1.8.2'
gem 'avro-patches', '< 1.0.0'
end

appraise 'avro-patches-1.x' do
gem 'avro-patches', '>= 1.0.0'
appraise 'avro-1.10' do
gem 'avro', '1.10.1'
end
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# avro-builder changelog

## Unreleased
- Drop support for Avro < 1.9.
- Drop support for Ruby < 2.6.
- Add Ruby 3.0 support.

## v0.17.0
- Add support for enum defaults introduced in Avro v1.10.0.

Expand Down
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Avro::Builder

[![Build Status](https://travis-ci.org/salsify/avro-builder.svg?branch=master)][travis]
[![Build Status](https://circleci.com/gh/salsify/avro-builder.svg?style=svg)][circleci]
[![Gem Version](https://badge.fury.io/rb/avro-builder.svg)](https://badge.fury.io/rb/avro-builder)

[travis]: http://travis-ci.org/salsify/avro-builder
[circleci]: https://circleci.com/gh/salsify/avro-builder

`Avro::Builder` provides a Ruby DSL to create [Apache Avro](https://avro.apache.org/docs/current/) Schemas.

Expand Down Expand Up @@ -283,18 +283,6 @@ The DSL supports setting a logical type on any type except a union. The logical
types defined in the Avro [spec](https://avro.apache.org/docs/1.8.1/spec.html#Logical+Types)
are more limited.

The official Ruby `avro` gem does not yet support logical types:
[AVRO-1695](https://issues.apache.org/jira/browse/AVRO-1695).

There is a [avro-patches](https://github.com/salsify/avro-patches) gem that patches
the official Avro Ruby gem to support
encoding and decoding logical types. To use this gem, reference it in your Gemfile
instead of the official Avro gem:

```ruby
gem 'avro-patches'
```

A logical type can be specified for a field using the `logical_type` attribute:

```ruby
Expand Down
7 changes: 5 additions & 2 deletions avro-builder.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.add_runtime_dependency 'avro', '>= 1.7.0', '< 1.11'
spec.required_ruby_version = '>= 2.6'

spec.add_runtime_dependency 'avro', '>= 1.9.0', '< 1.11'

spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'bundler', '~> 2.0'
Expand All @@ -29,6 +31,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rspec-its'
spec.add_development_dependency 'salsify_rubocop', '~> 0.85.0'
spec.add_development_dependency 'rspec_junit_formatter'
spec.add_development_dependency 'salsify_rubocop', '~> 1.0.1'
spec.add_development_dependency 'simplecov'
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

source "https://rubygems.org"

gem "avro", "1.10.0"
gem "avro", "1.10.1"

gemspec path: "../"
7 changes: 0 additions & 7 deletions gemfiles/avro_1.8.2.gemfile

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/avro_1.9.0.gemfile

This file was deleted.

2 changes: 1 addition & 1 deletion gemfiles/avro_1.9.1.gemfile → gemfiles/avro_1.9.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

source "https://rubygems.org"

gem "avro", "1.9.1"
gem "avro", "1.9.2"

gemspec path: "../"
8 changes: 0 additions & 8 deletions gemfiles/avro_patches_0.x.gemfile

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/avro_patches_1.x.gemfile

This file was deleted.

1 change: 1 addition & 0 deletions lib/avro/builder/rake/avro_generate_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class AvroGenerateTask < ::Rake::TaskLib
:load_paths, :dependencies, :filetype

def initialize(name: :generate, dependencies: [])
super()
@name = name
@task_namespace = :avro
@task_desc = 'Generate Avro schema files from Avro::Builder DSL'
Expand Down
3 changes: 2 additions & 1 deletion lib/avro/builder/types/record_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class RecordType < Avro::Builder::Types::NamedType
dsl_attribute :doc
dsl_attribute_alias :type_doc, :doc

def initialize(name = nil, options: {}, cache:, field: nil, &block)
def initialize(name = nil, cache:, options: {}, field: nil, &block) # rubocop:disable Lint/MissingSuper
# TODO: Fix missing call to super
@avro_type_name = :record
@name = name
@cache = cache
Expand Down

0 comments on commit e3561ad

Please sign in to comment.