15422: Restored collection provenance for jobs
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Tue, 16 Jul 2019 17:51:09 +0000 (13:51 -0400)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Tue, 16 Jul 2019 17:51:09 +0000 (13:51 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

doc/api/methods/collections.html.textile.liquid
services/api/app/controllers/arvados/v1/collections_controller.rb

index a62600e34d5651166251dea3952039ff572e28fb..fdfd90a6c1b7f24c35982668b878d103994f683f 100644 (file)
@@ -132,8 +132,8 @@ Returns a list of objects in the database that directly or indirectly contribute
 
 The general algorithm is:
 
-# Visit the container request that produced this collection (via "output_uuid" or "log_uuid")
-# Visit the input collections to that container request (via "mounts", or "container_image")
+# Visit the container request that produced this collection (via "output_uuid" or "log_uuid" attributes of the container request)
+# Visit the input collections to that container request (via "mounts" and "container_image" of the container request)
 # Iterate until there are no more objects to visit
 
 Arguments:
@@ -148,8 +148,8 @@ Returns a list of objects in the database this collection directly or indirectly
 
 The general algorithm is:
 
-# Visit containers that take this collection as input (via "mounts", or "container_image")
-# Visit collections produced by those containers (via "output" or "log")
+# Visit containers that take this collection as input (via "mounts" or "container_image" of the container)
+# Visit collections produced by those containers (via "output" or "log" of the container)
 # Iterate until there are no more objects to visit
 
 Arguments:
index 99e635b20a3bd5fe6dcffa8ce03c278c668bc65e..a8ef4b91b4b018f863c0a156e784e05622995893 100644 (file)
@@ -245,6 +245,16 @@ class Arvados::V1::CollectionsController < ApplicationController
           if direction == :search_up
             visited[c.uuid] = c.as_api_response
 
+            if !Rails.configuration.API.DisabledAPIs.include?("jobs.list")
+              Job.readable_by(*@read_users).where(output: c.portable_data_hash).each do |job|
+                search_edges(visited, job.uuid, :search_up)
+              end
+
+              Job.readable_by(*@read_users).where(log: c.portable_data_hash).each do |job|
+                search_edges(visited, job.uuid, :search_up)
+              end
+            end
+
             ContainerRequest.readable_by(*@read_users).where(output_uuid: uuid).each do |cr|
               search_edges(visited, cr.uuid, :search_up)
             end