[ARVADOS] updated: 2.1.0-444-gc869babec

Git user git at public.arvados.org
Mon Mar 8 22:03:37 UTC 2021


Summary of changes:
 lib/controller/router/response.go | 60 +++++++++++++++++----------------------
 1 file changed, 26 insertions(+), 34 deletions(-)

  discards  9d1bd437bdfff9351958b4665b362c19ab2fa0a6 (commit)
       via  c869babecb193f02a24f071b8fd101e16aeec680 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (9d1bd437bdfff9351958b4665b362c19ab2fa0a6)
            \
             N -- N -- N (c869babecb193f02a24f071b8fd101e16aeec680)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit c869babecb193f02a24f071b8fd101e16aeec680
Author: Ward Vandewege <ward at curii.com>
Date:   Mon Mar 8 17:03:29 2021 -0500

    17119: implement review feedback.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go
index 09540a5f4..a9352098d 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -423,8 +423,7 @@ func (conn *Conn) GroupContents(ctx context.Context, options arvados.GroupConten
 }
 
 func (conn *Conn) GroupShared(ctx context.Context, options arvados.ListOptions) (arvados.GroupList, error) {
-	// FIXME is this right?? We don't have options.UUID to cue the chooseBackend off
-	return conn.chooseBackend(conn.cluster.ClusterID).GroupShared(ctx, options)
+	return conn.chooseBackend(options.ClusterID).GroupShared(ctx, options)
 }
 
 func (conn *Conn) GroupDelete(ctx context.Context, options arvados.DeleteOptions) (arvados.Group, error) {
diff --git a/lib/controller/router/response.go b/lib/controller/router/response.go
index aee2fc590..e1fc2691a 100644
--- a/lib/controller/router/response.go
+++ b/lib/controller/router/response.go
@@ -82,38 +82,34 @@ func (rtr *router) sendResponse(w http.ResponseWriter, req *http.Request, resp i
 		defaultItemKind = strings.TrimSuffix(respKind, "List")
 	}
 
-	var items, included []interface{}
-	var itemsOK, includedOK bool
-	items, itemsOK = tmp["items"].([]interface{})
-	included, includedOK = tmp["included"].([]interface{})
-	if includedOK && len(included) > 0 {
-		items = append(items, included...)
-	}
-
-	if itemsOK {
-		for i, item := range items {
-			// Fill in "kind" by inspecting UUID/PDH if
-			// possible; fall back on assuming each
-			// Items[] entry in an "arvados#fooList"
-			// response should have kind="arvados#foo".
-			item, _ := item.(map[string]interface{})
-			infix := ""
-			if uuid, _ := item["uuid"].(string); len(uuid) == 27 {
-				infix = uuid[6:11]
+	if _, isListResponse := tmp["items"].([]interface{}); isListResponse {
+		items, _ := tmp["items"].([]interface{})
+		included, _ := tmp["included"].([]interface{})
+		for _, slice := range [][]interface{}{items, included} {
+			for i, item := range slice {
+				// Fill in "kind" by inspecting UUID/PDH if
+				// possible; fall back on assuming each
+				// Items[] entry in an "arvados#fooList"
+				// response should have kind="arvados#foo".
+				item, _ := item.(map[string]interface{})
+				infix := ""
+				if uuid, _ := item["uuid"].(string); len(uuid) == 27 {
+					infix = uuid[6:11]
+				}
+				if k := kind(infixMap[infix]); k != "" {
+					item["kind"] = k
+				} else if pdh, _ := item["portable_data_hash"].(string); pdh != "" {
+					item["kind"] = "arvados#collection"
+				} else if defaultItemKind != "" {
+					item["kind"] = defaultItemKind
+				}
+				item = applySelectParam(opts.Select, item)
+				rtr.mungeItemFields(item)
+				slice[i] = item
 			}
-			if k := kind(infixMap[infix]); k != "" {
-				item["kind"] = k
-			} else if pdh, _ := item["portable_data_hash"].(string); pdh != "" {
-				item["kind"] = "arvados#collection"
-			} else if defaultItemKind != "" {
-				item["kind"] = defaultItemKind
+			if opts.Count == "none" {
+				delete(tmp, "items_available")
 			}
-			item = applySelectParam(opts.Select, item)
-			rtr.mungeItemFields(item)
-			items[i] = item
-		}
-		if opts.Count == "none" {
-			delete(tmp, "items_available")
 		}
 	} else {
 		tmp = applySelectParam(opts.Select, tmp)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list