Skip to content

Commit 99dc3c8

Browse files
Merge branch 'new/course-flow' into courseflow
2 parents a162cb8 + d750c61 commit 99dc3c8

File tree

140 files changed

+3064
-1099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+3064
-1099
lines changed

.ci-setup/texlive-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if ! command -v "$TEX_COMPILER" > /dev/null; then
2828

2929
echo "----------------------------------------"
3030
echo "Installing additional texlive packages:"
31-
tlmgr install fontawesome minted fvextra catchfile xstring framed lastpage tcolorbox environ pdfcol tikzfill markdown paralist csvsimple upquote tagpdf
31+
tlmgr install fontawesome luatextra luacode minted fvextra catchfile xstring framed lastpage pdfmanagement-testphase newpax tcolorbox environ pdfcol tikzfill markdown paralist csvsimple gobble upquote tagpdf
3232

3333
echo "----------------------------------------"
3434
echo "Ensuring the newpax package is sufficiently up to date:"

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ AllCops:
99
TargetRubyVersion: 3.1
1010
NewCops: disable
1111

12+
require:
13+
- rubocop-rails
14+
# - rubocop-performance
15+
# - rubocop-minitest
16+
# - rubocop-factory_bot
17+
1218
Style/HashSyntax:
1319
EnforcedShorthandSyntax: never
1420

CHANGELOG.md

Lines changed: 452 additions & 0 deletions
Large diffs are not rendered by default.

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ group :development, :test do
2222
gem 'listen'
2323
gem 'rails_best_practices'
2424
gem 'rubocop'
25+
gem 'rubocop-factory_bot'
2526
gem 'rubocop-faker'
27+
gem 'rubocop-minitest'
28+
gem 'rubocop-performance'
2629
gem 'rubocop-rails'
2730
gem 'ruby-lsp'
2831
gem 'simplecov', require: false

