Skip to content

Commit 8a6758b

Browse files
Merge pull request #159 from rainforestapp/upgrade_ruby_313
Upgrade to Ruby 3.1.3
2 parents 7914dfd + 37ef831 commit 8a6758b

File tree

13 files changed

+89
-40
lines changed

13 files changed

+89
-40
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
jobs:
44
test:
55
docker:
6-
- image: circleci/ruby:2.7
6+
- image: cimg/ruby:3.1.3
77
auth:
88
username: $DOCKERHUB_USERNAME
99
password: $DOCKERHUB_TOKEN
@@ -48,7 +48,7 @@ jobs:
4848
command: bundle exec exe/circlemator test-security --base-branch=master
4949
push_to_rubygems:
5050
docker:
51-
- image: circleci/ruby:2.7
51+
- image: cimg/ruby:3.1.3
5252
auth:
5353
username: $DOCKERHUB_USERNAME
5454
password: $DOCKERHUB_TOKEN

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.4
1+
3.1.3

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruby 3.1.3

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:2.7.4
1+
FROM ruby:3.1.3
22
RUN apt-get update -y && apt-get install -y cmake
33

44
# Set default locale for Ruby to avoid encoding errors

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ source 'https://rubygems.org'
44
# Specify your gem's dependencies in circlemator.gemspec
55
gemspec
66

7-
gem 'rf-stylez'
7+
gem 'rf-stylez', git: 'https://github.com/rainforestapp/rf-stylez.git', branch: 'upgrade_versions'
88
gem 'rspec_junit_formatter'

Gemfile.lock

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
GIT
2+
remote: https://github.com/rainforestapp/rf-stylez.git
3+
revision: 5cddb5b1b9f4164c4bfec412ebd2bab02b87f463
4+
branch: upgrade_versions
5+
specs:
6+
rf-stylez (0.16.0)
7+
get_env (~> 0.2.0)
8+
reek (~> 6.1)
9+
rubocop (= 1.15.0)
10+
rubocop-rails (= 2.10.1)
11+
rubocop-rspec (= 2.3.0)
12+
unparser (~> 0.6)
13+
114
PATH
215
remote: .
316
specs:
@@ -12,18 +25,17 @@ PATH
1225
GEM
1326
remote: https://rubygems.org/
1427
specs:
15-
activesupport (6.1.4.1)
28+
activesupport (7.0.4)
1629
concurrent-ruby (~> 1.0, >= 1.0.2)
1730
i18n (>= 1.6, < 2)
1831
minitest (>= 5.1)
1932
tzinfo (~> 2.0)
20-
zeitwerk (~> 2.3)
2133
addressable (2.8.0)
2234
public_suffix (>= 2.0.2, < 5.0)
2335
ast (2.4.2)
2436
brakeman (5.1.1)
2537
coderay (1.1.2)
26-
concurrent-ruby (1.1.9)
38+
concurrent-ruby (1.1.10)
2739
crack (0.4.5)
2840
rexml
2941
diff-lcs (1.4.4)
@@ -47,7 +59,7 @@ GEM
4759
faraday-net_http_persistent (1.2.0)
4860
faraday-patron (1.0.0)
4961
faraday-rack (1.0.0)
50-
ffi (1.11.1)
62+
ffi (1.15.5)
5163
formatador (0.2.5)
5264
get_env (0.2.0)
5365
gitlab (4.17.0)
@@ -71,20 +83,21 @@ GEM
7183
httparty (0.18.1)
7284
mime-types (~> 3.0)
7385
multi_xml (>= 0.5.2)
74-
i18n (1.8.10)
86+
i18n (1.12.0)
7587
concurrent-ruby (~> 1.0)
7688
imagen (0.1.8)
7789
parser (>= 2.5, != 2.5.1.1)
7890
json (2.3.0)
79-
listen (3.2.0)
91+
kwalify (0.7.2)
92+
listen (3.7.1)
8093
rb-fsevent (~> 0.10, >= 0.10.3)
8194
rb-inotify (~> 0.9, >= 0.9.10)
8295
lumberjack (1.0.13)
8396
method_source (0.9.2)
8497
mime-types (3.3.1)
8598
mime-types-data (~> 3.2015)
8699
mime-types-data (3.2021.0704)
87-
minitest (5.14.4)
100+
minitest (5.16.3)
88101
multi_xml (0.6.0)
89102
multipart-post (2.1.1)
90103
nenv (0.3.0)
@@ -94,8 +107,8 @@ GEM
94107
octokit (4.21.0)
95108
faraday (>= 0.9)
96109
sawyer (~> 0.8.0, >= 0.5.3)
97-
parallel (1.20.2)
98-
parser (3.0.2.0)
110+
parallel (1.22.1)
111+
parser (3.1.2.1)
99112
ast (~> 2.4.1)
100113
pronto (0.11.0)
101114
gitlab (~> 4.4, >= 4.4.0)
@@ -120,21 +133,18 @@ GEM
120133
coderay (~> 1.1.0)
121134
method_source (~> 0.9.0)
122135
public_suffix (4.0.6)
123-
rack (2.2.3)
136+
rack (3.0.3)
124137
rainbow (3.0.0)
125138
rake (13.0.6)
126139
rb-fsevent (0.10.3)
127140
rb-inotify (0.10.0)
128141
ffi (~> 1.0)
142+
reek (6.1.2)
143+
kwalify (~> 0.7.0)
144+
parser (~> 3.1.0)
145+
rainbow (>= 2.0, < 4.0)
129146
regexp_parser (2.1.1)
130147
rexml (3.2.5)
131-
rf-stylez (0.12.0)
132-
get_env (~> 0.2.0)
133-
rubocop (= 1.15.0)
134-
rubocop-rails (= 2.10.1)
135-
rubocop-rspec (= 2.3.0)
136-
semantic_versioning (~> 0.2)
137-
unparser (~> 0.6)
138148
rspec (3.10.0)
139149
rspec-core (~> 3.10.0)
140150
rspec-expectations (~> 3.10.0)
@@ -174,7 +184,6 @@ GEM
174184
sawyer (0.8.2)
175185
addressable (>= 2.3.5)
176186
faraday (> 0.8, < 2.0)
177-
semantic_versioning (0.2.0)
178187
shellany (0.0.1)
179188
simplecov (0.17.1)
180189
docile (~> 1.1)
@@ -184,22 +193,21 @@ GEM
184193
simplecov-lcov (0.8.0)
185194
terminal-table (1.6.0)
186195
thor (1.1.0)
187-
tzinfo (2.0.4)
196+
tzinfo (2.0.5)
188197
concurrent-ruby (~> 1.0)
189198
undercover (0.3.4)
190199
imagen (>= 0.1.8)
191200
rainbow (>= 2.1, < 4.0)
192201
rugged (>= 0.27, < 1.1)
193202
unicode-display_width (2.0.0)
194-
unparser (0.6.0)
203+
unparser (0.6.5)
195204
diff-lcs (~> 1.3)
196-
parser (>= 3.0.0)
205+
parser (>= 3.1.0)
197206
vcr (6.0.0)
198207
webmock (3.14.0)
199208
addressable (>= 2.8.0)
200209
crack (>= 0.3.2)
201210
hashdiff (>= 0.4.0, < 2.0.0)
202-
zeitwerk (2.4.2)
203211

