[ARVADOS] updated: 2.1.0-96-g03b1e0f42

Git user git at public.arvados.org
Mon Nov 16 19:11:05 UTC 2020


Summary of changes:
 lib/service/cmd_test.go                            |  9 ++-
 sdk/go/arvados/client.go                           |  1 +
 sdk/go/arvadostest/api.go                          | 80 +++++++++++-----------
 sdk/go/keepclient/keepclient.go                    | 14 ++--
 sdk/go/keepclient/root_sorter_test.go              | 14 ++--
 .../controllers/arvados/v1/groups_controller.rb    |  2 +-
 .../arvados/v1/groups_controller_test.rb           |  6 +-
 7 files changed, 67 insertions(+), 59 deletions(-)

       via  03b1e0f42a6eb83dc5ce1b6ec7fd8ec35f6a8fd1 (commit)
       via  12b672b852cb7619de0edf3de3fa96093d0dad19 (commit)
       via  988f00cbac42af1023a7b87bd79f78086e33e51f (commit)
      from  9e312753855286a7e21c83218bb48589f4d1535d (commit)

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 03b1e0f42a6eb83dc5ce1b6ec7fd8ec35f6a8fd1
Author: Ward Vandewege <ward at curii.com>
Date:   Sun Nov 15 14:18:40 2020 -0500

    Fix more golint warnings.
    
    No issue #
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/lib/service/cmd_test.go b/lib/service/cmd_test.go
index 4a984c9e7..10591d9b5 100644
--- a/lib/service/cmd_test.go
+++ b/lib/service/cmd_test.go
@@ -29,6 +29,11 @@ func Test(t *testing.T) {
 var _ = check.Suite(&Suite{})
 
 type Suite struct{}
+type key int
+
+const (
+	contextKey key = iota
+)
 
 func (*Suite) TestCommand(c *check.C) {
 	cf, err := ioutil.TempFile("", "cmd_test.")
@@ -42,11 +47,11 @@ func (*Suite) TestCommand(c *check.C) {
 	defer cancel()
 
 	cmd := Command(arvados.ServiceNameController, func(ctx context.Context, _ *arvados.Cluster, token string, reg *prometheus.Registry) Handler {
-		c.Check(ctx.Value("foo"), check.Equals, "bar")
+		c.Check(ctx.Value(contextKey), check.Equals, "bar")
 		c.Check(token, check.Equals, "abcde")
 		return &testHandler{ctx: ctx, healthCheck: healthCheck}
 	})
-	cmd.(*command).ctx = context.WithValue(ctx, "foo", "bar")
+	cmd.(*command).ctx = context.WithValue(ctx, contextKey, "bar")
 
 	done := make(chan bool)
 	var stdin, stdout, stderr bytes.Buffer
diff --git a/sdk/go/arvados/client.go b/sdk/go/arvados/client.go
index 5c6a7b52f..52c75d511 100644
--- a/sdk/go/arvados/client.go
+++ b/sdk/go/arvados/client.go
@@ -306,6 +306,7 @@ func (c *Client) RequestAndDecode(dst interface{}, method, path string, body io.
 	return c.RequestAndDecodeContext(context.Background(), dst, method, path, body, params)
 }
 
+// RequestAndDecodeContext does the same as RequestAndDecode, but with a context
 func (c *Client) RequestAndDecodeContext(ctx context.Context, dst interface{}, method, path string, body io.Reader, params interface{}) error {
 	if body, ok := body.(io.Closer); ok {
 		// Ensure body is closed even if we error out early
diff --git a/sdk/go/arvadostest/api.go b/sdk/go/arvadostest/api.go
index ce0a913b5..fe600257f 100644
--- a/sdk/go/arvadostest/api.go
+++ b/sdk/go/arvadostest/api.go
@@ -30,79 +30,79 @@ func (as *APIStub) BaseURL() url.URL {
 	return url.URL{Scheme: "https", Host: "apistub.example.com"}
 }
 func (as *APIStub) ConfigGet(ctx context.Context) (json.RawMessage, error) {
-	as.appendCall(as.ConfigGet, ctx, nil)
+	as.appendCall(ctx, as.ConfigGet, nil)
 	return nil, as.Error
 }
 func (as *APIStub) Login(ctx context.Context, options arvados.LoginOptions) (arvados.LoginResponse, error) {
-	as.appendCall(as.Login, ctx, options)
+	as.appendCall(ctx, as.Login, options)
 	return arvados.LoginResponse{}, as.Error
 }
 func (as *APIStub) Logout(ctx context.Context, options arvados.LogoutOptions) (arvados.LogoutResponse, error) {
-	as.appendCall(as.Logout, ctx, options)
+	as.appendCall(ctx, as.Logout, options)
 	return arvados.LogoutResponse{}, as.Error
 }
 func (as *APIStub) CollectionCreate(ctx context.Context, options arvados.CreateOptions) (arvados.Collection, error) {
-	as.appendCall(as.CollectionCreate, ctx, options)
+	as.appendCall(ctx, as.CollectionCreate, options)
 	return arvados.Collection{}, as.Error
 }
 func (as *APIStub) CollectionUpdate(ctx context.Context, options arvados.UpdateOptions) (arvados.Collection, error) {
-	as.appendCall(as.CollectionUpdate, ctx, options)
+	as.appendCall(ctx, as.CollectionUpdate, options)
 	return arvados.Collection{}, as.Error
 }
 func (as *APIStub) CollectionGet(ctx context.Context, options arvados.GetOptions) (arvados.Collection, error) {
-	as.appendCall(as.CollectionGet, ctx, options)
+	as.appendCall(ctx, as.CollectionGet, options)
 	return arvados.Collection{}, as.Error
 }
 func (as *APIStub) CollectionList(ctx context.Context, options arvados.ListOptions) (arvados.CollectionList, error) {
-	as.appendCall(as.CollectionList, ctx, options)
+	as.appendCall(ctx, as.CollectionList, options)
 	return arvados.CollectionList{}, as.Error
 }
 func (as *APIStub) CollectionProvenance(ctx context.Context, options arvados.GetOptions) (map[string]interface{}, error) {
-	as.appendCall(as.CollectionProvenance, ctx, options)
+	as.appendCall(ctx, as.CollectionProvenance, options)
 	return nil, as.Error
 }
 func (as *APIStub) CollectionUsedBy(ctx context.Context, options arvados.GetOptions) (map[string]interface{}, error) {
-	as.appendCall(as.CollectionUsedBy, ctx, options)
+	as.appendCall(ctx, as.CollectionUsedBy, options)
 	return nil, as.Error
 }
 func (as *APIStub) CollectionDelete(ctx context.Context, options arvados.DeleteOptions) (arvados.Collection, error) {
-	as.appendCall(as.CollectionDelete, ctx, options)
+	as.appendCall(ctx, as.CollectionDelete, options)
 	return arvados.Collection{}, as.Error
 }
 func (as *APIStub) CollectionTrash(ctx context.Context, options arvados.DeleteOptions) (arvados.Collection, error) {
-	as.appendCall(as.CollectionTrash, ctx, options)
+	as.appendCall(ctx, as.CollectionTrash, options)
 	return arvados.Collection{}, as.Error
 }
 func (as *APIStub) CollectionUntrash(ctx context.Context, options arvados.UntrashOptions) (arvados.Collection, error) {
-	as.appendCall(as.CollectionUntrash, ctx, options)
+	as.appendCall(ctx, as.CollectionUntrash, options)
 	return arvados.Collection{}, as.Error
 }
 func (as *APIStub) ContainerCreate(ctx context.Context, options arvados.CreateOptions) (arvados.Container, error) {
-	as.appendCall(as.ContainerCreate, ctx, options)
+	as.appendCall(ctx, as.ContainerCreate, options)
 	return arvados.Container{}, as.Error
 }
 func (as *APIStub) ContainerUpdate(ctx context.Context, options arvados.UpdateOptions) (arvados.Container, error) {
-	as.appendCall(as.ContainerUpdate, ctx, options)
+	as.appendCall(ctx, as.ContainerUpdate, options)
 	return arvados.Container{}, as.Error
 }
 func (as *APIStub) ContainerGet(ctx context.Context, options arvados.GetOptions) (arvados.Container, error) {
-	as.appendCall(as.ContainerGet, ctx, options)
+	as.appendCall(ctx, as.ContainerGet, options)
 	return arvados.Container{}, as.Error
 }
 func (as *APIStub) ContainerList(ctx context.Context, options arvados.ListOptions) (arvados.ContainerList, error) {
-	as.appendCall(as.ContainerList, ctx, options)
+	as.appendCall(ctx, as.ContainerList, options)
 	return arvados.ContainerList{}, as.Error
 }
 func (as *APIStub) ContainerDelete(ctx context.Context, options arvados.DeleteOptions) (arvados.Container, error) {
-	as.appendCall(as.ContainerDelete, ctx, options)
+	as.appendCall(ctx, as.ContainerDelete, options)
 	return arvados.Container{}, as.Error
 }
 func (as *APIStub) ContainerLock(ctx context.Context, options arvados.GetOptions) (arvados.Container, error) {
-	as.appendCall(as.ContainerLock, ctx, options)
+	as.appendCall(ctx, as.ContainerLock, options)
 	return arvados.Container{}, as.Error
 }
 func (as *APIStub) ContainerUnlock(ctx context.Context, options arvados.GetOptions) (arvados.Container, error) {
-	as.appendCall(as.ContainerUnlock, ctx, options)
+	as.appendCall(ctx, as.ContainerUnlock, options)
 	return arvados.Container{}, as.Error
 }
 func (as *APIStub) ContainerRequestCreate(ctx context.Context, options arvados.CreateOptions) (arvados.ContainerRequest, error) {
@@ -126,87 +126,87 @@ func (as *APIStub) ContainerRequestDelete(ctx context.Context, options arvados.D
 	return arvados.ContainerRequest{}, as.Error
 }
 func (as *APIStub) SpecimenCreate(ctx context.Context, options arvados.CreateOptions) (arvados.Specimen, error) {
-	as.appendCall(as.SpecimenCreate, ctx, options)
+	as.appendCall(ctx, as.SpecimenCreate, options)
 	return arvados.Specimen{}, as.Error
 }
 func (as *APIStub) SpecimenUpdate(ctx context.Context, options arvados.UpdateOptions) (arvados.Specimen, error) {
-	as.appendCall(as.SpecimenUpdate, ctx, options)
+	as.appendCall(ctx, as.SpecimenUpdate, options)
 	return arvados.Specimen{}, as.Error
 }
 func (as *APIStub) SpecimenGet(ctx context.Context, options arvados.GetOptions) (arvados.Specimen, error) {
-	as.appendCall(as.SpecimenGet, ctx, options)
+	as.appendCall(ctx, as.SpecimenGet, options)
 	return arvados.Specimen{}, as.Error
 }
 func (as *APIStub) SpecimenList(ctx context.Context, options arvados.ListOptions) (arvados.SpecimenList, error) {
-	as.appendCall(as.SpecimenList, ctx, options)
+	as.appendCall(ctx, as.SpecimenList, options)
 	return arvados.SpecimenList{}, as.Error
 }
 func (as *APIStub) SpecimenDelete(ctx context.Context, options arvados.DeleteOptions) (arvados.Specimen, error) {
-	as.appendCall(as.SpecimenDelete, ctx, options)
+	as.appendCall(ctx, as.SpecimenDelete, options)
 	return arvados.Specimen{}, as.Error
 }
 func (as *APIStub) UserCreate(ctx context.Context, options arvados.CreateOptions) (arvados.User, error) {
-	as.appendCall(as.UserCreate, ctx, options)
+	as.appendCall(ctx, as.UserCreate, options)
 	return arvados.User{}, as.Error
 }
 func (as *APIStub) UserUpdate(ctx context.Context, options arvados.UpdateOptions) (arvados.User, error) {
-	as.appendCall(as.UserUpdate, ctx, options)
+	as.appendCall(ctx, as.UserUpdate, options)
 	return arvados.User{}, as.Error
 }
 func (as *APIStub) UserUpdateUUID(ctx context.Context, options arvados.UpdateUUIDOptions) (arvados.User, error) {
-	as.appendCall(as.UserUpdateUUID, ctx, options)
+	as.appendCall(ctx, as.UserUpdateUUID, options)
 	return arvados.User{}, as.Error
 }
 func (as *APIStub) UserActivate(ctx context.Context, options arvados.UserActivateOptions) (arvados.User, error) {
-	as.appendCall(as.UserActivate, ctx, options)
+	as.appendCall(ctx, as.UserActivate, options)
 	return arvados.User{}, as.Error
 }
 func (as *APIStub) UserSetup(ctx context.Context, options arvados.UserSetupOptions) (map[string]interface{}, error) {
-	as.appendCall(as.UserSetup, ctx, options)
+	as.appendCall(ctx, as.UserSetup, options)
 	return nil, as.Error
 }
 func (as *APIStub) UserUnsetup(ctx context.Context, options arvados.GetOptions) (arvados.User, error) {
-	as.appendCall(as.UserUnsetup, ctx, options)
+	as.appendCall(ctx, as.UserUnsetup, options)
 	return arvados.User{}, as.Error
 }
 func (as *APIStub) UserGet(ctx context.Context, options arvados.GetOptions) (arvados.User, error) {
-	as.appendCall(as.UserGet, ctx, options)
+	as.appendCall(ctx, as.UserGet, options)
 	return arvados.User{}, as.Error
 }
 func (as *APIStub) UserGetCurrent(ctx context.Context, options arvados.GetOptions) (arvados.User, error) {
-	as.appendCall(as.UserGetCurrent, ctx, options)
+	as.appendCall(ctx, as.UserGetCurrent, options)
 	return arvados.User{}, as.Error
 }
 func (as *APIStub) UserGetSystem(ctx context.Context, options arvados.GetOptions) (arvados.User, error) {
-	as.appendCall(as.UserGetSystem, ctx, options)
+	as.appendCall(ctx, as.UserGetSystem, options)
 	return arvados.User{}, as.Error
 }
 func (as *APIStub) UserList(ctx context.Context, options arvados.ListOptions) (arvados.UserList, error) {
-	as.appendCall(as.UserList, ctx, options)
+	as.appendCall(ctx, as.UserList, options)
 	return arvados.UserList{}, as.Error
 }
 func (as *APIStub) UserDelete(ctx context.Context, options arvados.DeleteOptions) (arvados.User, error) {
-	as.appendCall(as.UserDelete, ctx, options)
+	as.appendCall(ctx, as.UserDelete, options)
 	return arvados.User{}, as.Error
 }
 func (as *APIStub) UserMerge(ctx context.Context, options arvados.UserMergeOptions) (arvados.User, error) {
-	as.appendCall(as.UserMerge, ctx, options)
+	as.appendCall(ctx, as.UserMerge, options)
 	return arvados.User{}, as.Error
 }
 func (as *APIStub) UserBatchUpdate(ctx context.Context, options arvados.UserBatchUpdateOptions) (arvados.UserList, error) {
-	as.appendCall(as.UserBatchUpdate, ctx, options)
+	as.appendCall(ctx, as.UserBatchUpdate, options)
 	return arvados.UserList{}, as.Error
 }
 func (as *APIStub) UserAuthenticate(ctx context.Context, options arvados.UserAuthenticateOptions) (arvados.APIClientAuthorization, error) {
-	as.appendCall(as.UserAuthenticate, ctx, options)
+	as.appendCall(ctx, as.UserAuthenticate, options)
 	return arvados.APIClientAuthorization{}, as.Error
 }
 func (as *APIStub) APIClientAuthorizationCurrent(ctx context.Context, options arvados.GetOptions) (arvados.APIClientAuthorization, error) {
-	as.appendCall(as.APIClientAuthorizationCurrent, ctx, options)
+	as.appendCall(ctx, as.APIClientAuthorizationCurrent, options)
 	return arvados.APIClientAuthorization{}, as.Error
 }
 
-func (as *APIStub) appendCall(method interface{}, ctx context.Context, options interface{}) {
+func (as *APIStub) appendCall(ctx context.Context, method interface{}, options interface{}) {
 	as.mtx.Lock()
 	defer as.mtx.Unlock()
 	as.calls = append(as.calls, APIStubCall{method, ctx, options})

commit 12b672b852cb7619de0edf3de3fa96093d0dad19
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Fri Nov 13 15:44:43 2020 -0500

    17111: Deselect unsigned_manifest_text by default in groups#contents.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb
index 812929d50..394b5603b 100644
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@ -271,7 +271,7 @@ class Arvados::V1::GroupsController < ApplicationController
       @select = nil
       where_conds = filter_by_owner
       if klass == Collection
-        @select = klass.selectable_attributes - ["manifest_text"]
+        @select = klass.selectable_attributes - ["manifest_text", "unsigned_manifest_text"]
       elsif klass == Group
         where_conds = where_conds.merge(group_class: "project")
       end
diff --git a/services/api/test/functional/arvados/v1/groups_controller_test.rb b/services/api/test/functional/arvados/v1/groups_controller_test.rb
index 76d8cb973..02a4ce966 100644
--- a/services/api/test/functional/arvados/v1/groups_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/groups_controller_test.rb
@@ -349,7 +349,7 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
     end
   end
 
-  test "Collection contents don't include manifest_text" do
+  test "Collection contents don't include manifest_text or unsigned_manifest_text" do
     authorize_with :active
     get :contents, params: {
       id: groups(:aproject).uuid,
@@ -360,7 +360,9 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
     refute(json_response["items"].any? { |c| not c["portable_data_hash"] },
            "response included an item without a portable data hash")
     refute(json_response["items"].any? { |c| c.include?("manifest_text") },
-           "response included an item with a manifest text")
+           "response included an item with manifest_text")
+    refute(json_response["items"].any? { |c| c.include?("unsigned_manifest_text") },
+           "response included an item with unsigned_manifest_text")
   end
 
   test 'get writable_by list for owned group' do

commit 988f00cbac42af1023a7b87bd79f78086e33e51f
Author: Ward Vandewege <ward at curii.com>
Date:   Thu Nov 12 20:02:56 2020 -0500

    Fix more golint warnings.
    
    No issue #
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/sdk/go/keepclient/keepclient.go b/sdk/go/keepclient/keepclient.go
index d600322e6..ec56e902c 100644
--- a/sdk/go/keepclient/keepclient.go
+++ b/sdk/go/keepclient/keepclient.go
@@ -90,7 +90,7 @@ type HTTPClient interface {
 	Do(*http.Request) (*http.Response, error)
 }
 
-// Information about Arvados and Keep servers.
+// KeepClient holds information about Arvados and Keep servers.
 type KeepClient struct {
 	Arvados            *arvadosclient.ArvadosClient
 	Want_replicas      int
@@ -333,7 +333,7 @@ func (kc *KeepClient) LocalLocator(locator string) (string, error) {
 	return loc, nil
 }
 
-// Get() retrieves a block, given a locator. Returns a reader, the
+// Get retrieves a block, given a locator. Returns a reader, the
 // expected data length, the URL the block is being fetched from, and
 // an error.
 //
@@ -345,13 +345,13 @@ func (kc *KeepClient) Get(locator string) (io.ReadCloser, int64, string, error)
 	return rdr, size, url, err
 }
 
-// ReadAt() retrieves a portion of block from the cache if it's
+// ReadAt retrieves a portion of block from the cache if it's
 // present, otherwise from the network.
 func (kc *KeepClient) ReadAt(locator string, p []byte, off int) (int, error) {
 	return kc.cache().ReadAt(kc, locator, p, off)
 }
 
-// Ask() verifies that a block with the given hash is available and
+// Ask verifies that a block with the given hash is available and
 // readable, according to at least one Keep service. Unlike Get, it
 // does not retrieve the data or verify that the data content matches
 // the hash specified by the locator.
@@ -416,7 +416,7 @@ func (kc *KeepClient) GetIndex(keepServiceUUID, prefix string) (io.Reader, error
 	return bytes.NewReader(respBody[0 : len(respBody)-1]), nil
 }
 
-// LocalRoots() returns the map of local (i.e., disk and proxy) Keep
+// LocalRoots returns the map of local (i.e., disk and proxy) Keep
 // services: uuid -> baseURI.
 func (kc *KeepClient) LocalRoots() map[string]string {
 	kc.discoverServices()
@@ -425,7 +425,7 @@ func (kc *KeepClient) LocalRoots() map[string]string {
 	return kc.localRoots
 }
 
-// GatewayRoots() returns the map of Keep remote gateway services:
+// GatewayRoots returns the map of Keep remote gateway services:
 // uuid -> baseURI.
 func (kc *KeepClient) GatewayRoots() map[string]string {
 	kc.discoverServices()
@@ -434,7 +434,7 @@ func (kc *KeepClient) GatewayRoots() map[string]string {
 	return kc.gatewayRoots
 }
 
-// WritableLocalRoots() returns the map of writable local Keep services:
+// WritableLocalRoots returns the map of writable local Keep services:
 // uuid -> baseURI.
 func (kc *KeepClient) WritableLocalRoots() map[string]string {
 	kc.discoverServices()
diff --git a/sdk/go/keepclient/root_sorter_test.go b/sdk/go/keepclient/root_sorter_test.go
index bd3bb0ba8..a6fbaeded 100644
--- a/sdk/go/keepclient/root_sorter_test.go
+++ b/sdk/go/keepclient/root_sorter_test.go
@@ -19,14 +19,14 @@ func FakeSvcRoot(i uint64) string {
 	return fmt.Sprintf("https://%x.svc/", i)
 }
 
-func FakeSvcUuid(i uint64) string {
+func FakeSvcUUID(i uint64) string {
 	return fmt.Sprintf("zzzzz-bi6l4-%015x", i)
 }
 
 func FakeServiceRoots(n uint64) map[string]string {
 	sr := map[string]string{}
 	for i := uint64(0); i < n; i++ {
-		sr[FakeSvcUuid(i)] = FakeSvcRoot(i)
+		sr[FakeSvcUUID(i)] = FakeSvcRoot(i)
 	}
 	return sr
 }
@@ -45,19 +45,19 @@ func (*RootSorterSuite) ReferenceSet(c *C) {
 	fakeroots := FakeServiceRoots(16)
 	// These reference probe orders are explained further in
 	// ../../python/tests/test_keep_client.py:
-	expected_orders := []string{
+	expectedOrders := []string{
 		"3eab2d5fc9681074",
 		"097dba52e648f1c3",
 		"c5b4e023f8a7d691",
 		"9d81c02e76a3bf54",
 	}
-	for h, expected_order := range expected_orders {
+	for h, expectedOrder := range expectedOrders {
 		hash := Md5String(fmt.Sprintf("%064x", h))
 		roots := NewRootSorter(fakeroots, hash).GetSortedRoots()
-		for i, svc_id_s := range strings.Split(expected_order, "") {
-			svc_id, err := strconv.ParseUint(svc_id_s, 16, 64)
+		for i, svcIDs := range strings.Split(expectedOrder, "") {
+			svcID, err := strconv.ParseUint(svcIDs, 16, 64)
 			c.Assert(err, Equals, nil)
-			c.Check(roots[i], Equals, FakeSvcRoot(svc_id))
+			c.Check(roots[i], Equals, FakeSvcRoot(svcID))
 		}
 	}
 }

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list