Skip to content

Commit 8a7bf69

Browse files
authored
upgrade myjobs to rails-7 (#3404)
Upgrade myjobs to rails-7 and lock nokogiri and net-imap for ubuntu 20.
1 parent 1d27bb7 commit 8a7bf69

12 files changed

+274
-157
lines changed

apps/myjobs/Gemfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
22

33

44
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5-
gem 'rails', '6.1.7.6'
5+
gem 'rails', '7.0.8'
66
# Use sqlite3 as the database for Active Record
77
# Note that the version has been fixed due to an incompatibilty
88
# https://github.com/rails/rails/issues/35153
@@ -67,3 +67,8 @@ gem 'ood_appkit', '~> 2.0'
6767
# we have to lock rdoc because 6.4 depends on psych 4.0 which breaks with
6868
# Psych::BadAlias: Cannot load database configuration: Unknown alias: default
6969
gem 'rdoc', '6.3.3'
70+
71+
# lock nokogiri & net-imap to versions that are compatible with ruby 2.7.0
72+
# Ubuntu 20.04 uses.
73+
gem 'nokogiri', '~> 1.15', '< 1.16'
74+
gem 'net-imap', '~> 0.3', '< 0.4'

apps/myjobs/Gemfile.lock

+73-65
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,71 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (6.1.7.6)
5-
actionpack (= 6.1.7.6)
6-
activesupport (= 6.1.7.6)
4+
actioncable (7.0.8)
5+
actionpack (= 7.0.8)
6+
activesupport (= 7.0.8)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
9-
actionmailbox (6.1.7.6)
10-
actionpack (= 6.1.7.6)
11-
activejob (= 6.1.7.6)
12-
activerecord (= 6.1.7.6)
13-
activestorage (= 6.1.7.6)
14-
activesupport (= 6.1.7.6)
9+
actionmailbox (7.0.8)
10+
actionpack (= 7.0.8)
11+
activejob (= 7.0.8)
12+
activerecord (= 7.0.8)
13+
activestorage (= 7.0.8)
14+
activesupport (= 7.0.8)
1515
mail (>= 2.7.1)
16-
actionmailer (6.1.7.6)
17-
actionpack (= 6.1.7.6)
18-
actionview (= 6.1.7.6)
19-
activejob (= 6.1.7.6)
20-
activesupport (= 6.1.7.6)
16+
net-imap
17+
net-pop
18+
net-smtp
19+
actionmailer (7.0.8)
20+
actionpack (= 7.0.8)
21+
actionview (= 7.0.8)
22+
activejob (= 7.0.8)
23+
activesupport (= 7.0.8)
2124
mail (~> 2.5, >= 2.5.4)
25+
net-imap
26+
net-pop
27+
net-smtp
2228
rails-dom-testing (~> 2.0)
23-
actionpack (6.1.7.6)
24-
actionview (= 6.1.7.6)
25-
activesupport (= 6.1.7.6)
26-
rack (~> 2.0, >= 2.0.9)
29+
actionpack (7.0.8)
30+
actionview (= 7.0.8)
31+
activesupport (= 7.0.8)
32+
rack (~> 2.0, >= 2.2.4)
2733
rack-test (>= 0.6.3)
2834
rails-dom-testing (~> 2.0)
2935
rails-html-sanitizer (~> 1.0, >= 1.2.0)
30-
actiontext (6.1.7.6)
31-
actionpack (= 6.1.7.6)
32-
activerecord (= 6.1.7.6)
33-
activestorage (= 6.1.7.6)
34-
activesupport (= 6.1.7.6)
36+
actiontext (7.0.8)
37+
actionpack (= 7.0.8)
38+
activerecord (= 7.0.8)
39+
activestorage (= 7.0.8)
40+
activesupport (= 7.0.8)
41+
globalid (>= 0.6.0)
3542
nokogiri (>= 1.8.5)
36-
actionview (6.1.7.6)
37-
activesupport (= 6.1.7.6)
43+
actionview (7.0.8)
44+
activesupport (= 7.0.8)
3845
builder (~> 3.1)
3946
erubi (~> 1.4)
4047
rails-dom-testing (~> 2.0)
4148
rails-html-sanitizer (~> 1.1, >= 1.2.0)
42-
activejob (6.1.7.6)
43-
activesupport (= 6.1.7.6)
49+
activejob (7.0.8)
50+
activesupport (= 7.0.8)
4451
globalid (>= 0.3.6)
45-
activemodel (6.1.7.6)
46-
activesupport (= 6.1.7.6)
47-
activerecord (6.1.7.6)
48-
activemodel (= 6.1.7.6)
49-
activesupport (= 6.1.7.6)
50-
activestorage (6.1.7.6)
51-
actionpack (= 6.1.7.6)
52-
activejob (= 6.1.7.6)
53-
activerecord (= 6.1.7.6)
54-
activesupport (= 6.1.7.6)
52+
activemodel (7.0.8)
53+
activesupport (= 7.0.8)
54+
activerecord (7.0.8)
55+
activemodel (= 7.0.8)
56+
activesupport (= 7.0.8)
57+
activestorage (7.0.8)
58+
actionpack (= 7.0.8)
59+
activejob (= 7.0.8)
60+
activerecord (= 7.0.8)
61+
activesupport (= 7.0.8)
5562
marcel (~> 1.0)
5663
mini_mime (>= 1.1.0)
57-
activesupport (6.1.7.6)
64+
activesupport (7.0.8)
5865
concurrent-ruby (~> 1.0, >= 1.0.2)
5966
i18n (>= 1.6, < 2)
6067
minitest (>= 5.1)
6168
tzinfo (~> 2.0)
62-
zeitwerk (~> 2.3)
6369
addressable (2.8.6)
6470
public_suffix (>= 2.0.2, < 6.0)
6571
autoprefixer-rails (8.6.5)
@@ -92,7 +98,7 @@ GEM
9298
sassc (>= 1.11)
9399
globalid (1.2.1)
94100
activesupport (>= 6.1)
95-
i18n (1.14.1)
101+
i18n (1.14.4)
96102
concurrent-ruby (~> 1.0)
97103
jbuilder (2.11.5)
98104
actionview (>= 5.0.0)
@@ -124,11 +130,11 @@ GEM
124130
net-imap
125131
net-pop
126132
net-smtp
127-
marcel (1.0.2)
133+
marcel (1.0.4)
128134
method_source (1.0.0)
129135
mini_mime (1.1.5)
130136
mini_portile2 (2.8.5)
131-
minitest (5.21.2)
137+
minitest (5.22.2)
132138
mocha (2.1.0)
133139
ruby2_keywords (>= 0.0.5)
134140
mustache (1.1.1)
@@ -145,11 +151,11 @@ GEM
145151
nokogiri (1.15.5)
146152
mini_portile2 (~> 2.8.2)
147153
racc (~> 1.4)
148-
ood_appkit (2.1.1)
154+
ood_appkit (2.1.4)
149155
addressable (~> 2.4)
150156
lograge (~> 0.3)
151157
ood_core (~> 0.1)
152-
rails (>= 6.0.0, < 7)
158+
rails (>= 6.0.0)
153159
redcarpet (~> 3.2)
154160
ood_core (0.24.2)
155161
ffi (~> 1.9, >= 1.9.6)
@@ -169,21 +175,20 @@ GEM
169175
rack (2.2.8.1)
170176
rack-test (2.1.0)
171177
rack (>= 1.3)
172-
rails (6.1.7.6)
173-
actioncable (= 6.1.7.6)
174-
actionmailbox (= 6.1.7.6)
175-
actionmailer (= 6.1.7.6)
176-
actionpack (= 6.1.7.6)
177-
actiontext (= 6.1.7.6)
178-
actionview (= 6.1.7.6)
179-
activejob (= 6.1.7.6)
180-
activemodel (= 6.1.7.6)
181-
activerecord (= 6.1.7.6)
182-
activestorage (= 6.1.7.6)
183-
activesupport (= 6.1.7.6)
178+
rails (7.0.8)
179+
actioncable (= 7.0.8)
180+
actionmailbox (= 7.0.8)
181+
actionmailer (= 7.0.8)
182+
actionpack (= 7.0.8)
183+
actiontext (= 7.0.8)
184+
actionview (= 7.0.8)
185+
activejob (= 7.0.8)
186+
activemodel (= 7.0.8)
187+
activerecord (= 7.0.8)
188+
activestorage (= 7.0.8)
189+
activesupport (= 7.0.8)
184190
bundler (>= 1.15.0)
185-
railties (= 6.1.7.6)
186-
sprockets-rails (>= 2.0.0)
191+
railties (= 7.0.8)
187192
rails-controller-testing (1.0.5)
188193
actionpack (>= 5.0.1.rc1)
189194
actionview (>= 5.0.1.rc1)
@@ -195,19 +200,20 @@ GEM
195200
rails-html-sanitizer (1.6.0)
196201
loofah (~> 2.21)
197202
nokogiri (~> 1.14)
198-
railties (6.1.7.6)
199-
actionpack (= 6.1.7.6)
200-
activesupport (= 6.1.7.6)
203+
railties (7.0.8)
204+
actionpack (= 7.0.8)
205+
activesupport (= 7.0.8)
201206
method_source
202207
rake (>= 12.2)
203208
thor (~> 1.0)
209+
zeitwerk (~> 2.5)
204210
rake (13.1.0)
205211
rb-fsevent (0.11.2)
206212
rb-inotify (0.10.1)
207213
ffi (~> 1.0)
208214
rdoc (6.3.3)
209215
redcarpet (3.6.0)
210-
request_store (1.5.1)
216+
request_store (1.6.0)
211217
rack (>= 1.4)
212218
rexml (3.2.6)
213219
ruby2_keywords (0.0.5)
@@ -234,7 +240,7 @@ GEM
234240
activesupport (>= 5.2)
235241
sprockets (>= 3.0.0)
236242
sqlite3 (1.4.2)
237-
thor (1.3.0)
243+
thor (1.3.1)
238244
tilt (2.3.0)
239245
timecop (0.9.8)
240246
timeout (0.4.1)
@@ -245,7 +251,7 @@ GEM
245251
websocket-driver (0.7.6)
246252
websocket-extensions (>= 0.1.0)
247253
websocket-extensions (0.1.5)
248-
zeitwerk (2.6.12)
254+
zeitwerk (2.6.13)
249255

250256
PLATFORMS
251257
ruby
@@ -265,10 +271,12 @@ DEPENDENCIES
265271
js-routes (~> 1.2.4)
266272
local_time (~> 1.0.3)
267273
mocha (~> 2.1)
274+
net-imap (~> 0.3, < 0.4)
275+
nokogiri (~> 1.15, < 1.16)
268276
ood_appkit (~> 2.0)
269277
osc_machete_rails (~> 2.1.2)
270278
pbs (~> 2.2.1)
271-
rails (= 6.1.7.6)
279+
rails (= 7.0.8)
272280
rails-controller-testing
273281
rdoc (= 6.3.3)
274282
sass-rails (~> 5.0)

apps/myjobs/config/boot.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'bundler/setup' # Set up gems listed in the Gemfile.
44

55
# load dotenv files before "before_configuration" callback
6-
require File.expand_path('../configuration_singleton', __FILE__)
6+
require_relative 'configuration_singleton'
77

88
# global instance to access and use
99
Configuration = ConfigurationSingleton.new

apps/myjobs/config/environments/development.rb

+4-10
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
# Show full error reports.
1717
config.consider_all_requests_local = true
1818

19+
# Enable server timing
20+
config.server_timing = true
21+
1922
# Enable/disable caching. By default caching is disabled.
2023
# Run rails dev:cache to toggle caching.
21-
if Rails.root.join('tmp', 'caching-dev.txt').exist?
24+
if Rails.root.join('tmp/caching-dev.txt').exist?
2225
config.action_controller.perform_caching = true
2326
config.action_controller.enable_fragment_cache_logging = true
2427

@@ -47,11 +50,6 @@
4750
# Highlight code that triggered database queries in logs.
4851
config.active_record.verbose_query_logs = true
4952

50-
# Debug mode disables concatenation and preprocessing of assets.
51-
# This option may cause significant delays in view rendering with a large
52-
# number of complex assets.
53-
config.assets.debug = true
54-
5553
# Suppress logger output for asset requests.
5654
config.assets.quiet = true
5755

@@ -61,10 +59,6 @@
6159
# Annotate rendered view with file names.
6260
# config.action_view.annotate_rendered_view_with_filenames = true
6361

64-
# Use an evented file watcher to asynchronously detect changes in source code,
65-
# routes, locales, etc. This feature depends on the listen gem.
66-
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
67-
6862
# Uncomment if you wish to allow Action Cable access from any origin.
6963
# config.action_cable.disable_request_forgery_protection = true
7064

apps/myjobs/config/environments/production.rb

+2-33
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,12 @@
5151
# Use a different cache store in production.
5252
# config.cache_store = :mem_cache_store
5353

54-
# Use a real queuing backend for Active Job (and separate queues per environment).
55-
# config.active_job.queue_adapter = :resque
56-
# config.active_job.queue_name_prefix = "job_constructor_production"
57-
5854
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
5955
# the I18n.default_locale when a translation cannot be found).
6056
config.i18n.fallbacks = true
6157

62-
# Send deprecation notices to registered listeners.
63-
config.active_support.deprecation = :notify
64-
65-
# Log disallowed deprecations.
66-
config.active_support.disallowed_deprecation = :log
67-
68-
# Tell Active Support which deprecation messages to disallow.
69-
config.active_support.disallowed_deprecation_warnings = []
58+
# Don't log any deprecations.
59+
config.active_support.report_deprecations = false
7060

7161
# Use default logging formatter so that PID and timestamp are not suppressed.
7262
config.log_formatter = ::Logger::Formatter.new
@@ -84,26 +74,5 @@
8474
# Do not dump schema after migrations.
8575
config.active_record.dump_schema_after_migration = false
8676

87-
# Inserts middleware to perform automatic connection switching.
88-
# The `database_selector` hash is used to pass options to the DatabaseSelector
89-
# middleware. The `delay` is used to determine how long to wait after a write
90-
# to send a subsequent read to the primary.
91-
#
92-
# The `database_resolver` class is used by the middleware to determine which
93-
# database is appropriate to use based on the time delay.
94-
#
95-
# The `database_resolver_context` class is used by the middleware to set
96-
# timestamps for the last write to the primary. The resolver uses the context
97-
# class timestamps to determine how long to wait before reading from the
98-
# replica.
99-
#
100-
# By default Rails will store a last write timestamp in the session. The
101-
# DatabaseSelector middleware is designed as such you can define your own
102-
# strategy for connection switching and pass that into the middleware through
103-
# these configuration options.
104-
# config.active_record.database_selector = { delay: 2.seconds }
105-
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
106-
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
107-
10877
config.hosts = ENV['ALLOWED_HOSTS'].nil? ? nil : ENV['ALLOWED_HOSTS'].split(',')
10978
end

apps/myjobs/config/environments/test.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
Rails.application.configure do
99
# Settings specified here will take precedence over those in config/application.rb.
1010

11+
# Turn false under Spring and add config.action_view.cache_template_loading = true.
1112
config.cache_classes = true
1213

13-
# Do not eager load code on boot. This avoids loading your whole application
14-
# just for the purpose of running a single test. If you are using a tool that
15-
# preloads Rails for running tests, you may have to set it to true.
14+
# Eager loading loads your whole application. When running a single test locally,
15+
# this probably isn't necessary. It's a good idea to do in a continuous integration
16+
# system, or in some way before deploying your code.
1617
config.eager_load = false
1718

1819
# Configure public file server for tests with Cache-Control for performance.

0 commit comments

Comments
 (0)