coalescing_panda 5.2.2 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/coalescing_panda/assignment.rb +2 -2
- data/app/models/coalescing_panda/workers/account_miner.rb +6 -6
- data/app/models/coalescing_panda/workers/course_miner.rb +7 -7
- data/app/views/coalescing_panda/canvas_batches/_canvas_batch_flash.html.haml +2 -2
- data/lib/coalescing_panda/controller_helpers.rb +1 -1
- data/lib/coalescing_panda/engine.rb +8 -1
- data/lib/coalescing_panda/version.rb +1 -1
- data/lib/coalescing_panda.rb +6 -0
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/models/coalescing_panda/workers/account_miner_spec.rb +1 -1
- data/spec/models/coalescing_panda/workers/course_miner_spec.rb +1 -1
- metadata +58 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7878b0105e3d3ef6115420ad4fa3c2131677bf1ad567255105d5bf441da48f6
|
4
|
+
data.tar.gz: '0965adc240c9d7a787c279308ea9b52d8397ac92cef557cbb9941f5016bae29e'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6c496be1722e5de4afa2f423cf2d4c8e1a94e781a3f0b3b0dac918f5f28ea9c0a69ca1962b14c49fe33034513f30a80cd07e6b282a7b61c2175559f77d7367a
|
7
|
+
data.tar.gz: ddc3b0768499c4c0b1ac33ba9f173cff4444bb30c3253bec37a2f85e530121fab0e28ab4fb56baa66f70078750a96eff15cb6b2968fe9246f0f9a2f03e057c7b
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module CoalescingPanda
|
2
2
|
class Assignment < ActiveRecord::Base
|
3
3
|
belongs_to :course, foreign_key: :coalescing_panda_course_id, class_name: 'CoalescingPanda::Course'
|
4
|
-
belongs_to :assignment_group, foreign_key: :coalescing_panda_assignment_group_id, class_name: 'CoalescingPanda::AssignmentGroup'
|
5
|
-
belongs_to :group_category, foreign_key: :coalescing_panda_group_category_id, class_name: 'CoalescingPanda::GroupCategory'
|
4
|
+
belongs_to :assignment_group, foreign_key: :coalescing_panda_assignment_group_id, class_name: 'CoalescingPanda::AssignmentGroup', optional: true
|
5
|
+
belongs_to :group_category, foreign_key: :coalescing_panda_group_category_id, class_name: 'CoalescingPanda::GroupCategory', optional: true
|
6
6
|
has_many :submissions, foreign_key: :coalescing_panda_assignment_id, class_name: 'CoalescingPanda::Submission', dependent: :destroy
|
7
7
|
|
8
8
|
delegate :account, to: :course
|
@@ -20,7 +20,7 @@ class CoalescingPanda::Workers::AccountMiner
|
|
20
20
|
else
|
21
21
|
batch = account.canvas_batches.create(context: account, status: "Queued")
|
22
22
|
end
|
23
|
-
batch.
|
23
|
+
batch.update(options: options)
|
24
24
|
batch
|
25
25
|
end
|
26
26
|
|
@@ -35,18 +35,18 @@ class CoalescingPanda::Workers::AccountMiner
|
|
35
35
|
end
|
36
36
|
|
37
37
|
begin
|
38
|
-
batch.
|
38
|
+
batch.update(status: "Started", percent_complete: 0)
|
39
39
|
index = 1
|
40
40
|
SUPPORTED_MODELS.each do |model_key|
|
41
41
|
next unless options.include?(model_key)
|
42
42
|
process_api_data(model_key.to_sym)
|
43
43
|
percent_complete = (index/(options.count.nonzero? || 1).to_f * 100).round(1)
|
44
|
-
batch.
|
44
|
+
batch.update(percent_complete: percent_complete)
|
45
45
|
index += 1
|
46
46
|
end
|
47
|
-
batch.
|
47
|
+
batch.update(status: "Completed", percent_complete: 100)
|
48
48
|
rescue => e
|
49
|
-
batch.
|
49
|
+
batch.update(status: "Error", message: e.message)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
handle_asynchronously :start
|
@@ -55,7 +55,7 @@ class CoalescingPanda::Workers::AccountMiner
|
|
55
55
|
return true unless account.settings[:canvas_download_interval].present?
|
56
56
|
return true unless last_completed_batch = account.canvas_batches.where(context: account, status: 'Completed').order('updated_at ASC').first
|
57
57
|
should_download = last_completed_batch.updated_at < Time.zone.now - account.settings[:canvas_download_interval].minutes
|
58
|
-
batch.
|
58
|
+
batch.update(status: 'Canceled') unless should_download
|
59
59
|
should_download
|
60
60
|
end
|
61
61
|
|
@@ -26,7 +26,7 @@ class CoalescingPanda::Workers::CourseMiner
|
|
26
26
|
else
|
27
27
|
batch = account.canvas_batches.create(context: course, status: "Queued")
|
28
28
|
end
|
29
|
-
batch.
|
29
|
+
batch.update(options: options)
|
30
30
|
batch
|
31
31
|
end
|
32
32
|
|
@@ -41,18 +41,18 @@ class CoalescingPanda::Workers::CourseMiner
|
|
41
41
|
end
|
42
42
|
|
43
43
|
begin
|
44
|
-
batch.
|
44
|
+
batch.update(status: "Started", percent_complete: 0)
|
45
45
|
index = 1
|
46
46
|
SUPPORTED_MODELS.each do |model_key|
|
47
47
|
next unless options.include?(model_key)
|
48
48
|
process_api_data(model_key.to_sym)
|
49
49
|
percent_complete = (index/(options.count.nonzero? || 1).to_f * 100).round(1)
|
50
|
-
batch.
|
50
|
+
batch.update(percent_complete: percent_complete)
|
51
51
|
index += 1
|
52
52
|
end
|
53
|
-
batch.
|
53
|
+
batch.update(status: "Completed", percent_complete: 100)
|
54
54
|
rescue => e
|
55
|
-
batch.
|
55
|
+
batch.update(status: "Error", message: e.message)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
handle_asynchronously :start
|
@@ -61,7 +61,7 @@ class CoalescingPanda::Workers::CourseMiner
|
|
61
61
|
return true unless account.settings[:canvas_download_interval].present?
|
62
62
|
return true unless last_completed_batch = account.canvas_batches.where(context: course, status: 'Completed').order('updated_at ASC').first
|
63
63
|
should_download = last_completed_batch.updated_at < Time.zone.now - account.settings[:canvas_download_interval].minutes
|
64
|
-
batch.
|
64
|
+
batch.update(status: 'Canceled') unless should_download
|
65
65
|
should_download
|
66
66
|
end
|
67
67
|
|
@@ -285,7 +285,7 @@ class CoalescingPanda::Workers::CourseMiner
|
|
285
285
|
def delete_object(object, hard_delete = false, field = 'workflow_state')
|
286
286
|
if @options.include?(:soft_delete) && !hard_delete
|
287
287
|
begin
|
288
|
-
object.
|
288
|
+
object.update(field.to_sym => 'deleted')
|
289
289
|
rescue => e
|
290
290
|
Rails.logger.error("Error deleting with soft delete, attempting hard")
|
291
291
|
delete_object(object, true)
|
@@ -1,4 +1,4 @@
|
|
1
1
|
- if current_batch.present?
|
2
|
-
- path = CoalescingPanda::Engine.routes.url_helpers.canvas_batch_path(current_batch)
|
3
|
-
- clear_path = CoalescingPanda::Engine.routes.url_helpers.clear_batch_session_path
|
2
|
+
- path = CoalescingPanda::Engine.routes.url_helpers.canvas_batch_path(current_batch)
|
3
|
+
- clear_path = CoalescingPanda::Engine.routes.url_helpers.clear_batch_session_path
|
4
4
|
#batch-progress{data: {batch: current_batch.try(:to_json), url: path, clear_path: clear_path} }
|
@@ -208,7 +208,7 @@ module CoalescingPanda
|
|
208
208
|
# when using coalescing_panda.xyz_url (The Engine Prefix is not included)
|
209
209
|
# I believe https://github.com/rails/rails/issues/34452 is the same issue
|
210
210
|
def resolve_coalescing_panda_url(key)
|
211
|
-
key = key.to_s[0...-4] if key.to_s.
|
211
|
+
key = key.to_s[0...-4] if key.to_s.end_with?('_url')
|
212
212
|
resolved_path = coalescing_panda.send(:"#{key}_path")
|
213
213
|
cpurl = coalescing_panda_url
|
214
214
|
cppath = URI.parse(cpurl).path
|
@@ -3,7 +3,6 @@ require_relative './secure_headers'
|
|
3
3
|
|
4
4
|
module CoalescingPanda
|
5
5
|
class Engine < ::Rails::Engine
|
6
|
-
config.autoload_once_paths += Dir["#{config.root}/lib/**/"]
|
7
6
|
isolate_namespace CoalescingPanda
|
8
7
|
|
9
8
|
config.generators do |g|
|
@@ -19,6 +18,14 @@ module CoalescingPanda
|
|
19
18
|
end
|
20
19
|
end
|
21
20
|
|
21
|
+
initializer 'coalescing_panda.zeitwerk' do |app|
|
22
|
+
Rails.autoloaders.each do |autoloader|
|
23
|
+
autoloader.inflector.inflect(
|
24
|
+
'json_with_indifferent_access' => 'JSONWithIndifferentAccess'
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
22
29
|
initializer 'coalescing_panda.app_controller' do |app|
|
23
30
|
OAUTH_10_SUPPORT = true
|
24
31
|
ActiveSupport.on_load(:action_controller) do
|
data/lib/coalescing_panda.rb
CHANGED
@@ -9,6 +9,10 @@ require 'sass-rails'
|
|
9
9
|
require 'coffee-rails'
|
10
10
|
require 'p3p'
|
11
11
|
require 'delayed_job_active_record'
|
12
|
+
require "zeitwerk"
|
13
|
+
|
14
|
+
loader = Zeitwerk::Loader.for_gem
|
15
|
+
loader.setup
|
12
16
|
|
13
17
|
module CoalescingPanda
|
14
18
|
class LtiNavigationInUse < StandardError;end
|
@@ -63,3 +67,5 @@ module CoalescingPanda
|
|
63
67
|
end
|
64
68
|
|
65
69
|
end
|
70
|
+
|
71
|
+
loader.eager_load
|
@@ -73,7 +73,7 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
|
|
73
73
|
|
74
74
|
it 'should return a started batch if one exists' do
|
75
75
|
batch = worker.setup_batch
|
76
|
-
batch.
|
76
|
+
batch.update(status: 'Started')
|
77
77
|
batch = worker.setup_batch
|
78
78
|
expect(batch.status).to eq 'Started'
|
79
79
|
end
|
@@ -273,7 +273,7 @@ RSpec.describe CoalescingPanda::Workers::CourseMiner, :type => :model do
|
|
273
273
|
|
274
274
|
it 'should return a started batch if one exists' do
|
275
275
|
batch = worker.setup_batch
|
276
|
-
batch.
|
276
|
+
batch.update(status: 'Started')
|
277
277
|
batch = worker.setup_batch
|
278
278
|
expect(batch.status).to eq 'Started'
|
279
279
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coalescing_panda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Mills
|
8
8
|
- Cody Tanner
|
9
9
|
- Jake Sorce
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-07-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -18,42 +18,42 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 6.1.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
28
|
+
version: 6.1.7
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: actionview
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
33
|
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
35
|
+
version: '0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
42
|
+
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: bearcat
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - "
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '1.
|
49
|
+
version: '1.4'
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - "
|
54
|
+
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: '1.
|
56
|
+
version: '1.4'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: browser
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -242,6 +242,20 @@ dependencies:
|
|
242
242
|
- - "~>"
|
243
243
|
- !ruby/object:Gem::Version
|
244
244
|
version: '6.3'
|
245
|
+
- !ruby/object:Gem::Dependency
|
246
|
+
name: zeitwerk
|
247
|
+
requirement: !ruby/object:Gem::Requirement
|
248
|
+
requirements:
|
249
|
+
- - ">="
|
250
|
+
- !ruby/object:Gem::Version
|
251
|
+
version: 2.6.15
|
252
|
+
type: :runtime
|
253
|
+
prerelease: false
|
254
|
+
version_requirements: !ruby/object:Gem::Requirement
|
255
|
+
requirements:
|
256
|
+
- - ">="
|
257
|
+
- !ruby/object:Gem::Version
|
258
|
+
version: 2.6.15
|
245
259
|
- !ruby/object:Gem::Dependency
|
246
260
|
name: zip-zip
|
247
261
|
requirement: !ruby/object:Gem::Requirement
|
@@ -410,7 +424,35 @@ dependencies:
|
|
410
424
|
- - ">="
|
411
425
|
- !ruby/object:Gem::Version
|
412
426
|
version: '0'
|
413
|
-
|
427
|
+
- !ruby/object:Gem::Dependency
|
428
|
+
name: loofah
|
429
|
+
requirement: !ruby/object:Gem::Requirement
|
430
|
+
requirements:
|
431
|
+
- - "~>"
|
432
|
+
- !ruby/object:Gem::Version
|
433
|
+
version: 2.19.1
|
434
|
+
type: :development
|
435
|
+
prerelease: false
|
436
|
+
version_requirements: !ruby/object:Gem::Requirement
|
437
|
+
requirements:
|
438
|
+
- - "~>"
|
439
|
+
- !ruby/object:Gem::Version
|
440
|
+
version: 2.19.1
|
441
|
+
- !ruby/object:Gem::Dependency
|
442
|
+
name: redis
|
443
|
+
requirement: !ruby/object:Gem::Requirement
|
444
|
+
requirements:
|
445
|
+
- - ">="
|
446
|
+
- !ruby/object:Gem::Version
|
447
|
+
version: 4.0.1
|
448
|
+
type: :development
|
449
|
+
prerelease: false
|
450
|
+
version_requirements: !ruby/object:Gem::Requirement
|
451
|
+
requirements:
|
452
|
+
- - ">="
|
453
|
+
- !ruby/object:Gem::Version
|
454
|
+
version: 4.0.1
|
455
|
+
description:
|
414
456
|
email:
|
415
457
|
- nathanm@instructure.com
|
416
458
|
- ctanner@instructure.com
|
@@ -512,6 +554,7 @@ files:
|
|
512
554
|
- spec/controllers/coalescing_panda/oauth2_controller_spec.rb
|
513
555
|
- spec/dummy/README.rdoc
|
514
556
|
- spec/dummy/Rakefile
|
557
|
+
- spec/dummy/app/assets/config/manifest.js
|
515
558
|
- spec/dummy/app/assets/javascripts/application.js
|
516
559
|
- spec/dummy/app/assets/stylesheets/application.css
|
517
560
|
- spec/dummy/app/controllers/application_controller.rb
|
@@ -579,7 +622,7 @@ files:
|
|
579
622
|
homepage: http://www.instructure.com
|
580
623
|
licenses: []
|
581
624
|
metadata: {}
|
582
|
-
post_install_message:
|
625
|
+
post_install_message:
|
583
626
|
rdoc_options: []
|
584
627
|
require_paths:
|
585
628
|
- lib
|
@@ -595,7 +638,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
595
638
|
version: '0'
|
596
639
|
requirements: []
|
597
640
|
rubygems_version: 3.1.6
|
598
|
-
signing_key:
|
641
|
+
signing_key:
|
599
642
|
specification_version: 4
|
600
643
|
summary: Canvas LTI and OAUTH2 mountable engine
|
601
644
|
test_files:
|
@@ -634,6 +677,7 @@ test_files:
|
|
634
677
|
- spec/dummy/app/controllers/application_controller.rb
|
635
678
|
- spec/dummy/app/helpers/application_helper.rb
|
636
679
|
- spec/dummy/app/assets/stylesheets/application.css
|
680
|
+
- spec/dummy/app/assets/config/manifest.js
|
637
681
|
- spec/dummy/app/assets/javascripts/application.js
|
638
682
|
- spec/dummy/config/application.rb
|
639
683
|
- spec/dummy/config/initializers/lti_initializer.rb
|