Commit Graph

29 Commits

Author SHA1 Message Date
Brian Palmer 48dbf2d1a4 unstick workflow_state when batch deleting a course
This course.destroy call was marking the workflow_state of the course as
sticky, so that it could never be un-deleted via a SIS import ever
again.

I think an argument could be made that actually courses whose
workflow_state is currently sticky because of a UI change, shouldn't
even be deleted by a full batch delete. That's a big change from how
batch deletes currently work, though, and might cause issues with
manually published courses.

sections and enrollments also get batch deleted, but their
workflow_state fields aren't sticky.

refs #9200

test plan: import a course via sis as active, then upload a full batch
sis that doesn't include the course. the course should now be deleted.
then import the course again, and see that it's no longer deleted.

Change-Id: I14925e60fd4bd24dafaf8143a555eec6cccc9236
Reviewed-on: https://gerrit.instructure.com/12014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2012-07-07 06:47:29 -06:00
Cody Cutrer df97e23785 refactor sis imports api
basically, use the API from the UI, and delete duplicate code.
the api specs already covered everything the non-api specs tested

also drop the unused sis_batch_log_entries table

test plan:
 * validate an sis upload from the UI works, and shows progress,
   and completes successfully
 * validate the ui shows progress when the page is reloaded and
   a batch is in progress

Change-Id: I9be1ac5901a5c6a1b01719718eeda106aaf3045d
Reviewed-on: https://gerrit.instructure.com/11595
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-06-22 12:25:56 -06:00
Brian Palmer f8a9785535 process sis batches on a singleton strand
And process all pending batches in the job, don't require one job per
batch.

This way we don't pile up jobs for accounts that send frequent sis
updates.

There is also an optional setting to add a delay before the job starts,
so that we can process more batches per job invocation if they are being
sent frequently.

test plan: make sure that sis batches are still processed, including
batches that were queued before the code update. verify that no matter
how many batches are queued, only one job per strand will be in the
queue (sometimes 2, if one is already running and a second is added).

Change-Id: I4d551ef9fa45d9d332244ab29ca8d061fa5d7b9c
Reviewed-on: https://gerrit.instructure.com/11465
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-06-18 12:44:15 -06:00
Cody Cutrer 8beb4e0fd4 only perform batch sis removal for the types of data that were supplied
fixes #8310

test plan:
 * load some sis data for terms/courses/sections/enrollments into an
   account
 * do a batch mode import of an enrollments.csv with just the headers,
   no data
 * all enrollments should be deleted, but courses and sections should
   be left alone

Change-Id: I05beb577bfb4573e97f8b398aeb4bfff5df78a4f
Reviewed-on: https://gerrit.instructure.com/10265
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-05-08 09:46:49 -06:00
Cody Cutrer 03424c9626 use ids relative to the default shard for strands refs #6886
test plan:
 * run existing specs

Change-Id: I3b84b15be828975e1c60f976232e3984ccd95a61
Reviewed-on: https://gerrit.instructure.com/9670
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2012-04-02 09:47:09 -06:00
Cody Cutrer 7e97621462 store sis_batch_id as an integer, not a string
test plan:
 * run the migration
 * redo the migration
 * do a batch mode sis import

Change-Id: I0204256f3825ffe0b4d252bbb83a0604d7a58942
Reviewed-on: https://gerrit.instructure.com/7904
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Ben Chobot <bench@instructure.com>
2012-01-11 09:14:36 -07:00
Cody Cutrer 795b372024 don't add items to list if their scope is nil
also remove existing attachments that aren't in a folder from their list

test plan:
 * run specs
 * create sis batches - make sure their position is NULL
 * destroy their associated attachment, the query logs should not indicate
   an UPDATE attachments SET position = position - 1... being executed

Change-Id: I6117c2ade0ef5ec41a3ffeeb13096b9d8473f3f9
Reviewed-on: https://gerrit.instructure.com/7843
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-04 11:16:50 -07:00
Jacob Fugal 78807849f7 don't try and remove old batches without a term
test-plan:
 - import a course, a section, and an enrollment as a sis batch
 - import another sis batch that doesn't include the previous imported
   entities without specifying a term
 - none of the original course, section, and enrollment should be
   deleted

Change-Id: Ia03d4abf8c86d2ebd14987357ad073033ab28700
Reviewed-on: https://gerrit.instructure.com/7168
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-11-29 14:27:26 -07:00
JT Olds 9d4a4944b6 allow sis imports to make things sticky or clear stickiness altogether
* adds ui

Change-Id: Id8f3639457879d23125c0fb04ef5038d91826f21
Reviewed-on: https://gerrit.instructure.com/6050
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2011-10-13 10:54:58 -06:00
JT Olds 006cde7157 new generic-format importer classes
notable changes:
 * nothing is processed as a sis-import blocking error now. bad imports now
   result in warnings, while just skipping bad data
 * we no longer check for duplicates before going to the database

