Commit Graph

54 Commits

Author SHA1 Message Date
JT Olds eaf2c6390a abstract course importer
Change-Id: Ic96bc376171a8d52bc7f175395eba7687d4dac28
Reviewed-on: https://gerrit.instructure.com/4089
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-06-27 11:01:32 -06:00
JT Olds 5cd6d3b679 make non-sis crosslisting sticky
if a user crosslists via the ui, we don't want the SIS to blow away those
changes. fixes #4840, refs #4815

Change-Id: Ia3f844b3a33d9c9a6e9433dc79ce74e433f1f389
Reviewed-on: https://gerrit.instructure.com/4162
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-06-16 08:42:46 -06:00
JT Olds 4bbeacce99 set enrollment restriction to course/section dates when provided
closes #4832

Change-Id: I204a00863d7c85c1e4c8489d1dc367e99bcffde6
Reviewed-on: https://gerrit.instructure.com/4156
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-06-16 08:42:36 -06:00
JT Olds bc7a9050f1 make sure users and pseudonyms get added together
Change-Id: I912f39f09a6b59daea9ac04f158a0e94279159dc
Reviewed-on: https://gerrit.instructure.com/4183
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-06-14 10:46:54 -06:00
Brian Palmer d17dfcd883 add groups/group_memberships to sis csv import, closes #4247
Change-Id: I49fd646c8f4ce9c5d3fa8f9b1a7ba2e0a6d84e9d
Reviewed-on: https://gerrit.instructure.com/4034
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-06-03 15:17:08 -06:00
JT Olds c63bd9c558 keep crosslisted course data up-to-date via sis imports for original course
Change-Id: Ibfbc5a22c8778bd5188505812f3f5abbdd807578
Reviewed-on: https://gerrit.instructure.com/3652
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-05-31 13:03:05 -06:00
JT Olds 654bf600cf update course account associations on section save
Change-Id: I97f88e43c489691ab5f63a28e4d0695f6c8096b6
Reviewed-on: https://gerrit.instructure.com/3673
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-05-31 13:02:54 -06:00
JT Olds 38f221a2d4 enrollment importer fix
Change-Id: I044c8c659f6bf546c9834bb939a79c58b81ae6e8
Reviewed-on: https://gerrit.instructure.com/3896
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-26 16:48:25 -06:00
Cody Cutrer b60e645b0d import and support ssha passwords from sis. fixes #4573
Change-Id: I703730644f0094d7cb85d8def322969267de3ce5
Reviewed-on: https://gerrit.instructure.com/3755
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-23 08:40:35 -06:00
Cody Cutrer 4299d867ae fixups for distributed sis imports
In particular, @batch.finish is necessary for the "blocked" job to finish.
Also, don't use send_later_if_production, just do it everywhere. By default
it won't get here anyway, so it's okay for tests.

Change-Id: I53bb4276769af481e3787073ddebb7ea5e5a5ed1
Reviewed-on: https://gerrit.instructure.com/3769
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-23 08:37:29 -06:00
Cody Cutrer 21f636cb0f use transactions for user and enrollment imports
For "small" imports (<5000 users), this improves wall-clock time
only a bit, but is much much nicer to the db.  The larger the
import, though, the more the improvement here.

Be careful that we only use transactions on things that wouldn't
block other imports running in parallel, or even progress updates
running on the same thread.

Also be smarter about how often we update progress, since that
transaction can have a considerable impact on wall clock time.

refs #3752

Change-Id: I8a79bc530f5433858ccf7d62d33b98ba25e98ffa
Reviewed-on: https://gerrit.instructure.com/3613
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-05-20 10:39:11 -06:00
Cody Cutrer cfedec15da parallelize sis imports
* Controlled by plugin settings; default 1
 * Will re-balance incoming CSVs into at least <parallelism> new CSVs
   (per import type)
   * If there is a single CSV, it will be split optimally
   * If there are multiple CSVs, no such guarantees are made
 * Each CSV will be processed as a separate DelayedJob
 * Accounts are not parallelized
 * All other import types are parallelized within their own type. I.e.
   all courses will be imported before any sections are started