204212
PLATFORMS
205213
ruby
@@ -209,7 +217,7 @@ DEPENDENCIES
209217
circlemator!
210218
guard-rspec (~> 4.7.3)
211219
rake (~> 13.0)
212-
rf-stylez
220+
rf-stylez!
213221
rspec (~> 3.10.0)
214222
rspec_junit_formatter
215223
rubocop

exe/circlemator

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,45 +68,70 @@ when 'self-merge'
6868
require_opt options, :github_auth_token
6969
require_opt options, :base_branch
7070
require_opt options, :compare_branch
71-
options[:github_repo] = Circlemator::GithubRepo.new(options)
71+
options[:github_repo] = Circlemator::GithubRepo.new(
72+
user: options[:user],
73+
repo: options[:repo],
74+
github_auth_token: options[:github_auth_token]
75+
)
7276

7377
Circlemator::SelfMerger.new(options).merge!
7478
when 'cancel-old'
7579
options[:current_build] = require_env('CIRCLE_BUILD_NUM').to_i
7680
options[:circle_api_token] ||= ENV['CIRCLE_API_TOKEN']
7781
require_opt options, :circle_api_token
7882

79-
Circlemator::BuildCanceler.new(options).cancel_old_builds!
83+
Circlemator::BuildCanceler.new(
84+
user: options[:user],
85+
repo: options[:repo],
86+
current_build: options[:current_build],
87+
circle_api_token: options[:circle_api_token]
88+
).cancel_old_builds!
8089
when 'style-check'
8190
options[:sha] = require_env 'CIRCLE_SHA1'
8291
options[:compare_branch] ||= require_env 'CIRCLE_BRANCH'
8392
require_opt options, :github_auth_token
8493
require_opt options, :base_branch
85-
options[:github_repo] = Circlemator::GithubRepo.new(options)
94+
options[:github_repo] = Circlemator::GithubRepo.new(
95+
user: options[:user],
96+
repo: options[:repo],
97+
github_auth_token: options[:github_auth_token]
98+
)
8699