Change-Id: Iedc96b29d92caccdc6a71ae1de8100a1c82dd137
Reviewed-on: https://gerrit.instructure.com/5724
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-09-26 11:24:58 -06:00
Cody Cutrer 42d5269cd8 don't bother figuring out where in the nil folder list attachments go for sis imports
Change-Id: I2f93d1bcce4d523b4a2d389a03163fcaaf2ffaaf
Reviewed-on: https://gerrit.instructure.com/5363
Reviewed-by: JT Olds <jt@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-08-31 10:51:18 -06:00
Cody Cutrer 1df443cf0e show pending sis batch count on sis imports page
Change-Id: I9a7ac217a00ecf8f445e94438f89f2a0e0a3fa03
Reviewed-on: https://gerrit.instructure.com/5358
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-08-31 10:33:44 -06:00
Cody Cutrer dd3d986ee2 i18n sis_batch
Change-Id: I3727005f7abd2e81f40a655514e3c3ef6be3b5ef
Reviewed-on: https://gerrit.instructure.com/4309
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-06-22 09:26:38 -06:00
Brian Palmer d92c44f00c delete courses and enrollments in sub-accounts for batch mode sis imports
fixes #4789

Change-Id: If2ab0f07c16c6a6d8b33def3ef590e65145dde54
Reviewed-on: https://gerrit.instructure.com/4087
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-06-06 16:02:20 -06:00
Brian Palmer 7131821cac remove sis batch batch mode all-term mode
We decided this was extremely dangerous/error-prone and not that useful.

Change-Id: Ib0ff0c9d4ac8eeeb9d2088ed86be24991561a763
Reviewed-on: https://gerrit.instructure.com/3994
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-06-02 12:22:15 -06:00
Zach Wily 029c29d8c9 define accessible attrs for SisBatch, Story
Change-Id: Ia17b9aa6c159be611b9f0bda4377b5fd524093f6
Reviewed-on: https://gerrit.instructure.com/3876
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-26 08:44:12 -06:00
Cody Cutrer bdbebfaec8 check all models for protecting attributes refs #3847
Change-Id: I7cba6e26ad98e91723e2ccf0a28b8db79bb37b5c
Reviewed-on: https://gerrit.instructure.com/3631
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-25 17:38:50 -06:00
Brian Palmer 04d36dcdf5 support batch mode for sis imports, refs #4397
In this mode, any courses, sections or enrollments that aren't
referenced in the sis import will be deleted.

This is the back-end piece, support in the UI and API are coming next.

Change-Id: Ica634f9fa7008ef7b612c4ea43163792f5d54fa5
Reviewed-on: https://gerrit.instructure.com/3768
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-23 09:52:56 -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
Brian Palmer 65c8c32b4e process sis batches using account-specific strands, closes #4415
Change-Id: I69b41689aef047f5302955c27e94c76ece0236f4
Reviewed-on: https://gerrit.instructure.com/3688
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-05-19 13:01:24 -06:00
JT Olds 9b166d06f1 restricting the amount of data the sis batch api calls return
Change-Id: I886d565da973cf1d4a7f6aed26c172b57ad6cde4
Reviewed-on: https://gerrit.instructure.com/3501
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-05-05 16:36:45 -06:00
Brian Palmer b53c8cae29 Attachment#open method
Refactor to use it in places where it makes sense. This eliminates all
the places where were were calling File.read or otherwise reading into
memory potentially large files just to write them back out.

Change-Id: I679ce9979933140340b30cc043540ca3f834097e
Reviewed-on: https://gerrit.instructure.com/3324
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-05-05 08:09:25 -06:00
JT Olds 4cc32f8173 serialize sis batch processing
Change-Id: Ic611ca40a5ca4906de1133dfd3d61ef55fa132f7
Reviewed-on: https://gerrit.instructure.com/3439
Reviewed-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-03 11:47:06 -06:00
JT Olds 40cff6f0d5 sis import api
Change-Id: Ica7fa02758e5e7ad32c878951aff8b115685ac82
Reviewed-on: https://gerrit.instructure.com/2960
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-04-08 15:45:57 -06:00
Jon Jensen f745f40073 Merge branch 'master' into dev/postgres
Conflicts:
	app/models/user.rb
	config/initializers/active_record.rb

Change-Id: Idc3b52dad873146efbb9268ecac28cac840f115e
2011-03-22 16:23:04 -06:00
Jon Jensen 4ea607cea4 postgres support and misc bugfixes, fixes #3574, #3943
Change-Id: I16aa188175a588b02dd6460baa83daae805aec9f
Reviewed-on: https://gerrit.instructure.com/2474
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-03-11 18:01:02 -07:00
JT Olds 34263ed8de making download public
Change-Id: I88a7d076faf306c935f71153908f6de29f6770da
Reviewed-on: https://gerrit.instructure.com/2436
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-02-24 17:20:45 -07:00
JT Olds 96e746c31e making other import types supported via plugins
Change-Id: I689c374060fbfcc89eb79b918ea2db283c6eb99c
Reviewed-on: https://gerrit.instructure.com/2425
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-02-24 15:15:53 -07:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00