Change-Id: Ifa6fe4e63812be95db999bdf963ab7cc1b15b75d
Reviewed-on: https://gerrit.instructure.com/3582
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-05-20 10:39:02 -06:00
Cody Cutrer 12329cc621 avoid several sub-jobs during sis import refs #3752
* Account#update_account_associations during account import
 * Course#update_account_assocations during xlist and section import
 * Course#update_enrolled_users during xlist import
 * Enrollment#recompute_final_score during xlist and section import

Change-Id: Ic97fe0e7ceeb50dcf89e4569d2571a0626f2114d
Reviewed-on: https://gerrit.instructure.com/3609
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-05-16 15:38:07 -06:00
JT Olds 0af7ccee09 don't reset the account id if the course already has one and one wasn't provided
Change-Id: Ib0c33bd880b597968fd0eda31d29ae64939e299b
Reviewed-on: https://gerrit.instructure.com/3628
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-16 14:16:13 -06:00
JT Olds cfae736f5c don't increment successful user counts on failures
Change-Id: I90ea084deeaacb954ebad94e1803460534df92b9
Reviewed-on: https://gerrit.instructure.com/3626
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-16 14:15:47 -06:00
JT Olds 08ab2a604c always reset section account on sis import
Change-Id: I91c50b23f8349b878ec3ef6714ee04d399e5c0a5
Reviewed-on: https://gerrit.instructure.com/3671
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-16 08:23:32 -06:00
Brian Palmer b657f4e959 generate an error report for all errors, not just some of them
refs #4487

This consolidates our ErrorReport class with our ErrorLogging mechanism,
it's all in ErrorReport now and you call ErrorReport.log_error or
ErrorReport.log_exception to both create an ErrorReport object, and call
the hooks similar to what ErrorLogging did so that plugins for other
error handling mechanisms can be injected.

ErrorReport has a category field now, similar to how ErrorLogging used
to take a type. the /error_reports UI can filter by category.

The plugin interface was designed with Hoptoad integration in mind, but
it should be pretty general.

Change-Id: I59f7a0d44cf4b6215ad13ff92d30e1d1af607b74
Reviewed-on: https://gerrit.instructure.com/3577
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-11 10:36:56 -06:00
JT Olds 1b900f660e update existing sis communication channel instead of creating new ones. fixes #4538
Change-Id: Idf6e03ee14b2f93e4393a36229305dcdb3da14e8
Reviewed-on: https://gerrit.instructure.com/3585
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-11 10:34:08 -06:00
Cody Cutrer 3b206bdeef refactor csv importer for less copy/paste
Change-Id: I7b35914c32629d503354ad6cddfaecd9bdf954fe
Reviewed-on: https://gerrit.instructure.com/3569
Reviewed-by: JT Olds <jt@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-10 11:19:58 -06:00
JT Olds 837b99828d enable account hierarchy modifications via the sis interface. refs #4521
Change-Id: Iea6e2abd6f2222e22ba67f2f0bfd91446d118e92
Reviewed-on: https://gerrit.instructure.com/3528
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-05-10 11:00:56 -06:00
JT Olds f027bd7bc1 undelete courses that are crosslisted to. fixes #4519
Change-Id: I620b30d4af5280b735f26f61c8a39a92e34957d2
Reviewed-on: https://gerrit.instructure.com/3519
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-05-10 11:00:48 -06:00
Cody Cutrer 60ae77b062 avoid saving unchanged courses, and batch updating sis_source_id
refs #3752

Change-Id: Ic65f555ad7ca501f6f7ecab4957ec7df40dfd876
Reviewed-on: https://gerrit.instructure.com/3563
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-05-10 10:22:11 -06:00
Cody Cutrer 8ac765f6ff avoid saving unchanged enrollments, and batch updating sis_source_id
refs #3752

Change-Id: If282d829a0714e98c31cfccdb94ec0639c063f9b
Reviewed-on: https://gerrit.instructure.com/3566
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-05-10 10:19:53 -06:00
Cody Cutrer 50173ca63f don't lookup sections by name
it is not a suitable unique identifier, as evidenced by actual data

