Merge branch 'master' into 3782-large-job-logs
authorTim Pierce <twp@curoverse.com>
Wed, 1 Oct 2014 19:43:15 +0000 (15:43 -0400)
committerTim Pierce <twp@curoverse.com>
Wed, 1 Oct 2014 19:43:15 +0000 (15:43 -0400)
Conflicts:
services/api/test/fixtures/collections.yml
services/api/test/fixtures/jobs.yml

1  2 
apps/workbench/app/controllers/collections_controller.rb
apps/workbench/config/application.default.yml
services/api/test/fixtures/collections.yml
services/api/test/fixtures/jobs.yml

index cc0b3fff5be7cca8503fb25a5ed520afba08f837,9882fa6a34a38f97e6615804038d107290604e4a..3606ef0c8a8898fa798f8e09d2dd57cb21273dc6
@@@ -164,15 -154,15 +166,21 @@@ class CollectionsController < Applicati
      ext = File.extname(params[:file])
      self.response.headers['Content-Type'] =
        Rack::Mime::MIME_TYPES[ext] || 'application/octet-stream'
 -    self.response.headers['Content-Length'] = params[:size] if params[:size]
 +    if params[:size]
 +      size = params[:size].to_i
 +      if opts[:maxbytes]
 +        size = [size, opts[:maxbytes].to_i].min
 +      end
 +      self.response.headers['Content-Length'] = size.to_s
 +    end
      self.response.headers['Content-Disposition'] = params[:disposition] if params[:disposition]
-     self.response_body = file_enumerator opts
+     begin
+       file_enumerator(opts).each do |bytes|
+         response.stream.write bytes
+       end
+     ensure
+       response.stream.close
+     end
    end
  
    def sharing_scopes
index ba95b343233fc1aa5281ddefc2d890ca7a5a16e5,817fd5c3d0e4bf0552d16f55e89ded63054855d8..d7b2d16f15f1d961072196b55c10f34d141db2c7
@@@ -200,16 -212,26 +212,40 @@@ collection_expires_in_future
    manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:expired\n"
    name: collection_expires_in_future
  
 +# a collection with a log file that can be parsed by the log viewer
 +# This collection hash matches the following log text:
 +#    2014-01-01_12:00:01 zzzzz-8i9sb-abcdefghijklmno 0  log message 1
 +#    2014-01-01_12:00:02 zzzzz-8i9sb-abcdefghijklmno 0  log message 2
 +#    2014-01-01_12:00:03 zzzzz-8i9sb-abcdefghijklmno 0  log message 3
 +#
 +real_log_collection:
 +  uuid: zzzzz-4zz18-op4e2lbej01tcvu
 +  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
 +  created_at: 2014-09-01 12:00:00
 +  portable_data_hash: 3399cbb0953a7823618f3e288a85ee26+81
 +  manifest_text: ". b9f7e25b33844d816d8531686f8bf360+195 0:195:zzzzz-8i9sb-abcdefghijklmno.log.txt\n"
 +  name: real_log_collection
++
+ collection_in_home_project_with_same_name_as_in_aproject:
+   uuid: zzzzz-4zz18-12342x4u7ftabcd
+   portable_data_hash: ea10d51bcf88862dbcc36eb292017dfd+45
+   owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+   created_at: 2014-02-03T17:22:54Z
+   modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+   modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
+   modified_at: 2014-02-03T17:22:54Z
+   updated_at: 2014-02-03T17:22:54Z
+   manifest_text: ". 73feffa4b7f6bb68e44cf984c85f6e88+3 0:3:baz\n"
+   name: collection_with_same_name_in_aproject_and_home_project
+ collection_in_aproject_with_same_name_as_in_home_project:
+   uuid: zzzzz-4zz18-56782x4u7ftefgh
+   portable_data_hash: ea10d51bcf88862dbcc36eb292017dfd+45
+   owner_uuid: zzzzz-j7d0g-v955i6s2oi1cbso
+   created_at: 2014-02-03T17:22:54Z
+   modified_by_client_uuid: zzzzz-ozdt8-brczlopd8u8d0jr
+   modified_by_user_uuid: zzzzz-tpzed-d9tiejq69daie8f
+   modified_at: 2014-02-03T17:22:54Z
+   updated_at: 2014-02-03T17:22:54Z
+   manifest_text: ". 73feffa4b7f6bb68e44cf984c85f6e88+3 0:3:baz\n"
+   name: collection_with_same_name_in_aproject_and_home_project
index 7c375bceb0c2bd54fedeb4430d37db2a649024ab,b84922d28e9a847e8ccf1a9816d83949a5dc7a97..b46cd062859bb72a6227dab627f71eaaca59be42
@@@ -212,11 -222,4 +222,12 @@@ queued
    is_locked_by_uuid: ~
    tasks_summary: {}
    runtime_constraints: {}
+   state: Queued
 +
 +# A job with a log collection that can be parsed by the log viewer.
 +job_with_real_log:
 +  uuid: zzzzz-8i9sb-0vsrcqi7whchuil
 +  created_at: 2014-09-01 12:00:00
 +  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
 +  log: 3399cbb0953a7823618f3e288a85ee26+81
 +  script_version: 7def43a4d3f20789dda4700f703b5514cc3ed250