canvas_sync 0.10.3 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +57 -2
- data/db/migrate/20190916154829_add_fork_count_to_canvas_sync_job_logs.rb +13 -0
- data/lib/canvas_sync.rb +43 -8
- data/lib/canvas_sync/api_syncable.rb +8 -0
- data/lib/canvas_sync/generators/templates/migrations/create_admins.rb +7 -4
- data/lib/canvas_sync/generators/templates/migrations/create_roles.rb +3 -4
- data/lib/canvas_sync/generators/templates/models/account.rb +2 -0
- data/lib/canvas_sync/generators/templates/models/admin.rb +4 -5
- data/lib/canvas_sync/generators/templates/models/role.rb +0 -4
- data/lib/canvas_sync/generators/templates/models/term.rb +0 -2
- data/lib/canvas_sync/importers/bulk_importer.rb +7 -4
- data/lib/canvas_sync/job.rb +24 -1
- data/lib/canvas_sync/jobs/fork_gather.rb +59 -0
- data/lib/canvas_sync/jobs/report_starter.rb +12 -1
- data/lib/canvas_sync/jobs/sync_admins_job.rb +9 -5
- data/lib/canvas_sync/jobs/sync_assignment_groups_job.rb +2 -8
- data/lib/canvas_sync/jobs/sync_assignments_job.rb +2 -8
- data/lib/canvas_sync/jobs/sync_context_module_items_job.rb +2 -8
- data/lib/canvas_sync/jobs/sync_context_modules_job.rb +2 -8
- data/lib/canvas_sync/jobs/sync_provisioning_report_job.rb +23 -11
- data/lib/canvas_sync/jobs/sync_roles_job.rb +8 -5
- data/lib/canvas_sync/jobs/sync_simple_table_job.rb +17 -7
- data/lib/canvas_sync/jobs/sync_submissions_job.rb +1 -5
- data/lib/canvas_sync/jobs/sync_terms_job.rb +8 -2
- data/lib/canvas_sync/jobs/sync_users_job.rb +5 -7
- data/lib/canvas_sync/processors/assignment_groups_processor.rb +3 -2
- data/lib/canvas_sync/processors/assignments_processor.rb +3 -2
- data/lib/canvas_sync/processors/context_module_items_processor.rb +3 -2
- data/lib/canvas_sync/processors/context_modules_processor.rb +3 -2
- data/lib/canvas_sync/processors/normal_processor.rb +2 -1
- data/lib/canvas_sync/processors/provisioning_report_processor.rb +7 -2
- data/lib/canvas_sync/processors/submissions_processor.rb +3 -2
- data/lib/canvas_sync/version.rb +1 -1
- data/spec/canvas_sync/canvas_sync_spec.rb +17 -0
- data/spec/canvas_sync/jobs/fork_gather_spec.rb +73 -0
- data/spec/canvas_sync/jobs/job_spec.rb +39 -5
- data/spec/canvas_sync/jobs/sync_admins_job_spec.rb +2 -1
- data/spec/canvas_sync/jobs/sync_assignment_groups_job_spec.rb +1 -1
- data/spec/canvas_sync/jobs/sync_assignments_job_spec.rb +2 -2
- data/spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb +2 -2
- data/spec/canvas_sync/jobs/sync_context_modules_job_spec.rb +2 -2
- data/spec/canvas_sync/jobs/sync_provisioning_report_job_spec.rb +20 -11
- data/spec/canvas_sync/jobs/sync_roles_job_spec.rb +2 -1
- data/spec/canvas_sync/jobs/sync_simple_table_job_spec.rb +1 -0
- data/spec/canvas_sync/jobs/sync_submissions_job_spec.rb +1 -1
- data/spec/canvas_sync/jobs/sync_users_job_spec.rb +1 -1
- data/spec/canvas_sync/models/admins_spec.rb +3 -5
- data/spec/canvas_sync/models/roles_spec.rb +5 -5
- data/spec/canvas_sync/models/term_spec.rb +3 -3
- data/spec/dummy/app/models/account.rb +2 -0
- data/spec/dummy/app/models/admin.rb +4 -5
- data/spec/dummy/app/models/role.rb +0 -4
- data/spec/dummy/app/models/term.rb +0 -2
- data/spec/dummy/db/migrate/{20190702203628_create_roles.rb → 20190927204545_create_roles.rb} +3 -4
- data/spec/dummy/db/migrate/{20190702203629_create_admins.rb → 20190927204546_create_admins.rb} +7 -4
- data/spec/dummy/db/schema.rb +12 -9
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +1248 -0
- data/spec/dummy/log/test.log +43258 -0
- data/spec/factories/admin_factory.rb +0 -1
- data/spec/support/fake_canvas.rb +2 -2
- data/spec/support/fixtures/canvas_responses/roles.json +6 -0
- data/spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv +3 -0
- data/spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv +4 -0
- metadata +25 -12
data/spec/support/fake_canvas.rb
CHANGED
@@ -8,11 +8,11 @@ class FakeCanvas < Sinatra::Base
|
|
8
8
|
json_response 200, 'terms.json'
|
9
9
|
end
|
10
10
|
|
11
|
-
get '/api/v1/accounts/
|
11
|
+
get '/api/v1/accounts/1/roles' do
|
12
12
|
json_response 200, 'roles.json'
|
13
13
|
end
|
14
14
|
|
15
|
-
get '/api/v1/accounts/
|
15
|
+
get '/api/v1/accounts/1/admins' do
|
16
16
|
json_response 200, 'admins.json'
|
17
17
|
end
|
18
18
|
|
@@ -414,6 +414,9 @@
|
|
414
414
|
"applies_to_descendants": true,
|
415
415
|
"applies_to_self": true
|
416
416
|
}
|
417
|
+
},
|
418
|
+
"account": {
|
419
|
+
"id": 10
|
417
420
|
}
|
418
421
|
},
|
419
422
|
{
|
@@ -743,6 +746,9 @@
|
|
743
746
|
"readonly": true,
|
744
747
|
"explicit": false
|
745
748
|
}
|
749
|
+
},
|
750
|
+
"account": {
|
751
|
+
"id": 10
|
746
752
|
}
|
747
753
|
}
|
748
754
|
]
|
@@ -0,0 +1,3 @@
|
|
1
|
+
canvas_course_id,course_id,integration_id,short_name,long_name,canvas_account_id,account_id,canvas_term_id,term_id,status,start_date,end_date,course_format,created_by_sis
|
2
|
+
1,course_sis_id_1,,C1,Course #1,1,,1,term_sis_id_1,active,2017-03-27T15:53:18-06:00,2017-04-27T06:21:18-06:00,,FALSE
|
3
|
+
2,course_sis_id_2,,C2,Course #2,1,,1,term_sis_id_2,unpublished,2017-03-27T15:53:18-06:00,2017-04-27T06:21:18-06:00,,FALSE
|
@@ -0,0 +1,4 @@
|
|
1
|
+
canvas_user_id,user_id,integration_id,authentication_provider_id,login_id,first_name,last_name,full_name,sortable_name,short_name,email,status,created_by_sis
|
2
|
+
1,sis_id_1,,123,spiderdude1337,Patches,the Spider,Patches the Spider,"the Spider, Patches",,poorbastard@yharnam.com,active,FALSE
|
3
|
+
2,sis_id_2,,1234,retireddude109,Hunter,Djura,Hunter Djura,"Djura, Hunter",,dreamer@yharnam.com,active,FALSE
|
4
|
+
2,sis_id_2,,1234,retireddude110,Hunter,Djura,Hunter Djura,"Djura, Hunter",,dreamer@yharnam.com,active,FALSE
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canvas_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Collings
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -304,7 +304,7 @@ dependencies:
|
|
304
304
|
- - ">="
|
305
305
|
- !ruby/object:Gem::Version
|
306
306
|
version: '0'
|
307
|
-
description:
|
307
|
+
description:
|
308
308
|
email:
|
309
309
|
- ncollings@instructure.com
|
310
310
|
executables: []
|
@@ -319,6 +319,7 @@ files:
|
|
319
319
|
- config/initializers/apartment.rb
|
320
320
|
- db/migrate/20170915210836_create_canvas_sync_job_log.rb
|
321
321
|
- db/migrate/20180725155729_add_job_id_to_canvas_sync_job_logs.rb
|
322
|
+
- db/migrate/20190916154829_add_fork_count_to_canvas_sync_job_logs.rb
|
322
323
|
- lib/canvas_sync.rb
|
323
324
|
- lib/canvas_sync/api_syncable.rb
|
324
325
|
- lib/canvas_sync/config.rb
|
@@ -366,6 +367,7 @@ files:
|
|
366
367
|
- lib/canvas_sync/importers/bulk_importer.rb
|
367
368
|
- lib/canvas_sync/importers/legacy_importer.rb
|
368
369
|
- lib/canvas_sync/job.rb
|
370
|
+
- lib/canvas_sync/jobs/fork_gather.rb
|
369
371
|
- lib/canvas_sync/jobs/report_checker.rb
|
370
372
|
- lib/canvas_sync/jobs/report_processor_job.rb
|
371
373
|
- lib/canvas_sync/jobs/report_starter.rb
|
@@ -392,6 +394,7 @@ files:
|
|
392
394
|
- lib/canvas_sync/sidekiq_job.rb
|
393
395
|
- lib/canvas_sync/version.rb
|
394
396
|
- spec/canvas_sync/canvas_sync_spec.rb
|
397
|
+
- spec/canvas_sync/jobs/fork_gather_spec.rb
|
395
398
|
- spec/canvas_sync/jobs/job_spec.rb
|
396
399
|
- spec/canvas_sync/jobs/report_checker_spec.rb
|
397
400
|
- spec/canvas_sync/jobs/report_processor_job_spec.rb
|
@@ -495,12 +498,15 @@ files:
|
|
495
498
|
- spec/dummy/db/migrate/20190702203625_create_sections.rb
|
496
499
|
- spec/dummy/db/migrate/20190702203626_create_assignments.rb
|
497
500
|
- spec/dummy/db/migrate/20190702203627_create_submissions.rb
|
498
|
-
- spec/dummy/db/migrate/20190702203628_create_roles.rb
|
499
|
-
- spec/dummy/db/migrate/20190702203629_create_admins.rb
|
500
501
|
- spec/dummy/db/migrate/20190702203630_create_assignment_groups.rb
|
501
502
|
- spec/dummy/db/migrate/20190702203631_create_context_modules.rb
|
502
503
|
- spec/dummy/db/migrate/20190702203632_create_context_module_items.rb
|
504
|
+
- spec/dummy/db/migrate/20190927204545_create_roles.rb
|
505
|
+
- spec/dummy/db/migrate/20190927204546_create_admins.rb
|
503
506
|
- spec/dummy/db/schema.rb
|
507
|
+
- spec/dummy/db/test.sqlite3
|
508
|
+
- spec/dummy/log/development.log
|
509
|
+
- spec/dummy/log/test.log
|
504
510
|
- spec/factories/account_factory.rb
|
505
511
|
- spec/factories/admin_factory.rb
|
506
512
|
- spec/factories/assignment_factory.rb
|
@@ -528,6 +534,8 @@ files:
|
|
528
534
|
- spec/support/fixtures/reports/courses.csv
|
529
535
|
- spec/support/fixtures/reports/enrollments.csv
|
530
536
|
- spec/support/fixtures/reports/provisioning_csv
|
537
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv
|
538
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv
|
531
539
|
- spec/support/fixtures/reports/sections.csv
|
532
540
|
- spec/support/fixtures/reports/submissions.csv
|
533
541
|
- spec/support/fixtures/reports/users.csv
|
@@ -535,7 +543,7 @@ files:
|
|
535
543
|
homepage: https://instructure.com
|
536
544
|
licenses: []
|
537
545
|
metadata: {}
|
538
|
-
post_install_message:
|
546
|
+
post_install_message:
|
539
547
|
rdoc_options: []
|
540
548
|
require_paths:
|
541
549
|
- lib
|
@@ -550,13 +558,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
550
558
|
- !ruby/object:Gem::Version
|
551
559
|
version: '0'
|
552
560
|
requirements: []
|
553
|
-
|
554
|
-
|
555
|
-
signing_key:
|
561
|
+
rubygems_version: 3.1.2
|
562
|
+
signing_key:
|
556
563
|
specification_version: 4
|
557
564
|
summary: Gem for generating Canvas models and migrations and syncing data from Canvas
|
558
565
|
test_files:
|
559
566
|
- spec/canvas_sync/canvas_sync_spec.rb
|
567
|
+
- spec/canvas_sync/jobs/fork_gather_spec.rb
|
560
568
|
- spec/canvas_sync/jobs/job_spec.rb
|
561
569
|
- spec/canvas_sync/jobs/report_checker_spec.rb
|
562
570
|
- spec/canvas_sync/jobs/report_processor_job_spec.rb
|
@@ -660,12 +668,15 @@ test_files:
|
|
660
668
|
- spec/dummy/db/migrate/20190702203625_create_sections.rb
|
661
669
|
- spec/dummy/db/migrate/20190702203626_create_assignments.rb
|
662
670
|
- spec/dummy/db/migrate/20190702203627_create_submissions.rb
|
663
|
-
- spec/dummy/db/migrate/20190702203628_create_roles.rb
|
664
|
-
- spec/dummy/db/migrate/20190702203629_create_admins.rb
|
665
671
|
- spec/dummy/db/migrate/20190702203630_create_assignment_groups.rb
|
666
672
|
- spec/dummy/db/migrate/20190702203631_create_context_modules.rb
|
667
673
|
- spec/dummy/db/migrate/20190702203632_create_context_module_items.rb
|
674
|
+
- spec/dummy/db/migrate/20190927204545_create_roles.rb
|
675
|
+
- spec/dummy/db/migrate/20190927204546_create_admins.rb
|
668
676
|
- spec/dummy/db/schema.rb
|
677
|
+
- spec/dummy/db/test.sqlite3
|
678
|
+
- spec/dummy/log/development.log
|
679
|
+
- spec/dummy/log/test.log
|
669
680
|
- spec/factories/account_factory.rb
|
670
681
|
- spec/factories/admin_factory.rb
|
671
682
|
- spec/factories/assignment_factory.rb
|
@@ -693,6 +704,8 @@ test_files:
|
|
693
704
|
- spec/support/fixtures/reports/courses.csv
|
694
705
|
- spec/support/fixtures/reports/enrollments.csv
|
695
706
|
- spec/support/fixtures/reports/provisioning_csv
|
707
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv
|
708
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv
|
696
709
|
- spec/support/fixtures/reports/sections.csv
|
697
710
|
- spec/support/fixtures/reports/submissions.csv
|
698
711
|
- spec/support/fixtures/reports/users.csv
|