Change-Id: Ib2b2f6d523b2ad052b4eff9a35c10a6e62d394c5
Reviewed-on: https://gerrit.instructure.com/3565
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-10 09:43:06 -06:00
Cody Cutrer 52fd347a6c avoid saving unchanged sections, and batch updating sis_source_id
refs #3752

also avoid an account lookup if possible

Change-Id: I8ea6b276cfdcfa86c5c70bd0051bca62737d7d77
Reviewed-on: https://gerrit.instructure.com/3564
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-10 09:42:59 -06:00
Cody Cutrer 768e217967 user import optimizations refs #3752
* Only save the pseudonym once
 * Avoid saving the user and pseudonym if nothing actually changed
 * Related to that, since we skipped updating sis_batch_id
   individually, we still need to do that, so do it en-masse instead.
   updated_at will *not* get updated now.

These changes make re-importing the same data 3x faster than the
original import (it used to be less then 2x as fast as the original
import).

Change-Id: Ia6ea32cdeb2f4aebe041d8a51b9efe6c89bc819c
Reviewed-on: https://gerrit.instructure.com/3558
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-09 15:58:43 -06:00
Cody Cutrer a7e646f79c set account object not just id to avoid later lookup in Pseudonym#validate_unique_id
refs #3752

Change-Id: Ice950e03c1b6f226bb24d7b9f23ffb0042dba3eb
Reviewed-on: https://gerrit.instructure.com/3555
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-09 15:54:27 -06:00
Cody Cutrer a349d49000 update_all needs an array, not a set
Change-Id: I16c0cd8c44e21af574b8bb5b9c137e791b334688
Reviewed-on: https://gerrit.instructure.com/3551
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-05-09 10:41:28 -06:00
Cody Cutrer c4ade8327d touch courses en-masse
And avoid broadcast_policy callbacks for them
(save_without_broadcasting only affects the object you call it on,
and not everything that gets automatically saved along with it).

