fixes LS-2897
flag=none
test plan:
- Have the INST-FS plugin ON
- Have a canvas export package with at least one file
- Import the export package into a fresh course
- Import the same export package again.
- Check that the file wasn't duplicated
- (You could, after the first import, alter the
attachment md5 column and put it's sha512 there,
then theorically you'd be testing this, but Ideally
you want instfs ON)
Change-Id: I0de79032d2ccd64e51cc09dea61b410aad43756f
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282779
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Luis Oliveira <luis.oliveira@instructure.com>
[skip-stages=Flakey]
auto-corrected, with review for non-single-argument-callers.
there weren't any, but I did disable it anyway for one file where
it seemed to make the DSL less legible (QtiItems)
Change-Id: I1b4c43ffd899e656902981baac213ca394791b67
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/278156
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Change-Id: I7f40ed058b50882121da69f0cb05966854b8e920
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/250924
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
test plan:
* have a blueprint course with a file
* sync to an associated course
* export the blueprint course
* import the export file directly
into the associated course
* the associated course should have two files
* make a page in the blueprint with a link
to the file
* syncing to the associated course should
create a page that still has a valid file link
* create a new course with a file
* copy the course into the blueprint
* sync the copied file to the associated course
* now copy the new course again into the
associated course
* the associated course should have two files
* create another page in the blueprint referencing
the copied file
* syncing to the associated course should
create a page that still has a valid file link
closes #LS-1496
Change-Id: I0549dd4b36c3235654b98f6cc825597b91878c2c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/248481
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
test plan:
* have instfs enabled
* import a zip file into a course
* the attachments should have instfs_uuids
closes #LS-1285
Change-Id: I42e877e25dfcbd855bfc9e56b59cf969ea7d6ce0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/244749
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
it was used for two things:
- file_fixture_upload, which now comes from
ActionDispatch::TestProcess::FixtureFile
- Rack::Test::UploadedFile which comes from the rack-test gem
Change-Id: I27957b410fcf4677dac77aed1b00b04dfd1b012e
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/222555
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
test plan:
* import the package attached to the ticket
* it should not fail
closes #CNVS-38855
Change-Id: I7e3cd1115107bf8028d15ee0b53fbee288198b43
Reviewed-on: https://gerrit.instructure.com/124455
Tested-by: Jenkins
Reviewed-by: Jon Willesen <jonw+gerrit@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
also fixes missing course image on re-import
test plan:
* create two courses with course images feature enabled
* add an image to one course
* export the course to a package
* import from the package into the other course twice
* the image should be imported correctly
closes #CNVS-37552
Change-Id: Iaf3dc169aad65ef4860e347cd8915e7bb3b40b81
Reviewed-on: https://gerrit.instructure.com/115762
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
don't let failed ones get added to fail on autosave
closes #CNVS-24093
Change-Id: I993d088388cfd6463d09db148ec498f7f6baad14
Reviewed-on: https://gerrit.instructure.com/65288
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
test plan:
0. enable "better file browsing" and "usage rights required"
in a course
1. upload and expand a zip file and confirm the files are
unpublished initially
2. confirm that a file imported from an imscc package is
(a) unpublished in the new course if no usage rights
were set in the source course, regardless of whether
the file was published in the source course
(b) unpublished in the new course if it was unpublished
in the source course, regardless of whether usage
rights were set in the source course
(c) published in the new course if it was published in
the source course and had usage rights set.
3. repeat step 2, but with course copy instead
fixes CNVS-19620
Change-Id: I9a32adeafb94e4922ba95ad6466c72aca3fd3598
Reviewed-on: https://gerrit.instructure.com/52465
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
CNVS-11519
this fixes an error introduced in
https://gerrit.instructure.com/#/c/28234/
test plan:
-try to upload a zipped directory containing lots
of files (for example, there is a dropbox link in
CNVS-11519 containing a file you can use
-while the upload is still in progress, try to upload
the same in a different course
-check that all files are uploaded, in each course
Change-Id: I373dfebe5dbc1f21e681d35e227037cb4a316676
Reviewed-on: https://gerrit.instructure.com/31933
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
in rails 3, ActionController::TestUploadedFile has
been moved to Rack::Test::UploadedFile. This commit
simply updates uses of TestUploadedFile to work
with this new structure
Change-Id: Ib31159c635f033a13908608dffeea88c8f719086
Reviewed-on: https://gerrit.instructure.com/28234
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
fixes#10583
see also #6233, the same bug, but non-zip case. this changeset
makes zip uploads go through the same Attachment#handle_duplicates
workflow (but keeps the ability to batch-delete overwritten files).
test plan:
* have a module with file items
* overwrite the files via zip upload
* make sure the module items don't disappear, and that they
refer to the new version of the file
Change-Id: Ib5f530021285da3303b64bbd8d4b5b2746206ef6
Reviewed-on: https://gerrit.instructure.com/13720
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Files weren't being replaced if they had a filename different
from their display_name.
The content_tags for modules are cleared before they are
imported so that only the items aren't duplicated.
Test Plan:
* Import a package twice
* The modules should be correct and not have 2 items for each item
* The files should also not be duplicated
closes#10405
Change-Id: I3cb15c2530734185675a2b8bb9017bdf6ac35202
Reviewed-on: https://gerrit.instructure.com/13695
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Temp files are automatically closed when they are garbage
collected, but waiting for that to happen can cause too
many files to be open at once.
Test Plan:
* Import a .zip or course import with lots of files
* They should all be imported
closes#8726
Change-Id: I72b5a445259a330e27eccc645df4957a92ea1381
Reviewed-on: https://gerrit.instructure.com/11582
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
FileInContext (used by the zip importer) was bypassing the filename= setter
for Attachment, so when using attachment_fu, sanitize_filename was not getting
called on the filename. This resulted in us generating S3 urls with characters
in them like filename[0].txt. That normally worked fine. However, Firefox
would escape those characters when redirected to a URL like that, which would
cause a signature mismatch with S3.
This commit stops bypassing the filename= setter so files uploaded as zip
files and in migrations have escaped filenames. Because of difficulties
testing S3 attachments, the included spec is weak.
This also includes a migration that will rename attachments with []" in their
filenames, and make a copy of the S3 object to match.
There is also an unrelated spec refactor around faking out a portion of the
code about S3.
test plan:
* Enable S3
* Create a ZIP file with a file in it with a name like test[0].bin
* Upload that ZIP file to your files are, choosing to unpack the ZIP contents
* Verify that you can download the extracted file using firefox
* Also verify that the attachment's filename is escaped in the db
Change-Id: I54fc0682b64a9e0021b4b41236f8cab168a0e56e
Reviewed-on: https://gerrit.instructure.com/8875
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>