diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd86ee41..c1bea1f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,8 @@ jobs: name: Run specs strategy: matrix: - ruby-version: ['2.7'] + ruby-version: ['2.7', '3.1'] + rails-version: ['rails-6', 'rails-6.1', 'rails-7'] env: BUNDLE_WITHOUT: release steps: @@ -24,11 +25,11 @@ jobs: bundler-cache: true - name: Run rspec run: | + bundle exec appraisal install cd spec/dummy - bundle bundle exec rails db:test:prepare cd ../.. - bundle exec rspec + bundle exec appraisal ${{ matrix.rails-version }} rspec lint: runs-on: ubuntu-latest diff --git a/.rubocop.yml b/.rubocop.yml index 40c1c43b..2b27dd78 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -50,3 +50,5 @@ AllCops: Exclude: - 'spec/dummy/db/schema.rb' - 'vendor/**/*' # necesssary because GH actions puts gems in here + - 'gemfiles/*' + - 'Appraisals' diff --git a/Appraisals b/Appraisals new file mode 100644 index 00000000..7dfbc118 --- /dev/null +++ b/Appraisals @@ -0,0 +1,12 @@ +appraise "rails-6" do + gem "rails", "6.0.6" + gem 'psych', '< 4' +end + +appraise "rails-6.1" do + gem "rails", "6.1.7" +end + +appraise "rails-7" do + gem "rails", "7.0.4" +end diff --git a/Gemfile.lock b/Gemfile.lock index cff49a2f..b98e1ea8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -75,6 +75,10 @@ GEM tzinfo (~> 2.0) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) ast (2.4.2) async (2.0.0) console (~> 1.10) @@ -360,6 +364,7 @@ PLATFORMS x86_64-linux DEPENDENCIES + appraisal debug (>= 1.0.0) dfe-analytics! gem-release diff --git a/dfe-analytics.gemspec b/dfe-analytics.gemspec index 864079e3..cca421a1 100644 --- a/dfe-analytics.gemspec +++ b/dfe-analytics.gemspec @@ -26,6 +26,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'google-cloud-bigquery', '~> 1.38' spec.add_dependency 'request_store_rails', '~> 2' + spec.add_development_dependency 'appraisal' spec.add_development_dependency 'debug', '>= 1.0.0' spec.add_development_dependency 'gem-release', '~> 2.2' spec.add_development_dependency 'github_changelog_generator', '~> 1.16' diff --git a/gemfiles/.bundle/config b/gemfiles/.bundle/config new file mode 100644 index 00000000..c127f802 --- /dev/null +++ b/gemfiles/.bundle/config @@ -0,0 +1,2 @@ +--- +BUNDLE_RETRY: "1" diff --git a/gemfiles/rails_6.1.gemfile b/gemfiles/rails_6.1.gemfile new file mode 100644 index 00000000..da718aa7 --- /dev/null +++ b/gemfiles/rails_6.1.gemfile @@ -0,0 +1,12 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "6.1.7" + +group :release do + gem "gem-release", require: false + gem "github_changelog_generator", require: false +end + +gemspec path: "../" diff --git a/gemfiles/rails_6.1.gemfile.lock b/gemfiles/rails_6.1.gemfile.lock new file mode 100644 index 00000000..f58dc2ea --- /dev/null +++ b/gemfiles/rails_6.1.gemfile.lock @@ -0,0 +1,359 @@ +PATH + remote: .. + specs: + dfe-analytics (1.3.2) + google-cloud-bigquery (~> 1.38) + request_store_rails (~> 2) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.1.7) + actionpack (= 6.1.7) + activesupport (= 6.1.7) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.1.7) + actionpack (= 6.1.7) + activejob (= 6.1.7) + activerecord (= 6.1.7) + activestorage (= 6.1.7) + activesupport (= 6.1.7) + mail (>= 2.7.1) + actionmailer (6.1.7) + actionpack (= 6.1.7) + actionview (= 6.1.7) + activejob (= 6.1.7) + activesupport (= 6.1.7) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.1.7) + actionview (= 6.1.7) + activesupport (= 6.1.7) + rack (~> 2.0, >= 2.0.9) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.1.7) + actionpack (= 6.1.7) + activerecord (= 6.1.7) + activestorage (= 6.1.7) + activesupport (= 6.1.7) + nokogiri (>= 1.8.5) + actionview (6.1.7) + activesupport (= 6.1.7) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.1.7) + activesupport (= 6.1.7) + globalid (>= 0.3.6) + activemodel (6.1.7) + activesupport (= 6.1.7) + activerecord (6.1.7) + activemodel (= 6.1.7) + activesupport (= 6.1.7) + activestorage (6.1.7) + actionpack (= 6.1.7) + activejob (= 6.1.7) + activerecord (= 6.1.7) + activesupport (= 6.1.7) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.7) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + async (2.1.0) + console (~> 1.10) + io-event (~> 1.0.0) + timers (~> 4.1) + async-http (0.59.2) + async (>= 1.25) + async-io (>= 1.28) + async-pool (>= 0.2) + protocol-http (~> 0.23.1) + protocol-http1 (~> 0.14.0) + protocol-http2 (~> 0.14.0) + traces (>= 0.4.0) + async-http-faraday (0.11.0) + async-http (~> 0.42) + faraday + async-io (1.34.0) + async + async-pool (0.3.12) + async (>= 1.25) + backport (1.2.0) + benchmark (0.2.0) + builder (3.2.4) + concurrent-ruby (1.1.10) + console (1.15.3) + fiber-local + crack (0.4.5) + rexml + crass (1.0.6) + debug (1.6.2) + irb (>= 1.3.6) + reline (>= 0.3.1) + declarative (0.0.20) + diff-lcs (1.5.0) + e2mmap (0.1.0) + erubi (1.11.0) + faraday (2.5.2) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-http-cache (2.4.1) + faraday (>= 0.8) + faraday-net_http (3.0.0) + fiber-local (1.0.0) + gem-release (2.2.2) + github_changelog_generator (1.16.4) + activesupport + async (>= 1.25.0) + async-http-faraday + faraday-http-cache + multi_json + octokit (~> 4.6) + rainbow (>= 2.2.1) + rake (>= 10.0) + globalid (1.0.0) + activesupport (>= 5.0) + google-apis-bigquery_v2 (0.40.0) + google-apis-core (>= 0.7, < 2.a) + google-apis-core (0.9.0) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-cloud-bigquery (1.39.0) + concurrent-ruby (~> 1.0) + google-apis-bigquery_v2 (~> 0.1) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + google-cloud-core (1.6.0) + google-cloud-env (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.3.0) + googleauth (1.2.0) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + hashdiff (1.0.1) + httpclient (2.8.3) + i18n (1.12.0) + concurrent-ruby (~> 1.0) + io-console (0.5.11) + io-event (1.0.9) + irb (1.4.1) + reline (>= 0.3.0) + jaro_winkler (1.5.4) + json (2.6.2) + json-schema (2.8.1) + addressable (>= 2.4) + jwt (2.5.0) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + loofah (2.19.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (1.0.2) + memoist (0.16.2) + method_source (1.0.0) + mini_mime (1.1.2) + minitest (5.16.3) + multi_json (1.15.0) + nio4r (2.5.8) + nokogiri (1.13.8-arm64-darwin) + racc (~> 1.4) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + os (1.1.4) + parallel (1.22.1) + parser (3.1.2.1) + ast (~> 2.4.1) + protocol-hpack (1.4.2) + protocol-http (0.23.12) + protocol-http1 (0.14.6) + protocol-http (~> 0.22) + protocol-http2 (0.14.2) + protocol-hpack (~> 1.4) + protocol-http (~> 0.18) + public_suffix (5.0.0) + racc (1.6.0) + rack (2.2.4) + rack-test (2.0.2) + rack (>= 1.3) + rails (6.1.7) + actioncable (= 6.1.7) + actionmailbox (= 6.1.7) + actionmailer (= 6.1.7) + actionpack (= 6.1.7) + actiontext (= 6.1.7) + actionview (= 6.1.7) + activejob (= 6.1.7) + activemodel (= 6.1.7) + activerecord (= 6.1.7) + activestorage (= 6.1.7) + activesupport (= 6.1.7) + bundler (>= 1.15.0) + railties (= 6.1.7) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.4.3) + loofah (~> 2.3) + railties (6.1.7) + actionpack (= 6.1.7) + activesupport (= 6.1.7) + method_source + rake (>= 12.2) + thor (~> 1.0) + rainbow (3.1.1) + rake (13.0.6) + regexp_parser (2.5.0) + reline (0.3.1) + io-console (~> 0.5) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + request_store_rails (2.0.0) + concurrent-ruby (~> 1.0) + retriable (3.1.2) + reverse_markdown (2.1.1) + nokogiri + rexml (3.2.5) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-mocks (3.11.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-rails (5.1.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + railties (>= 5.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.11.1) + rubocop (1.36.0) + json (~> 2.3) + parallel (~> 1.10) + parser (>= 3.1.2.1) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.20.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.21.0) + parser (>= 3.1.1.0) + rubocop-rspec (2.13.1) + rubocop (~> 1.33) + ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + solargraph (0.46.0) + backport (~> 1.2) + benchmark + bundler (>= 1.17.2) + diff-lcs (~> 1.4) + e2mmap + jaro_winkler (~> 1.5) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.1) + parser (~> 3.0) + reverse_markdown (>= 1.0.5, < 3) + rubocop (>= 0.52) + thor (~> 1.0) + tilt (~> 2.0) + yard (~> 0.9, >= 0.9.24) + sprockets (4.1.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + sqlite3 (1.5.0-arm64-darwin) + thor (1.2.1) + tilt (2.0.11) + timers (4.3.4) + traces (0.7.0) + trailblazer-option (0.1.2) + tzinfo (2.0.5) + concurrent-ruby (~> 1.0) + uber (0.1.0) + unicode-display_width (2.3.0) + webmock (3.18.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + webrick (1.7.0) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + with_model (2.1.6) + activerecord (>= 5.2) + yard (0.9.28) + webrick (~> 1.7.0) + zeitwerk (2.6.0) + +PLATFORMS + arm64-darwin-21 + +DEPENDENCIES + appraisal + debug (>= 1.0.0) + dfe-analytics! + gem-release + github_changelog_generator + json-schema (~> 2.8) + rails (= 6.1.7) + rspec-rails (~> 5.0) + rubocop (~> 1.26) + rubocop-rspec (~> 2) + solargraph + sqlite3 + webmock (~> 3.14) + with_model + +BUNDLED WITH + 2.3.13 diff --git a/gemfiles/rails_6.gemfile b/gemfiles/rails_6.gemfile new file mode 100644 index 00000000..ead3381c --- /dev/null +++ b/gemfiles/rails_6.gemfile @@ -0,0 +1,13 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "6.0.6" +gem "psych", "< 4" + +group :release do + gem "gem-release", require: false + gem "github_changelog_generator", require: false +end + +gemspec path: "../" diff --git a/gemfiles/rails_6.gemfile.lock b/gemfiles/rails_6.gemfile.lock new file mode 100644 index 00000000..92279e2c --- /dev/null +++ b/gemfiles/rails_6.gemfile.lock @@ -0,0 +1,358 @@ +PATH + remote: .. + specs: + dfe-analytics (1.3.2) + google-cloud-bigquery (~> 1.38) + request_store_rails (~> 2) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (6.0.6) + actionpack (= 6.0.6) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (6.0.6) + actionpack (= 6.0.6) + activejob (= 6.0.6) + activerecord (= 6.0.6) + activestorage (= 6.0.6) + activesupport (= 6.0.6) + mail (>= 2.7.1) + actionmailer (6.0.6) + actionpack (= 6.0.6) + actionview (= 6.0.6) + activejob (= 6.0.6) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (6.0.6) + actionview (= 6.0.6) + activesupport (= 6.0.6) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.0.6) + actionpack (= 6.0.6) + activerecord (= 6.0.6) + activestorage (= 6.0.6) + activesupport (= 6.0.6) + nokogiri (>= 1.8.5) + actionview (6.0.6) + activesupport (= 6.0.6) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.0.6) + activesupport (= 6.0.6) + globalid (>= 0.3.6) + activemodel (6.0.6) + activesupport (= 6.0.6) + activerecord (6.0.6) + activemodel (= 6.0.6) + activesupport (= 6.0.6) + activestorage (6.0.6) + actionpack (= 6.0.6) + activejob (= 6.0.6) + activerecord (= 6.0.6) + marcel (~> 1.0) + activesupport (6.0.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + async (2.1.0) + console (~> 1.10) + io-event (~> 1.0.0) + timers (~> 4.1) + async-http (0.59.2) + async (>= 1.25) + async-io (>= 1.28) + async-pool (>= 0.2) + protocol-http (~> 0.23.1) + protocol-http1 (~> 0.14.0) + protocol-http2 (~> 0.14.0) + traces (>= 0.4.0) + async-http-faraday (0.11.0) + async-http (~> 0.42) + faraday + async-io (1.34.0) + async + async-pool (0.3.12) + async (>= 1.25) + backport (1.2.0) + benchmark (0.2.0) + builder (3.2.4) + concurrent-ruby (1.1.10) + console (1.15.3) + fiber-local + crack (0.4.5) + rexml + crass (1.0.6) + debug (1.6.2) + irb (>= 1.3.6) + reline (>= 0.3.1) + declarative (0.0.20) + diff-lcs (1.5.0) + e2mmap (0.1.0) + erubi (1.11.0) + faraday (2.5.2) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-http-cache (2.4.1) + faraday (>= 0.8) + faraday-net_http (3.0.0) + fiber-local (1.0.0) + gem-release (2.2.2) + github_changelog_generator (1.16.4) + activesupport + async (>= 1.25.0) + async-http-faraday + faraday-http-cache + multi_json + octokit (~> 4.6) + rainbow (>= 2.2.1) + rake (>= 10.0) + globalid (1.0.0) + activesupport (>= 5.0) + google-apis-bigquery_v2 (0.40.0) + google-apis-core (>= 0.7, < 2.a) + google-apis-core (0.9.0) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-cloud-bigquery (1.39.0) + concurrent-ruby (~> 1.0) + google-apis-bigquery_v2 (~> 0.1) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + google-cloud-core (1.6.0) + google-cloud-env (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.3.0) + googleauth (1.2.0) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + hashdiff (1.0.1) + httpclient (2.8.3) + i18n (1.12.0) + concurrent-ruby (~> 1.0) + io-console (0.5.11) + io-event (1.0.9) + irb (1.4.1) + reline (>= 0.3.0) + jaro_winkler (1.5.4) + json (2.6.2) + json-schema (2.8.1) + addressable (>= 2.4) + jwt (2.5.0) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + loofah (2.19.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (1.0.2) + memoist (0.16.2) + method_source (1.0.0) + mini_mime (1.1.2) + minitest (5.16.3) + multi_json (1.15.0) + nio4r (2.5.8) + nokogiri (1.13.8-arm64-darwin) + racc (~> 1.4) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + os (1.1.4) + parallel (1.22.1) + parser (3.1.2.1) + ast (~> 2.4.1) + protocol-hpack (1.4.2) + protocol-http (0.23.12) + protocol-http1 (0.14.6) + protocol-http (~> 0.22) + protocol-http2 (0.14.2) + protocol-hpack (~> 1.4) + protocol-http (~> 0.18) + psych (3.3.3) + public_suffix (5.0.0) + racc (1.6.0) + rack (2.2.4) + rack-test (2.0.2) + rack (>= 1.3) + rails (6.0.6) + actioncable (= 6.0.6) + actionmailbox (= 6.0.6) + actionmailer (= 6.0.6) + actionpack (= 6.0.6) + actiontext (= 6.0.6) + actionview (= 6.0.6) + activejob (= 6.0.6) + activemodel (= 6.0.6) + activerecord (= 6.0.6) + activestorage (= 6.0.6) + activesupport (= 6.0.6) + bundler (>= 1.3.0) + railties (= 6.0.6) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.4.3) + loofah (~> 2.3) + railties (6.0.6) + actionpack (= 6.0.6) + activesupport (= 6.0.6) + method_source + rake (>= 0.8.7) + thor (>= 0.20.3, < 2.0) + rainbow (3.1.1) + rake (13.0.6) + regexp_parser (2.5.0) + reline (0.3.1) + io-console (~> 0.5) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + request_store_rails (2.0.0) + concurrent-ruby (~> 1.0) + retriable (3.1.2) + reverse_markdown (2.1.1) + nokogiri + rexml (3.2.5) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-mocks (3.11.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-rails (5.1.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + railties (>= 5.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.11.1) + rubocop (1.36.0) + json (~> 2.3) + parallel (~> 1.10) + parser (>= 3.1.2.1) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.20.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.21.0) + parser (>= 3.1.1.0) + rubocop-rspec (2.13.1) + rubocop (~> 1.33) + ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + solargraph (0.46.0) + backport (~> 1.2) + benchmark + bundler (>= 1.17.2) + diff-lcs (~> 1.4) + e2mmap + jaro_winkler (~> 1.5) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.1) + parser (~> 3.0) + reverse_markdown (>= 1.0.5, < 3) + rubocop (>= 0.52) + thor (~> 1.0) + tilt (~> 2.0) + yard (~> 0.9, >= 0.9.24) + sprockets (4.1.1) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.4.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + sprockets (>= 3.0.0) + sqlite3 (1.5.0-arm64-darwin) + thor (1.2.1) + thread_safe (0.3.6) + tilt (2.0.11) + timers (4.3.4) + traces (0.7.0) + trailblazer-option (0.1.2) + tzinfo (1.2.10) + thread_safe (~> 0.1) + uber (0.1.0) + unicode-display_width (2.3.0) + webmock (3.18.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + webrick (1.7.0) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + with_model (2.1.6) + activerecord (>= 5.2) + yard (0.9.28) + webrick (~> 1.7.0) + zeitwerk (2.6.0) + +PLATFORMS + arm64-darwin-21 + +DEPENDENCIES + appraisal + debug (>= 1.0.0) + dfe-analytics! + gem-release + github_changelog_generator + json-schema (~> 2.8) + psych (< 4) + rails (= 6.0.6) + rspec-rails (~> 5.0) + rubocop (~> 1.26) + rubocop-rspec (~> 2) + solargraph + sqlite3 + webmock (~> 3.14) + with_model + +BUNDLED WITH + 2.3.13 diff --git a/gemfiles/rails_7.gemfile b/gemfiles/rails_7.gemfile new file mode 100644 index 00000000..7ce77f63 --- /dev/null +++ b/gemfiles/rails_7.gemfile @@ -0,0 +1,12 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "rails", "7.0.4" + +group :release do + gem "gem-release", require: false + gem "github_changelog_generator", require: false +end + +gemspec path: "../" diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock new file mode 100644 index 00000000..8255e234 --- /dev/null +++ b/gemfiles/rails_7.gemfile.lock @@ -0,0 +1,375 @@ +PATH + remote: .. + specs: + dfe-analytics (1.3.2) + google-cloud-bigquery (~> 1.38) + request_store_rails (~> 2) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + actionmailbox (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) + mail (>= 2.7.1) + net-imap + net-pop + net-smtp + actionmailer (7.0.4) + actionpack (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activesupport (= 7.0.4) + mail (~> 2.5, >= 2.5.4) + net-imap + net-pop + net-smtp + rails-dom-testing (~> 2.0) + actionpack (7.0.4) + actionview (= 7.0.4) + activesupport (= 7.0.4) + rack (~> 2.0, >= 2.2.0) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (7.0.4) + actionpack (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.0.4) + activesupport (= 7.0.4) + builder (~> 3.1) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (7.0.4) + activesupport (= 7.0.4) + globalid (>= 0.3.6) + activemodel (7.0.4) + activesupport (= 7.0.4) + activerecord (7.0.4) + activemodel (= 7.0.4) + activesupport (= 7.0.4) + activestorage (7.0.4) + actionpack (= 7.0.4) + activejob (= 7.0.4) + activerecord (= 7.0.4) + activesupport (= 7.0.4) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (7.0.4) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + appraisal (2.4.1) + bundler + rake + thor (>= 0.14.0) + ast (2.4.2) + async (2.1.0) + console (~> 1.10) + io-event (~> 1.0.0) + timers (~> 4.1) + async-http (0.59.2) + async (>= 1.25) + async-io (>= 1.28) + async-pool (>= 0.2) + protocol-http (~> 0.23.1) + protocol-http1 (~> 0.14.0) + protocol-http2 (~> 0.14.0) + traces (>= 0.4.0) + async-http-faraday (0.11.0) + async-http (~> 0.42) + faraday + async-io (1.34.0) + async + async-pool (0.3.12) + async (>= 1.25) + backport (1.2.0) + benchmark (0.2.0) + builder (3.2.4) + concurrent-ruby (1.1.10) + console (1.15.3) + fiber-local + crack (0.4.5) + rexml + crass (1.0.6) + debug (1.6.2) + irb (>= 1.3.6) + reline (>= 0.3.1) + declarative (0.0.20) + diff-lcs (1.5.0) + digest (3.1.0) + e2mmap (0.1.0) + erubi (1.11.0) + faraday (2.5.2) + faraday-net_http (>= 2.0, < 3.1) + ruby2_keywords (>= 0.0.4) + faraday-http-cache (2.4.1) + faraday (>= 0.8) + faraday-net_http (3.0.0) + fiber-local (1.0.0) + gem-release (2.2.2) + github_changelog_generator (1.16.4) + activesupport + async (>= 1.25.0) + async-http-faraday + faraday-http-cache + multi_json + octokit (~> 4.6) + rainbow (>= 2.2.1) + rake (>= 10.0) + globalid (1.0.0) + activesupport (>= 5.0) + google-apis-bigquery_v2 (0.40.0) + google-apis-core (>= 0.7, < 2.a) + google-apis-core (0.9.0) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-cloud-bigquery (1.39.0) + concurrent-ruby (~> 1.0) + google-apis-bigquery_v2 (~> 0.1) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + google-cloud-core (1.6.0) + google-cloud-env (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.3.0) + googleauth (1.2.0) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + hashdiff (1.0.1) + httpclient (2.8.3) + i18n (1.12.0) + concurrent-ruby (~> 1.0) + io-console (0.5.11) + io-event (1.0.9) + irb (1.4.1) + reline (>= 0.3.0) + jaro_winkler (1.5.4) + json (2.6.2) + json-schema (2.8.1) + addressable (>= 2.4) + jwt (2.5.0) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + loofah (2.19.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) + mail (2.7.1) + mini_mime (>= 0.1.1) + marcel (1.0.2) + memoist (0.16.2) + method_source (1.0.0) + mini_mime (1.1.2) + minitest (5.16.3) + multi_json (1.15.0) + net-imap (0.2.3) + digest + net-protocol + strscan + net-pop (0.1.1) + digest + net-protocol + timeout + net-protocol (0.1.3) + timeout + net-smtp (0.3.1) + digest + net-protocol + timeout + nio4r (2.5.8) + nokogiri (1.13.8-arm64-darwin) + racc (~> 1.4) + octokit (4.25.1) + faraday (>= 1, < 3) + sawyer (~> 0.9) + os (1.1.4) + parallel (1.22.1) + parser (3.1.2.1) + ast (~> 2.4.1) + protocol-hpack (1.4.2) + protocol-http (0.23.12) + protocol-http1 (0.14.6) + protocol-http (~> 0.22) + protocol-http2 (0.14.2) + protocol-hpack (~> 1.4) + protocol-http (~> 0.18) + public_suffix (5.0.0) + racc (1.6.0) + rack (2.2.4) + rack-test (2.0.2) + rack (>= 1.3) + rails (7.0.4) + actioncable (= 7.0.4) + actionmailbox (= 7.0.4) + actionmailer (= 7.0.4) + actionpack (= 7.0.4) + actiontext (= 7.0.4) + actionview (= 7.0.4) + activejob (= 7.0.4) + activemodel (= 7.0.4) + activerecord (= 7.0.4) + activestorage (= 7.0.4) + activesupport (= 7.0.4) + bundler (>= 1.15.0) + railties (= 7.0.4) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.4.3) + loofah (~> 2.3) + railties (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) + method_source + rake (>= 12.2) + thor (~> 1.0) + zeitwerk (~> 2.5) + rainbow (3.1.1) + rake (13.0.6) + regexp_parser (2.5.0) + reline (0.3.1) + io-console (~> 0.5) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + request_store_rails (2.0.0) + concurrent-ruby (~> 1.0) + retriable (3.1.2) + reverse_markdown (2.1.1) + nokogiri + rexml (3.2.5) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-mocks (3.11.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.11.0) + rspec-rails (5.1.2) + actionpack (>= 5.2) + activesupport (>= 5.2) + railties (>= 5.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.11.1) + rubocop (1.36.0) + json (~> 2.3) + parallel (~> 1.10) + parser (>= 3.1.2.1) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.20.1, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.21.0) + parser (>= 3.1.1.0) + rubocop-rspec (2.13.1) + rubocop (~> 1.33) + ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) + sawyer (0.9.2) + addressable (>= 2.3.5) + faraday (>= 0.17.3, < 3) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + solargraph (0.46.0) + backport (~> 1.2) + benchmark + bundler (>= 1.17.2) + diff-lcs (~> 1.4) + e2mmap + jaro_winkler (~> 1.5) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.1) + parser (~> 3.0) + reverse_markdown (>= 1.0.5, < 3) + rubocop (>= 0.52) + thor (~> 1.0) + tilt (~> 2.0) + yard (~> 0.9, >= 0.9.24) + sqlite3 (1.5.0-arm64-darwin) + strscan (3.0.4) + thor (1.2.1) + tilt (2.0.11) + timeout (0.3.0) + timers (4.3.4) + traces (0.7.0) + trailblazer-option (0.1.2) + tzinfo (2.0.5) + concurrent-ruby (~> 1.0) + uber (0.1.0) + unicode-display_width (2.3.0) + webmock (3.18.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) + webrick (1.7.0) + websocket-driver (0.7.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + with_model (2.1.6) + activerecord (>= 5.2) + yard (0.9.28) + webrick (~> 1.7.0) + zeitwerk (2.6.0) + +PLATFORMS + arm64-darwin-21 + +DEPENDENCIES + appraisal + debug (>= 1.0.0) + dfe-analytics! + gem-release + github_changelog_generator + json-schema (~> 2.8) + rails (= 7.0.4) + rspec-rails (~> 5.0) + rubocop (~> 1.26) + rubocop-rspec (~> 2) + solargraph + sqlite3 + webmock (~> 3.14) + with_model + +BUNDLED WITH + 2.3.13 diff --git a/spec/dfe/analytics/event_spec.rb b/spec/dfe/analytics/event_spec.rb index 07ec4fc3..5c37bb43 100644 --- a/spec/dfe/analytics/event_spec.rb +++ b/spec/dfe/analytics/event_spec.rb @@ -3,7 +3,6 @@ require 'action_dispatch/http/mime_type' require 'action_dispatch/http/parameters' require 'action_dispatch/http/content_security_policy' -require 'action_dispatch/http/permissions_policy' require 'action_dispatch/http/request' RSpec.describe DfE::Analytics::Event do diff --git a/spec/dfe/analytics/load_entity_batch_spec.rb b/spec/dfe/analytics/load_entity_batch_spec.rb index 5a95f7c7..e807387d 100644 --- a/spec/dfe/analytics/load_entity_batch_spec.rb +++ b/spec/dfe/analytics/load_entity_batch_spec.rb @@ -26,12 +26,14 @@ expect(DfE::Analytics::SendEvents).to have_received(:perform_later).once end - it 'accepts its first arg as a Class' do - # backwards compatability with existing enqueued jobs - c = Candidate.create(email_address: 'foo@example.com') + if Gem::Version.new(Rails.version) >= Gem::Version.new('6.1') + it 'accepts its first arg as a Class' do + # backwards compatability with existing enqueued jobs + c = Candidate.create(email_address: 'foo@example.com') - described_class.perform_later(Candidate, [c.id], 1) + described_class.perform_later(Candidate, [c.id], 1) - expect(DfE::Analytics::SendEvents).to have_received(:perform_later).once + expect(DfE::Analytics::SendEvents).to have_received(:perform_later).once + end end end diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 2dfb9a48..a0a9c3a5 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -24,6 +24,15 @@ module Dummy class Application < Rails::Application config.load_defaults Rails::VERSION::STRING.to_f + if Gem::Version.new(Rails.version) < Gem::Version.new('6.1') + # back compat with Rails 6.0 for running tests under that version, + # see https://github.com/rails/rails/issues/37048 + ActiveSupport.on_load(:active_record) do + configs = Application.config.active_record + configs.sqlite3 = { represent_boolean_as_integer: true } + end + end + # Configuration for the application, engines, and railties goes here. # # These settings can be overridden in specific environments using the files