canvas_sync 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/canvas_sync.rb +63 -15
- data/lib/canvas_sync/generators/templates/migrations/create_pseudonyms.rb +18 -0
- data/lib/canvas_sync/generators/templates/models/pseudonym.rb +8 -0
- data/lib/canvas_sync/generators/templates/models/user.rb +1 -0
- data/lib/canvas_sync/processors/model_mappings.yml +19 -0
- data/lib/canvas_sync/processors/provisioning_report_processor.rb +9 -0
- data/lib/canvas_sync/version.rb +1 -1
- data/spec/canvas_sync/canvas_sync_spec.rb +5 -2
- 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/support/fixtures/reports/provisioning_csv_unzipped/courses.csv +3 -0
- data/spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv +4 -0
- metadata +15 -7
- data/lib/canvas_sync/jobs/sync_users_job.rb +0 -26
- data/spec/canvas_sync/jobs/sync_users_job_spec.rb +0 -15
@@ -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.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Collings
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -340,6 +340,7 @@ files:
|
|
340
340
|
- lib/canvas_sync/generators/templates/migrations/create_enrollments.rb
|
341
341
|
- lib/canvas_sync/generators/templates/migrations/create_group_memberships.rb
|
342
342
|
- lib/canvas_sync/generators/templates/migrations/create_groups.rb
|
343
|
+
- lib/canvas_sync/generators/templates/migrations/create_pseudonyms.rb
|
343
344
|
- lib/canvas_sync/generators/templates/migrations/create_roles.rb
|
344
345
|
- lib/canvas_sync/generators/templates/migrations/create_sections.rb
|
345
346
|
- lib/canvas_sync/generators/templates/migrations/create_submissions.rb
|
@@ -355,6 +356,7 @@ files:
|
|
355
356
|
- lib/canvas_sync/generators/templates/models/enrollment.rb
|
356
357
|
- lib/canvas_sync/generators/templates/models/group.rb
|
357
358
|
- lib/canvas_sync/generators/templates/models/group_membership.rb
|
359
|
+
- lib/canvas_sync/generators/templates/models/pseudonym.rb
|
358
360
|
- lib/canvas_sync/generators/templates/models/role.rb
|
359
361
|
- lib/canvas_sync/generators/templates/models/section.rb
|
360
362
|
- lib/canvas_sync/generators/templates/models/submission.rb
|
@@ -391,7 +393,6 @@ files:
|
|
391
393
|
- lib/canvas_sync/jobs/sync_simple_table_job.rb
|
392
394
|
- lib/canvas_sync/jobs/sync_submissions_job.rb
|
393
395
|
- lib/canvas_sync/jobs/sync_terms_job.rb
|
394
|
-
- lib/canvas_sync/jobs/sync_users_job.rb
|
395
396
|
- lib/canvas_sync/processors/assignment_groups_processor.rb
|
396
397
|
- lib/canvas_sync/processors/assignments_processor.rb
|
397
398
|
- lib/canvas_sync/processors/context_module_items_processor.rb
|
@@ -420,7 +421,6 @@ files:
|
|
420
421
|
- spec/canvas_sync/jobs/sync_simple_table_job_spec.rb
|
421
422
|
- spec/canvas_sync/jobs/sync_submissions_job_spec.rb
|
422
423
|
- spec/canvas_sync/jobs/sync_terms_job_spec.rb
|
423
|
-
- spec/canvas_sync/jobs/sync_users_job_spec.rb
|
424
424
|
- spec/canvas_sync/models/accounts_spec.rb
|
425
425
|
- spec/canvas_sync/models/admins_spec.rb
|
426
426
|
- spec/canvas_sync/models/assignment_group_spec.rb
|
@@ -521,6 +521,9 @@ files:
|
|
521
521
|
- spec/dummy/db/migrate/20200415171620_create_groups.rb
|
522
522
|
- spec/dummy/db/migrate/20200416214248_create_group_memberships.rb
|
523
523
|
- spec/dummy/db/schema.rb
|
524
|
+
- spec/dummy/db/test.sqlite3
|
525
|
+
- spec/dummy/log/development.log
|
526
|
+
- spec/dummy/log/test.log
|
524
527
|
- spec/factories/account_factory.rb
|
525
528
|
- spec/factories/admin_factory.rb
|
526
529
|
- spec/factories/assignment_factory.rb
|
@@ -552,6 +555,8 @@ files:
|
|
552
555
|
- spec/support/fixtures/reports/group_memberships.csv
|
553
556
|
- spec/support/fixtures/reports/groups.csv
|
554
557
|
- spec/support/fixtures/reports/provisioning_csv
|
558
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv
|
559
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv
|
555
560
|
- spec/support/fixtures/reports/sections.csv
|
556
561
|
- spec/support/fixtures/reports/submissions.csv
|
557
562
|
- spec/support/fixtures/reports/users.csv
|
@@ -574,8 +579,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
574
579
|
- !ruby/object:Gem::Version
|
575
580
|
version: '0'
|
576
581
|
requirements: []
|
577
|
-
|
578
|
-
rubygems_version: 2.5.2.1
|
582
|
+
rubygems_version: 3.1.2
|
579
583
|
signing_key:
|
580
584
|
specification_version: 4
|
581
585
|
summary: Gem for generating Canvas models and migrations and syncing data from Canvas
|
@@ -596,7 +600,6 @@ test_files:
|
|
596
600
|
- spec/canvas_sync/jobs/sync_simple_table_job_spec.rb
|
597
601
|
- spec/canvas_sync/jobs/sync_submissions_job_spec.rb
|
598
602
|
- spec/canvas_sync/jobs/sync_terms_job_spec.rb
|
599
|
-
- spec/canvas_sync/jobs/sync_users_job_spec.rb
|
600
603
|
- spec/canvas_sync/models/accounts_spec.rb
|
601
604
|
- spec/canvas_sync/models/admins_spec.rb
|
602
605
|
- spec/canvas_sync/models/assignment_group_spec.rb
|
@@ -697,6 +700,9 @@ test_files:
|
|
697
700
|
- spec/dummy/db/migrate/20200415171620_create_groups.rb
|
698
701
|
- spec/dummy/db/migrate/20200416214248_create_group_memberships.rb
|
699
702
|
- spec/dummy/db/schema.rb
|
703
|
+
- spec/dummy/db/test.sqlite3
|
704
|
+
- spec/dummy/log/development.log
|
705
|
+
- spec/dummy/log/test.log
|
700
706
|
- spec/factories/account_factory.rb
|
701
707
|
- spec/factories/admin_factory.rb
|
702
708
|
- spec/factories/assignment_factory.rb
|
@@ -728,6 +734,8 @@ test_files:
|
|
728
734
|
- spec/support/fixtures/reports/group_memberships.csv
|
729
735
|
- spec/support/fixtures/reports/groups.csv
|
730
736
|
- spec/support/fixtures/reports/provisioning_csv
|
737
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv
|
738
|
+
- spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv
|
731
739
|
- spec/support/fixtures/reports/sections.csv
|
732
740
|
- spec/support/fixtures/reports/submissions.csv
|
733
741
|
- spec/support/fixtures/reports/users.csv
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module CanvasSync
|
2
|
-
module Jobs
|
3
|
-
class SyncUsersJob < ReportStarter
|
4
|
-
# Starts a provisioning report for just users.
|
5
|
-
#
|
6
|
-
# Provisioning reports do not scope users by term, so when we are
|
7
|
-
# running provisioning by term we sync users first so we don't duplicate
|
8
|
-
# the work of syncing all users for each term.
|
9
|
-
#
|
10
|
-
# @param job_chain [Hash]
|
11
|
-
# @param options [Hash]
|
12
|
-
def perform(job_chain, options)
|
13
|
-
super(
|
14
|
-
job_chain,
|
15
|
-
"proservices_provisioning_csv",
|
16
|
-
merge_report_params(job_chain, options, {
|
17
|
-
users: true,
|
18
|
-
include_deleted: true,
|
19
|
-
}, term_scope: false),
|
20
|
-
CanvasSync::Processors::ProvisioningReportProcessor.to_s,
|
21
|
-
{ models: ["users"] },
|
22
|
-
)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.describe CanvasSync::Jobs::SyncUsersJob do
|
4
|
-
describe '#perform' do
|
5
|
-
it 'enqueues a ReportStarter for a provisioning report across all terms with just users' do
|
6
|
-
expect_any_instance_of(Bearcat::Client).to receive(:start_report)
|
7
|
-
.with('self', 'proservices_provisioning_csv', { parameters: { users: true, include_deleted: true } })
|
8
|
-
.and_return({ 'id' => 1 })
|
9
|
-
|
10
|
-
expect(CanvasSync::Jobs::ReportChecker).to receive(:set).and_call_original
|
11
|
-
|
12
|
-
CanvasSync::Jobs::SyncUsersJob.perform_now({ jobs: [], global_options: {}}, {})
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|