Gemfile.lock

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ GEM
149149
dry-logic (~> 1.4)
150150
zeitwerk (~> 2.6)
151151
e2mmap (0.1.0)
152-
erubi (1.12.0)
152+
erubi (1.13.0)
153153
erubis (2.7.0)
154154
et-orbi (1.2.11)
155155
tzinfo
@@ -162,7 +162,7 @@ GEM
162162
railties (>= 5.0.0)
163163
faker (3.4.1)
164164
i18n (>= 1.8.11, < 2)
165-
faraday (2.9.1)
165+
faraday (2.9.2)
166166
faraday-net_http (>= 2.0, < 3.2)
167167
faraday-follow_redirects (0.3.0)
168168
faraday (>= 1, < 3)
@@ -183,13 +183,12 @@ GEM
183183
raabro (~> 1.4)
184184
globalid (1.2.1)
185185
activesupport (>= 6.1)
186-
grape (2.0.0)
187-
activesupport (>= 5)
188-
builder
186+
grape (2.1.0)
187+
activesupport (>= 6)
189188
dry-types (>= 1.1)
190-
mustermann-grape (~> 1.0.0)
191-
rack (>= 1.3.0)
192-
rack-accept
189+
mustermann-grape (~> 1.1.0)
190+
rack (>= 2)
191+
zeitwerk
193192
grape-entity (1.0.1)
194193
activesupport (>= 3.0.0)
195194
multi_json (>= 1.3.2)
@@ -210,7 +209,7 @@ GEM
210209
ice_cube (~> 0.16)
211210
ice_cube (0.16.4)
212211
io-console (0.7.2)
213-
irb (1.13.1)
212+
irb (1.13.2)
214213
rdoc (>= 4.0.0)
215214
reline (>= 0.4.2)
216215
jaro_winkler (1.6.0)
@@ -243,7 +242,7 @@ GEM
243242
mime-types-data (~> 3.2015)
244243
mime-types-data (3.2024.0604)
245244
mini_mime (1.1.5)
246-
minitest (5.23.1)
245+
minitest (5.24.0)
247246
minitest-around (0.5.0)
248247
minitest (~> 5.0)
249248
minitest-rails (7.1.0)
@@ -255,13 +254,13 @@ GEM
255254
multi_json (1.15.0)
256255
mustermann (3.0.0)
257256
ruby2_keywords (~> 0.0.1)
258-
mustermann-grape (1.0.2)
257+
mustermann-grape (1.1.0)
259258
mustermann (>= 1.0.0)
260259
mutex_m (0.2.0)
261260
mysql2 (0.5.6)
262261
net-http (0.4.1)
263262
uri
264-
net-imap (0.4.12)
263+
net-imap (0.4.13)
265264
date
266265
net-protocol
267266
net-ldap (0.19.0)
@@ -273,7 +272,9 @@ GEM
273272
net-protocol
274273
netrc (0.11.0)
275274
nio4r (2.7.3)
276-
nokogiri (1.16.5-aarch64-linux)
275+
nokogiri (1.16.6-aarch64-linux)
276+
racc (~> 1.4)
277+
nokogiri (1.16.6-x86_64-linux)
277278
racc (~> 1.4)
278279
nokogiri (1.16.5-arm-linux)
279280
racc (~> 1.4)
@@ -288,7 +289,7 @@ GEM
288289
observer (0.1.2)
289290
orm_adapter (0.5.0)
290291
parallel (1.25.1)
291-
parser (3.3.2.0)
292+
parser (3.3.3.0)
292293
ast (~> 2.4.1)
293294
racc
294295
pdf-reader (2.12.0)
@@ -301,14 +302,12 @@ GEM
301302
prism (0.29.0)
302303
psych (5.1.2)
303304
stringio
304-
public_suffix (5.0.5)
305+
public_suffix (5.1.1)
305306
puma (6.4.2)
306307
nio4r (~> 2.0)
307308
raabro (1.4.0)
308309
racc (1.8.0)
309-
rack (3.0.11)
310-
rack-accept (0.4.5)
311-
rack (>= 0.4)
310+
rack (3.1.3)
312311
rack-cors (2.0.2)
313312
rack (>= 2.0.0)
314313
rack-session (2.0.0)
@@ -371,7 +370,7 @@ GEM
371370
redis-client (0.22.2)
372371
connection_pool
373372
regexp_parser (2.9.2)
374-
reline (0.5.8)
373+
reline (0.5.9)
375374
io-console (~> 0.5)
376375
require_all (3.0.0)
377376
responders (3.1.1)
@@ -384,7 +383,7 @@ GEM
384383
netrc (~> 0.8)
385384
reverse_markdown (2.1.1)
386385
nokogiri
387-
rexml (3.2.9)
386+
rexml (3.3.0)
388387
strscan
389388
rmagick (6.0.1)
390389
observer (~> 0.1)
@@ -396,7 +395,7 @@ GEM
396395
nokogiri
397396
roo (>= 2.0.0, < 3)
398397
spreadsheet (> 0.9.0)
399-
rouge (4.2.1)
398+
rouge (4.3.0)
400399
rubocop (1.64.1)
401400
json (~> 2.3)
402401
language_server-protocol (>= 3.17.0)
@@ -410,9 +409,17 @@ GEM
410409
unicode-display_width (>= 2.4.0, < 3.0)
411410
rubocop-ast (1.31.3)
412411
parser (>= 3.3.1.0)
412+
rubocop-factory_bot (2.26.1)
413+
rubocop (~> 1.61)
413414
rubocop-faker (1.1.0)
414415
faker (>= 2.12.0)
415416
rubocop (>= 0.82.0)
417+
rubocop-minitest (0.35.0)
418+
rubocop (>= 1.61, < 2.0)
419+
rubocop-ast (>= 1.31.1, < 2.0)
420+
rubocop-performance (1.21.1)
421+
rubocop (>= 1.48.1, < 2.0)
422+
rubocop-ast (>= 1.31.1, < 2.0)
416423
rubocop-rails (2.25.0)
417424
activesupport (>= 4.2.0)
418425
rack (>= 1.1)
@@ -465,7 +472,7 @@ GEM
465472
thor (~> 1.0)
466473
tilt (~> 2.0)
467474
yard (~> 0.9, >= 0.9.24)
468-
sorbet-runtime (0.5.11422)
475+
sorbet-runtime (0.5.11435)
469476
sorted_set (1.0.3)
470477
rbtree
471478
set (~> 1.0)
@@ -479,7 +486,7 @@ GEM
479486
actionpack (>= 6.1)
480487
activesupport (>= 6.1)
481488
sprockets (>= 3.0.0)
482-
stringio (3.1.0)
489+
stringio (3.1.1)
483490
strscan (3.1.0)
484491
tca_client (1.0.4)
485492
typhoeus (~> 1.0, >= 1.0.1)
@@ -506,7 +513,7 @@ GEM
506513
websocket-extensions (>= 0.1.0)
507514
websocket-extensions (0.1.5)
508515
yard (0.9.36)
509-
zeitwerk (2.6.15)
516+
zeitwerk (2.6.16)
510517

