canvas_sync 0.16.1 → 0.17.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -137
  3. data/app/models/canvas_sync/sync_batch.rb +5 -0
  4. data/db/migrate/20170915210836_create_canvas_sync_job_log.rb +12 -31
  5. data/db/migrate/20180725155729_add_job_id_to_canvas_sync_job_logs.rb +4 -13
  6. data/db/migrate/20190916154829_add_fork_count_to_canvas_sync_job_logs.rb +3 -11
  7. data/db/migrate/20201018210836_create_canvas_sync_sync_batches.rb +11 -0
  8. data/lib/canvas_sync.rb +35 -118
  9. data/lib/canvas_sync/concerns/api_syncable.rb +27 -0
  10. data/lib/canvas_sync/concerns/legacy_columns.rb +5 -4
  11. data/lib/canvas_sync/job.rb +5 -5
  12. data/lib/canvas_sync/job_batches/batch.rb +399 -0
  13. data/lib/canvas_sync/job_batches/batch_aware_job.rb +62 -0
  14. data/lib/canvas_sync/job_batches/callback.rb +153 -0
  15. data/lib/canvas_sync/job_batches/chain_builder.rb +203 -0
  16. data/lib/canvas_sync/job_batches/context_hash.rb +147 -0
  17. data/lib/canvas_sync/job_batches/jobs/base_job.rb +7 -0
  18. data/lib/canvas_sync/job_batches/jobs/concurrent_batch_job.rb +18 -0
  19. data/lib/canvas_sync/job_batches/jobs/serial_batch_job.rb +73 -0
  20. data/lib/canvas_sync/job_batches/sidekiq.rb +91 -0
  21. data/lib/canvas_sync/job_batches/status.rb +63 -0
  22. data/lib/canvas_sync/jobs/begin_sync_chain_job.rb +34 -0
  23. data/lib/canvas_sync/jobs/report_checker.rb +3 -6
  24. data/lib/canvas_sync/jobs/report_processor_job.rb +2 -5
  25. data/lib/canvas_sync/jobs/report_starter.rb +27 -19
  26. data/lib/canvas_sync/jobs/sync_accounts_job.rb +3 -5
  27. data/lib/canvas_sync/jobs/sync_admins_job.rb +2 -4
  28. data/lib/canvas_sync/jobs/sync_assignment_groups_job.rb +2 -4
  29. data/lib/canvas_sync/jobs/sync_assignments_job.rb +2 -4
  30. data/lib/canvas_sync/jobs/sync_context_module_items_job.rb +2 -4
  31. data/lib/canvas_sync/jobs/sync_context_modules_job.rb +2 -4
  32. data/lib/canvas_sync/jobs/sync_provisioning_report_job.rb +5 -32
  33. data/lib/canvas_sync/jobs/sync_roles_job.rb +2 -5
  34. data/lib/canvas_sync/jobs/sync_simple_table_job.rb +11 -32
  35. data/lib/canvas_sync/jobs/sync_submissions_job.rb +2 -4
  36. data/lib/canvas_sync/jobs/sync_terms_job.rb +22 -7
  37. data/lib/canvas_sync/misc_helper.rb +15 -0
  38. data/lib/canvas_sync/version.rb +1 -1
  39. data/spec/canvas_sync/canvas_sync_spec.rb +126 -153
  40. data/spec/canvas_sync/jobs/job_spec.rb +9 -17
  41. data/spec/canvas_sync/jobs/report_checker_spec.rb +1 -3
  42. data/spec/canvas_sync/jobs/report_processor_job_spec.rb +0 -3
  43. data/spec/canvas_sync/jobs/report_starter_spec.rb +19 -28
  44. data/spec/canvas_sync/jobs/sync_admins_job_spec.rb +1 -4
  45. data/spec/canvas_sync/jobs/sync_assignment_groups_job_spec.rb +2 -1
  46. data/spec/canvas_sync/jobs/sync_assignments_job_spec.rb +3 -2
  47. data/spec/canvas_sync/jobs/sync_context_module_items_job_spec.rb +3 -2
  48. data/spec/canvas_sync/jobs/sync_context_modules_job_spec.rb +3 -2
  49. data/spec/canvas_sync/jobs/sync_provisioning_report_job_spec.rb +3 -35
  50. data/spec/canvas_sync/jobs/sync_roles_job_spec.rb +1 -4
  51. data/spec/canvas_sync/jobs/sync_simple_table_job_spec.rb +5 -12
  52. data/spec/canvas_sync/jobs/sync_submissions_job_spec.rb +2 -1
  53. data/spec/canvas_sync/jobs/sync_terms_job_spec.rb +1 -4
  54. data/spec/dummy/app/models/account.rb +3 -0
  55. data/spec/dummy/app/models/pseudonym.rb +14 -0
  56. data/spec/dummy/app/models/submission.rb +1 -0
  57. data/spec/dummy/app/models/user.rb +1 -0
  58. data/spec/dummy/config/environments/test.rb +2 -0
  59. data/spec/dummy/db/migrate/20201016181346_create_pseudonyms.rb +24 -0
  60. data/spec/dummy/db/schema.rb +24 -4
  61. data/spec/job_batching/batch_aware_job_spec.rb +100 -0
  62. data/spec/job_batching/batch_spec.rb +363 -0
  63. data/spec/job_batching/callback_spec.rb +38 -0
  64. data/spec/job_batching/flow_spec.rb +91 -0
  65. data/spec/job_batching/integration/integration.rb +57 -0
  66. data/spec/job_batching/integration/nested.rb +88 -0
  67. data/spec/job_batching/integration/simple.rb +47 -0
  68. data/spec/job_batching/integration/workflow.rb +134 -0
  69. data/spec/job_batching/integration_helper.rb +48 -0
  70. data/spec/job_batching/sidekiq_spec.rb +124 -0
  71. data/spec/job_batching/status_spec.rb +92 -0
  72. data/spec/job_batching/support/base_job.rb +14 -0
  73. data/spec/job_batching/support/sample_callback.rb +2 -0
  74. data/spec/spec_helper.rb +17 -0
  75. metadata +94 -22
  76. data/lib/canvas_sync/job_chain.rb +0 -57
  77. data/lib/canvas_sync/jobs/fork_gather.rb +0 -59
  78. data/spec/canvas_sync/jobs/fork_gather_spec.rb +0 -73
  79. data/spec/dummy/db/test.sqlite3 +0 -0
  80. data/spec/dummy/log/development.log +0 -1248
  81. data/spec/dummy/log/test.log +0 -43258
  82. data/spec/support/fixtures/reports/provisioning_csv_unzipped/courses.csv +0 -3
  83. data/spec/support/fixtures/reports/provisioning_csv_unzipped/users.csv +0 -4
@@ -1,3 +0,0 @@
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
@@ -1,4 +0,0 @@
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