Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 978c941

Browse files
authored
fix: run w/ multiple ruby versions in CI to ensure compatibility (Gusto#232)
* ci: run w/ multiple ruby versions * fix: remove param from appraisal step * fix: more parameters changes * fix: make sure params are passed to commands * fix: set ruby version in bundle install for release step * fix: whitespace? * chore: update nokogiri dep * chore: remove ruby version from cache key * chore: update all the things * chore: update gemfiles, ignore schema comments in tests * fix: webrick issue * chore: update bundler version * fix: lock appraisal to commit ref to address an issue in ruby 3.2 in CI * fix: exclude ruby-3.2 incompatible versions of graphql from being tested in CI * chore: inline rubocop job * chore: revert rubocop-rspec upgrade, small bump to rubocop version
1 parent 102a63b commit 978c941

13 files changed

+421
-367
lines changed

.circleci/config.yml

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,23 @@ commands:
5353
- ./vendor/bundle
5454

5555
jobs:
56+
ruby-lint:
57+
docker:
58+
- image: cimg/ruby:3.2-node
59+
environment:
60+
BUNDLE_APP_CONFIG: .bundle
61+
steps:
62+
- checkout
63+
- bundle-install
64+
- run: bundle exec rubocop
5665
ruby-test:
5766
parameters:
5867
appraisal:
5968
type: string
69+
ruby:
70+
type: string
6071
docker:
61-
- image: cimg/ruby:2.6.9-node
72+
- image: cimg/ruby:<< parameters.ruby >>-node
6273
environment:
6374
BUNDLE_APP_CONFIG: .bundle
6475
steps:
@@ -73,8 +84,10 @@ jobs:
7384
parameters:
7485
appraisal:
7586
type: string
87+
ruby:
88+
type: string
7689
docker:
77-
- image: cimg/ruby:2.6.9-node
90+
- image: cimg/ruby:<< parameters.ruby >>-node
7891
environment:
7992
BUNDLE_APP_CONFIG: .bundle
8093
steps:
@@ -87,7 +100,7 @@ jobs:
87100
- run: yarn lint
88101
release:
89102
docker:
90-
- image: cimg/ruby:2.6.9-node
103+
- image: cimg/ruby:3.2-node
91104
environment:
92105
BUNDLE_APP_CONFIG: .bundle
93106
steps:
@@ -100,17 +113,33 @@ workflows:
100113
version: 2
101114
main:
102115
jobs:
103-
- gusto/ruby-lint
116+
- ruby-lint
104117
- ruby-test:
105118
matrix:
106119
parameters:
107120
appraisal: ['graphql-1.10', 'graphql-1.11', 'graphql-1.12', 'graphql-1.13', 'graphql-2.0']
121+
ruby: ['3.0', '3.1', '3.2']
122+
exclude:
123+
- appraisal: 'graphql-1.10'
124+
ruby: '3.2'
125+
- appraisal: 'graphql-1.11'
126+
ruby: '3.2'
127+
- appraisal: 'graphql-1.12'
128+
ruby: '3.2'
108129
- integration-tests:
109130
matrix:
110131
parameters:
111132
appraisal: ['graphql-1.10', 'graphql-1.11', 'graphql-1.12', 'graphql-1.13', 'graphql-2.0']
133+
ruby: ['3.0', '3.1', '3.2']
134+
exclude:
135+
- appraisal: 'graphql-1.10'
136+
ruby: '3.2'
137+
- appraisal: 'graphql-1.11'
138+
ruby: '3.2'
139+
- appraisal: 'graphql-1.12'
140+
ruby: '3.2'
112141
- release:
113142
requires:
114-
- gusto/ruby-lint
143+
- ruby-lint
115144
- ruby-test
116145
- integration-tests

.rubocop.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ AllCops:
44
TargetRubyVersion: 2.3
55
DisplayCopNames: true
66
Exclude:
7+
- 'node_modules/**/*'
78
- 'gemfiles/**/*'
89
- 'vendor/**/*'
910

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ source 'https://rubygems.org'
44

55
gemspec
66

7-
gem 'graphql', '1.10.14'
7+
# Fixes an issue in ruby 3.2, remove when a new version is published
8+
gem 'appraisal', git: 'https://github.com/thoughtbot/appraisal', ref: 'ea2baff57bc7f9e5f9e7a648916c9ae536325116'
9+
gem 'graphql', '~> 2.0.0'

Gemfile.lock

Lines changed: 78 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
GIT
2+
remote: https://github.com/thoughtbot/appraisal
3+
revision: ea2baff57bc7f9e5f9e7a648916c9ae536325116
4+
ref: ea2baff57bc7f9e5f9e7a648916c9ae536325116
5+
specs:
6+
appraisal (2.4.1)
7+
bundler
8+
rake
9+
thor (>= 0.14.0)
10+
111
PATH
212
remote: .
313
specs:
@@ -8,88 +18,85 @@ PATH
818
GEM
919
remote: https://rubygems.org/
1020
specs:
11-
actionpack (6.1.3)
12-
actionview (= 6.1.3)
13-
activesupport (= 6.1.3)
14-
rack (~> 2.0, >= 2.0.9)
21+
actionpack (7.0.4.3)
22+
actionview (= 7.0.4.3)
23+
activesupport (= 7.0.4.3)
24+
rack (~> 2.0, >= 2.2.0)
1525
rack-test (>= 0.6.3)
1626
rails-dom-testing (~> 2.0)
1727
rails-html-sanitizer (~> 1.0, >= 1.2.0)
18-
actionview (6.1.3)
19-
activesupport (= 6.1.3)
28+
actionview (7.0.4.3)
29+
activesupport (= 7.0.4.3)
2030
builder (~> 3.1)
2131
erubi (~> 1.4)
2232
rails-dom-testing (~> 2.0)
2333
rails-html-sanitizer (~> 1.1, >= 1.2.0)
24-
activesupport (6.1.3)
34+
activesupport (7.0.4.3)
2535
concurrent-ruby (~> 1.0, >= 1.0.2)
2636
i18n (>= 1.6, < 2)
2737
minitest (>= 5.1)
2838
tzinfo (~> 2.0)
29-
zeitwerk (~> 2.3)
30-
appraisal (2.3.0)
31-
bundler
32-
rake
33-
thor (>= 0.14.0)
34-
ast (2.4.0)
39+
ast (2.4.2)
3540
builder (3.2.4)
36-
byebug (11.0.1)
37-
coderay (1.1.2)
38-
concurrent-ruby (1.1.8)
41+
byebug (11.1.3)
42+
coderay (1.1.3)
43+
concurrent-ruby (1.2.2)
3944
crass (1.0.6)
40-
debase (0.2.4.1)
41-
debase-ruby_core_source (>= 0.10.2)
42-
debase-ruby_core_source (0.10.9)
43-
diff-lcs (1.3)
44-
erubi (1.9.0)
45+
debase (0.2.5.beta2)
46+
debase-ruby_core_source (>= 0.10.12)
47+
debase-ruby_core_source (3.2.0)
48+
diff-lcs (1.5.0)
49+
erubi (1.12.0)
4550
google-protobuf (3.21.12)
46-
google-protobuf (3.21.12-x86_64-darwin)
47-
google-protobuf (3.21.12-x86_64-linux)
48-
graphql (1.10.14)
49-
i18n (1.8.5)
51+
graphql (2.0.19)
52+
i18n (1.12.0)
5053
concurrent-ruby (~> 1.0)
51-
jaro_winkler (1.5.3)
52-
loofah (2.18.0)
54+
jaro_winkler (1.5.4)
55+
loofah (2.19.1)
5356
crass (~> 1.0.2)
5457
nokogiri (>= 1.5.9)
55-
method_source (0.9.2)
56-
mini_portile2 (2.4.0)
57-
minitest (5.14.2)
58-
nokogiri (1.9.1)
59-
mini_portile2 (~> 2.4.0)
60-
parallel (1.17.0)
61-
parser (2.6.3.0)
62-
ast (~> 2.4.0)
63-
pry (0.12.2)
64-
coderay (~> 1.1.0)
65-
method_source (~> 0.9.0)
66-
pry-byebug (3.7.0)
58+
method_source (1.0.0)
59+
minitest (5.18.0)
60+
nokogiri (1.14.2-arm64-darwin)
61+
racc (~> 1.4)
62+
nokogiri (1.14.2-x86_64-darwin)
63+
racc (~> 1.4)
64+
nokogiri (1.14.2-x86_64-linux)
65+
racc (~> 1.4)
66+
parallel (1.22.1)
67+
parser (3.2.1.1)
68+
ast (~> 2.4.1)
69+
pry (0.14.2)
70+
coderay (~> 1.1)
71+
method_source (~> 1.0)
72+
pry-byebug (3.10.1)
6773
byebug (~> 11.0)
68-
pry (~> 0.10)
69-
rack (2.2.3)
70-
rack-test (1.1.0)
71-
rack (>= 1.0, < 3)
74+
pry (>= 0.13, < 0.15)
75+
racc (1.6.2)
76+
rack (2.2.6.4)
77+
rack-test (2.1.0)
78+
rack (>= 1.3)
7279
rails-dom-testing (2.0.3)
7380
activesupport (>= 4.2.0)
7481
nokogiri (>= 1.6)
75-
rails-html-sanitizer (1.4.3)
76-
loofah (~> 2.3)
77-
rainbow (3.0.0)
78-
rake (13.0.1)
79-
rspec (3.8.0)
80-
rspec-core (~> 3.8.0)
81-
rspec-expectations (~> 3.8.0)
82-
rspec-mocks (~> 3.8.0)
83-
rspec-core (3.8.0)
84-
rspec-support (~> 3.8.0)
85-
rspec-expectations (3.8.3)
82+
rails-html-sanitizer (1.5.0)
83+
loofah (~> 2.19, >= 2.19.1)
84+
rainbow (3.1.1)
85+
rake (13.0.6)
86+
rspec (3.12.0)
87+
rspec-core (~> 3.12.0)
88+
rspec-expectations (~> 3.12.0)
89+
rspec-mocks (~> 3.12.0)
90+
rspec-core (3.12.1)
91+
rspec-support (~> 3.12.0)
92+
rspec-expectations (3.12.2)
8693
diff-lcs (>= 1.2.0, < 2.0)
87-
rspec-support (~> 3.8.0)
88-
rspec-mocks (3.8.0)
94+
rspec-support (~> 3.12.0)
95+
rspec-mocks (3.12.4)
8996
diff-lcs (>= 1.2.0, < 2.0)
90-
rspec-support (~> 3.8.0)
91-
rspec-support (3.8.0)
92-
rubocop (0.72.0)
97+
rspec-support (~> 3.12.0)
98+
rspec-support (3.12.0)
99+
rubocop (0.75.1)
93100
jaro_winkler (~> 1.5.1)
94101
parallel (~> 1.10)
95102
parser (>= 2.6)
@@ -98,14 +105,14 @@ GEM
98105
unicode-display_width (>= 1.4.0, < 1.7)
99106
rubocop-rspec (1.33.0)
100107
rubocop (>= 0.60.0)
101-
ruby-debug-ide (0.7.2)
108+
ruby-debug-ide (0.7.3)
102109
rake (>= 0.8.1)
103-
ruby-progressbar (1.10.1)
104-
thor (1.0.1)
105-
tzinfo (2.0.4)
110+
ruby-progressbar (1.13.0)
111+
thor (1.2.1)
112+
tzinfo (2.0.6)
106113
concurrent-ruby (~> 1.0)
107-
unicode-display_width (1.6.0)
108-
zeitwerk (2.4.2)
114+
unicode-display_width (1.6.1)
115+
webrick (1.8.1)
109116

110117
PLATFORMS
111118
arm64-darwin-21
@@ -118,16 +125,17 @@ PLATFORMS
118125
DEPENDENCIES
119126
actionpack
120127
apollo-federation!
121-
appraisal
122-
debase
123-
graphql (= 1.10.14)
128+
appraisal!
129+
debase (= 0.2.5.beta2)
130+
graphql (~> 2.0.0)
124131
pry-byebug
125132
rack
126133
rake
127134
rspec
128-
rubocop (~> 0.72.0)
135+
rubocop (~> 0.75.0)
129136
rubocop-rspec
130137
ruby-debug-ide
138+
webrick
131139

132140
BUNDLED WITH
133-
2.4.8
141+
2.4.9

apollo-federation.gemspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ Gem::Specification.new do |spec|
3232

3333
spec.add_development_dependency 'actionpack'
3434
spec.add_development_dependency 'appraisal'
35-
spec.add_development_dependency 'debase'
35+
spec.add_development_dependency 'debase', '0.2.5.beta2'
3636
spec.add_development_dependency 'pry-byebug'
3737
spec.add_development_dependency 'rack'
3838
spec.add_development_dependency 'rake'
3939
spec.add_development_dependency 'rspec'
40-
spec.add_development_dependency 'rubocop', '~> 0.72.0'
40+
spec.add_development_dependency 'rubocop', '~> 0.75.0'
4141
spec.add_development_dependency 'rubocop-rspec'
4242
spec.add_development_dependency 'ruby-debug-ide'
43+
spec.add_development_dependency 'webrick'
4344
end

example/graphql_server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def self.run(schema, options = {})
3434
end
3535
end.parse!
3636

37-
Rack::Handler::WEBrick.run(GraphQLServer.new(schema), handler_options) do
37+
Rack::Handler::WEBrick.run(GraphQLServer.new(schema), **handler_options) do
3838
if test_mode
3939
$stdout.puts '_READY_'
4040
$stdout.flush

0 commit comments

Comments
 (0)