Change-Id: Iaeff7c038bfb2516449eaa12c8b87a1256374ca5
Reviewed-on: https://gerrit.instructure.com/3533
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-09 10:20:50 -06:00
Cody Cutrer 7af4dfd742 strategic cache use refs #3752
* Pre-set objects we already have that get used later
 * Compare ids instead of objects to avoid loading stuff we don't
   have (and don't need)

Change-Id: Idf7b701a5ae294c973b3c058dfa4d4f4d0b752bc
Reviewed-on: https://gerrit.instructure.com/3527
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-09 10:20:44 -06:00
Cody Cutrer 799c7f0164 update course account associations synchronously during import
Change-Id: I6c27bf7964987a27e7e019556e35b683987d90ed
Reviewed-on: https://gerrit.instructure.com/3521
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-05-09 10:20:38 -06:00
Cody Cutrer 7505e1d303 avoid force-reloading data from the database if possible
refs #3752

Change-Id: I7eb25aafd59ff1c785de2f318117336827e776cc
Reviewed-on: https://gerrit.instructure.com/3516
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-06 14:01:56 -06:00
JT Olds 9ab40ec477 course start and end dates. refs #4398
Change-Id: I1fe062fe1b54a8e387822e636e3c7ed3ece49c9c
Reviewed-on: https://gerrit.instructure.com/3494
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-06 09:37:33 -06:00
Zach Wily 7beaf4d764 fix update_account_associations job getting created for every imported user
Change-Id: Ia7dc8ca3912510114d88035e264e59ebb54fe086
Reviewed-on: https://gerrit.instructure.com/3446
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-03 14:26:18 -06:00
JT Olds 03fae4c7dd banner does *not* have email addresses we can deterministically figure out for every user
Change-Id: If114f99f577affcc8f33ab743be45479f537cc52
Reviewed-on: https://gerrit.instructure.com/3376
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-29 14:39:24 -06:00
JT Olds 4c6c9056d1 be more paranoid when looking up users for sis
Change-Id: I4129ba2d687ba8d9cb6cdb363711635a6e443955
Reviewed-on: https://gerrit.instructure.com/3353
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-29 09:49:01 -06:00
Cody Cutrer d5c439b0c2 grade publishing results importer
Change-Id: I5279b8dadc9084858099b4b55aaf2dc8ef632a9a
Reviewed-on: https://gerrit.instructure.com/3134
Reviewed-by: JT Olds <jt@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-04-27 16:45:49 -06:00
Zach Wily 2f3756fc37 optimize account association setup when saving enrollments
First of all, be smarter about when we do it - it's only necessary on new
records or when something in the enrollment changes that could affect account
associations.

Second, during SIS import, gather up each user that will actually need their
associations updated and do it at the end. Normally a user will get several
enrollments during a SIS update and this can reduce the amount of work we do
by a lot.

Change-Id: I2f095dd9e7e148229e52e6b5e8b6624dfe389c31
Reviewed-on: https://gerrit.instructure.com/3200
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-04-22 08:40:57 -06:00
Zach Wily 06e89cdb6e do default notification policy setup synchronously during SIS import
Change-Id: Ic619952b079d0774bb78fdd8cbb3b930b83bce28
Reviewed-on: https://gerrit.instructure.com/3199
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-04-22 08:23:51 -06:00
Zach Wily 3911ab3cd3 update account associations while creating users
Change-Id: Ie7eda5d1f27da0ee9da8b723ac151a63e97288c9
Reviewed-on: https://gerrit.instructure.com/3198
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-04-22 08:23:37 -06:00
JT Olds 33854cbc4b renaming last_course to nonxlist_course and changing crosslisting semantics
Change-Id: I0b017d4506c54151f34c50c28754b6e1c1a46691
Reviewed-on: https://gerrit.instructure.com/3171
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-21 15:43:39 -06:00
JT Olds 6e8acdf576 when creating a new crosslist course, prepopulate course data with existing section's course
Change-Id: I647c9ede4826b7e85c7906d9b24b95e056a7efff
Reviewed-on: https://gerrit.instructure.com/3162
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-04-21 15:01:43 -06:00
JT Olds f5149ad4d7 sis import feedback fixes
Change-Id: I81c96b0ca050c0888b20fa886b735b93bf92d1c4
Reviewed-on: https://gerrit.instructure.com/3161
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-04-21 15:01:37 -06:00
Zach Wily 9823cbe480 make the sis verification step check for global section id uniqueness
Change-Id: Ic04b193bcc8835771fcac7ff8c052322b1a49863
Reviewed-on: https://gerrit.instructure.com/2906
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-04-17 15:28:35 -06:00
JT Olds 6ec333f475 xlist sis importing tests with fixes
Change-Id: Ied4b5fe75984bd399f294041e80935bd86671e0e
Reviewed-on: https://gerrit.instructure.com/3112
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-04-15 15:36:18 -06:00
Zach Wily dc0d205b89 make sure to get the right section on sis import
Change-Id: Ie08fbaea4babc960bdb3a859b14282eaaf4b27b9
Reviewed-on: https://gerrit.instructure.com/2887
Reviewed-by: Brian Whitmer <brian@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-03-30 14:20:44 -06:00
JT Olds d46a843458 cross-list importing logic
Change-Id: I4aebf7a05a2231f039c6b197f43f1e5344621230
Reviewed-on: https://gerrit.instructure.com/2516
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-03-08 15:15:03 -07:00
JT Olds 04165d74c1 cross list importing stub
Change-Id: Ifc755f3dacf23e6b0a8a3159b0c16bde1c4523ce
Reviewed-on: https://gerrit.instructure.com/2512
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-03-08 15:14:35 -07:00
Brian Whitmer 41c9f12988 enforce term/course/section start and end dates
before we were recording these values but not doing
anything about it.  This commit starts scheduling
delayed_jobs to activate/conclude enrollments
in the background when dates pass.

it does not conclude/publish courses/sections
automatically, though.  if we want that to be
automated based on dates then I think we should
do that in a separate commit.

fixes #3356

Change-Id: Id94356fbc5b82196dd041fdb250607a7633cee9f
Reviewed-on: https://gerrit.instructure.com/2431
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-03-01 13:47:12 -07:00
JT Olds 3d229d9ea4 optionally scale siscsv progress to some subsection of total work
Change-Id: I99cb59667c2fb57aac194b6c06777f8c6c4ffb2e
Reviewed-on: https://gerrit.instructure.com/2448
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-02-25 16:14:09 -07:00