87100
Circlemator::CodeAnalyser.new(options).check_style
88101
when 'test-coverage'
89102
options[:sha] = require_env 'CIRCLE_SHA1'
90103
options[:compare_branch] ||= require_env 'CIRCLE_BRANCH'
91104
require_opt options, :github_auth_token
92105
require_opt options, :base_branch
93-
options[:github_repo] = Circlemator::GithubRepo.new(options)
106+
options[:github_repo] = Circlemator::GithubRepo.new(
107+
user: options[:user],
108+
repo: options[:repo],
109+
github_auth_token: options[:github_auth_token]
110+
)
94111

95112
Circlemator::CodeAnalyser.new(options).check_coverage
96113
when 'test-security'
97114
options[:sha] = require_env 'CIRCLE_SHA1'
98115
options[:compare_branch] ||= require_env 'CIRCLE_BRANCH'
99116
require_opt options, :github_auth_token
100117
require_opt options, :base_branch
101-
options[:github_repo] = Circlemator::GithubRepo.new(options)
118+
options[:github_repo] = Circlemator::GithubRepo.new(
119+
user: options[:user],
120+
repo: options[:repo],
121+
github_auth_token: options[:github_auth_token]
122+
)
102123

103124
Circlemator::CodeAnalyser.new(options).check_security
104125
when 'comment'
105126
options[:sha] = require_env 'CIRCLE_SHA1'
106127
options[:compare_branch] ||= require_env 'CIRCLE_BRANCH'
107128
require_opt options, :github_auth_token
108129
require_opt options, :base_branch
109-
options[:github_repo] = Circlemator::GithubRepo.new(options)
130+
options[:github_repo] = Circlemator::GithubRepo.new(
131+
user: options[:user],
132+
repo: options[:repo],
133+
github_auth_token: options[:github_auth_token]
134+
)
110135

111136
unless ARGV[1]
112137
puts 'Please add some text to the comment!'

lib/circlemator/build_canceler.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module Circlemator
66
class BuildCanceler
7-
def initialize(user:, repo:, current_build:, circle_api_token:, **_opts)
7+
def initialize(user:, repo:, current_build:, circle_api_token:)
88
@user = user
99
@repo = repo
1010
@current_build = current_build

lib/circlemator/code_analyser.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ def run_pronto
3434
end
3535

3636
def formatter
37-
pr_number, _ = PrFinder.new(**@opts).find_pr
37+
pr_number, _ = PrFinder.new(
38+
github_repo: @opts[:github_repo],
39+
base_branch: @opts[:base_branch],
40+
compare_branch: @opts[:compare_branch],
41+
sha: @opts[:sha]
42+
).find_pr
3843
if pr_number
3944
ENV['PRONTO_PULL_REQUEST_ID'] = pr_number.to_s
4045
Pronto::Formatter::GithubPullRequestFormatter.new

lib/circlemator/github_repo.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def initialize(url, repo)
1919

2020
base_uri 'https://api.github.com/repos'
2121

22-
def initialize(user:, repo:, github_auth_token:, **_opts)
22+
def initialize(user:, repo:, github_auth_token:)
2323
@user = user
2424
@repo = repo
2525
@auth_token = github_auth_token

lib/circlemator/pr_commenter.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ def initialize(opts)
1313
end
1414

1515
def comment(text)
16-
_, pr_url = PrFinder.new(**@opts).find_pr
16+
_, pr_url = PrFinder.new(
17+
github_repo: @opts[:github_repo],
18+
base_branch: @opts[:base_branch],
19+
compare_branch: @opts[:compare_branch],
20+
sha: @opts[:sha]
21+
).find_pr
1722
raise 'PR not found!' unless pr_url
1823

1924
response = @github_repo.post "#{pr_url}/reviews", body: { commit_id: @sha,

lib/circlemator/pr_finder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def initialize(response)
99
end
1010
end
1111

12-
def initialize(github_repo:, base_branch:, compare_branch:, sha:, **_opts)
12+
def initialize(github_repo:, base_branch:, compare_branch:, sha:)
1313
@github_repo = github_repo
1414
@base_branch = base_branch
1515
@compare_branch = compare_branch

lib/circlemator/self_merger.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ def initialize(opts)
1515
end
1616

1717
def merge!
18-
pr_number, pr_url = PrFinder.new(**@opts).find_pr
18+
pr_number, pr_url = PrFinder.new(
19+
github_repo: @opts[:github_repo],
20+
base_branch: @opts[:base_branch],
21+
compare_branch: @opts[:compare_branch],
22+
sha: @opts[:sha]
23+
).find_pr
1924
return if pr_number.nil? || pr_url.nil?
2025

2126
response = @github_repo.put "#{pr_url}/merge",

0 commit comments

Comments
 (0)