18691: Return null for empty frozen_by_uuid in controller response.
authorTom Clegg <tom@curii.com>
Fri, 4 Mar 2022 17:45:44 +0000 (12:45 -0500)
committerTom Clegg <tom@curii.com>
Fri, 4 Mar 2022 17:45:44 +0000 (12:45 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

doc/api/methods/groups.html.textile.liquid
lib/controller/handler_test.go
lib/controller/router/response.go

index 6f5b4bbb8ec48bae7d715c2a7274565f21217b1b..cf4c346fa94f10b1a7785ea9adef4322c627ada6 100644 (file)
@@ -34,7 +34,7 @@ table(table table-bordered table-condensed).
 |trash_at|datetime|If @trash_at@ is non-null and in the past, this group and all objects directly or indirectly owned by the group will be hidden from API calls.  May be untrashed.||
 |delete_at|datetime|If @delete_at@ is non-null and in the past, the group and all objects directly or indirectly owned by the group may be permanently deleted.||
 |is_trashed|datetime|True if @trash_at@ is in the past, false if not.||
-|frozen_by_uuid|string|For a frozen project, indicates the user who froze the project. Empty in all other cases. When a project is frozen, no further changes can be made to the project or its contents.||
+|frozen_by_uuid|string|For a frozen project, indicates the user who froze the project; null in all other cases. When a project is frozen, no further changes can be made to the project or its contents.||
 
 h3. Frozen projects
 
index 723e1011f9de62ac871566ec21c4488d1f55b360..817cff79609dab91b7743f2869950974c8796082 100644 (file)
@@ -367,16 +367,14 @@ func (s *HandlerSuite) CheckObjectType(c *check.C, url string, token string, ski
        for k := range direct {
                if _, ok := skippedFields[k]; ok {
                        continue
-               } else if val, ok := proxied[k]; ok {
-                       if direct["kind"] == "arvados#collection" && k == "manifest_text" {
-                               // Tokens differ from request to request
-                               c.Check(strings.Split(val.(string), "+A")[0], check.Equals, strings.Split(direct[k].(string), "+A")[0])
-                       } else {
-                               c.Check(val, check.DeepEquals, direct[k],
-                                       check.Commentf("RailsAPI %s key %q's value %q differs from controller's %q.", direct["kind"], k, direct[k], val))
-                       }
-               } else {
+               } else if val, ok := proxied[k]; !ok {
                        c.Errorf("%s's key %q missing on controller's response.", direct["kind"], k)
+               } else if direct["kind"] == "arvados#collection" && k == "manifest_text" {
+                       // Tokens differ from request to request
+                       c.Check(strings.Split(val.(string), "+A")[0], check.Equals, strings.Split(direct[k].(string), "+A")[0])
+               } else {
+                       c.Check(val, check.DeepEquals, direct[k],
+                               check.Commentf("RailsAPI %s key %q's value %q differs from controller's %q.", direct["kind"], k, direct[k], val))
                }
        }
 }
index c0c599be8bcd4f1acb6fbbc5ed90e6541cf08dfe..42b34355935db015e72d7de3e8b7a6398ffc0680 100644 (file)
@@ -208,7 +208,7 @@ func (rtr *router) mungeItemFields(tmp map[string]interface{}) {
                // they appear in responses as null, rather than a
                // zero value.
                switch k {
-               case "output_uuid", "output_name", "log_uuid", "description", "requesting_container_uuid", "container_uuid":
+               case "output_uuid", "output_name", "log_uuid", "description", "requesting_container_uuid", "container_uuid", "modified_by_client_uuid", "frozen_by_uuid":
                        if v == "" {
                                tmp[k] = nil
                        }