511518
PLATFORMS
512519
aarch64-linux-gnu
@@ -522,6 +529,7 @@ PLATFORMS
522529
x86_64-linux
523530
x86_64-linux-gnu
524531
x86_64-linux-musl
532+
aarch64-linux
525533

526534
DEPENDENCIES
527535
better_errors
@@ -565,7 +573,10 @@ DEPENDENCIES
565573
roo (~> 2.7.0)
566574
roo-xls
567575
rubocop
576+
rubocop-factory_bot
568577
rubocop-faker
578+
rubocop-minitest
579+
rubocop-performance
569580
rubocop-rails
570581
ruby-filemagic
571582
ruby-lsp

app/api/api_root.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ class ApiRoot < Grape::API
3333
when ActionController::ParameterMissing
3434
message = "Missing value for #{e.param}"
3535
status = 400
36+
when ActiveRecord::ConnectionTimeoutError
37+
message = 'There is currently high load on the system. Please wait a moment and try again.'
38+
status = 503
3639
else
40+
# rubocop:disable Rails/Output
3741
puts e.inspect unless Rails.env.production?
42+
# rubocop:enable Rails/Output
3843

3944
logger.error "Unhandled exception: #{e.class}"
4045
logger.error e.inspect

app/api/authentication_api.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class AuthenticationApi < Grape::API
102102
# Lookup using email otherwise and set login_id
103103
# Otherwise create new
104104
user = User.find_by(login_id: login_id) ||
105-
User.find_by_username(email[/(.*)@/, 1]) ||
105+
User.find_by(username: email[/(.*)@/, 1]) ||
106106
User.find_by(email: email) ||
107107
User.find_or_create_by(login_id: login_id) do |new_user|
108108
role_response = attributes.fetch(/role/) || attributes.fetch(/userRole/)
@@ -177,7 +177,7 @@ class AuthenticationApi < Grape::API
177177
# Lookup using email otherwise and set login_id
178178
# Otherwise create new
179179
user = User.find_by(login_id: login_id) ||
180-
User.find_by_username(email[/(.*)@/, 1]) ||
180+
User.find_by(username: email[/(.*)@/, 1]) ||
181181
User.find_by(email: email) ||
182182
User.find_or_create_by(login_id: login_id) do |new_user|
183183
role = Role.aaf_affiliation_to_role_id(attrs[:edupersonscopedaffiliation])
@@ -242,7 +242,7 @@ class AuthenticationApi < Grape::API
242242

243243
# Authenticate that the token is okay
244244
if authenticated?
245-
user = User.find_by_username(params[:username])
245+
user = User.find_by(username: params[:username])
246246
token = user.token_for_text?(params[:auth_token]) unless user.nil?
247247
error!({ error: 'Invalid token.' }, 404) if token.nil?
248248

@@ -323,7 +323,7 @@ class AuthenticationApi < Grape::API
323323
logger.info "Update token #{token_param} from #{request.ip} for #{user_param}"
324324

325325
# Find user
326-
user = User.find_by_username(user_param)
326+
user = User.find_by(username: user_param)
327327
token = user.token_for_text?(token_param) unless user.nil?
328328
remember = params[:remember] || false
329329

@@ -358,7 +358,7 @@ class AuthenticationApi < Grape::API
358358
}
359359
}
360360
delete '/auth' do
361-
user = User.find_by_username(headers['username'] || headers['Username'])
361+
user = User.find_by(username: headers['username'] || headers['Username'])
362362
token = user.token_for_text?(headers['auth-token'] || headers['Auth-Token']) unless user.nil?
363363

364364
if token.present?

0 commit comments

Comments
 (0)