[ARVADOS] created: 1.3.0-1988-g44f0586f6
Git user
git at public.arvados.org
Thu Dec 12 15:00:25 UTC 2019
at 44f0586f6d2feb1325e1b5f2014195506c03f48a (commit)
commit 44f0586f6d2feb1325e1b5f2014195506c03f48a
Author: Tom Clegg <tom at tomclegg.ca>
Date: Tue Dec 10 15:25:49 2019 -0500
15922: Update test to accommodate etag.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go
index a12ebc1fa..1b1ffef24 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -340,6 +340,7 @@ var userAttrsCachedFromLoginCluster = map[string]bool{
"prefs": true,
"username": true,
+ "etag": false,
"full_name": false,
"identity_url": false,
"is_invited": false,
commit 71e992d855a2e26a817b8863e4d0a39ed7955214
Author: Tom Clegg <tom at tomclegg.ca>
Date: Tue Dec 10 12:43:35 2019 -0500
15922: Fix propagation of user setup and merge requests.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/lib/controller/router/request.go b/lib/controller/router/request.go
index cc6379486..39b4c5100 100644
--- a/lib/controller/router/request.go
+++ b/lib/controller/router/request.go
@@ -163,10 +163,12 @@ var intParams = map[string]bool{
}
var boolParams = map[string]bool{
- "distinct": true,
- "ensure_unique_name": true,
- "include_trash": true,
- "include_old_versions": true,
+ "distinct": true,
+ "ensure_unique_name": true,
+ "include_trash": true,
+ "include_old_versions": true,
+ "redirect_to_new_user": true,
+ "send_notification_email": true,
}
func stringToBool(s string) bool {
diff --git a/sdk/go/arvados/api.go b/sdk/go/arvados/api.go
index 7d6ddb317..6e115a15f 100644
--- a/sdk/go/arvados/api.go
+++ b/sdk/go/arvados/api.go
@@ -49,7 +49,7 @@ var (
EndpointUserGetSystem = APIEndpoint{"GET", "arvados/v1/users/system", ""}
EndpointUserList = APIEndpoint{"GET", "arvados/v1/users", ""}
EndpointUserMerge = APIEndpoint{"POST", "arvados/v1/users/merge", ""}
- EndpointUserSetup = APIEndpoint{"POST", "arvados/v1/users/setup", ""}
+ EndpointUserSetup = APIEndpoint{"POST", "arvados/v1/users/setup", "user"}
EndpointUserSystem = APIEndpoint{"GET", "arvados/v1/users/system", ""}
EndpointUserUnsetup = APIEndpoint{"POST", "arvados/v1/users/{uuid}/unsetup", ""}
EndpointUserUpdate = APIEndpoint{"PATCH", "arvados/v1/users/{uuid}", "user"}
@@ -105,19 +105,21 @@ type UserActivateOptions struct {
}
type UserSetupOptions struct {
- UUID string `json:"uuid"`
- Email string `json:"email"`
- OpenIDPrefix string `json:"openid_prefix"`
- RepoName string `json:"repo_name"`
- VMUUID string `json:"vm_uuid"`
- SendNotificationEmail bool `json:"send_notification_email"`
+ UUID string `json:"uuid,omitempty"`
+ Email string `json:"email,omitempty"`
+ OpenIDPrefix string `json:"openid_prefix,omitempty"`
+ RepoName string `json:"repo_name,omitempty"`
+ VMUUID string `json:"vm_uuid,omitempty"`
+ SendNotificationEmail bool `json:"send_notification_email,omitempty"`
Attrs map[string]interface{} `json:"attrs"`
}
type UserMergeOptions struct {
- NewUserUUID string `json:"new_user_uuid,omitempty"`
- OldUserUUID string `json:"old_user_uuid,omitempty"`
- NewUserToken string `json:"new_user_token,omitempty"`
+ NewUserUUID string `json:"new_user_uuid,omitempty"`
+ OldUserUUID string `json:"old_user_uuid,omitempty"`
+ NewOwnerUUID string `json:"new_owner_uuid,omitempty"`
+ NewUserToken string `json:"new_user_token,omitempty"`
+ RedirectToNewUser bool `json:"redirect_to_new_user"`
}
type UserBatchUpdateOptions struct {
commit 6cfcb064bc3f330f8857fdc57124fb59a1e3ca16
Author: Tom Clegg <tom at tomclegg.ca>
Date: Tue Dec 10 10:31:38 2019 -0500
15922: Preserve etag in responses.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/lib/controller/router/response.go b/lib/controller/router/response.go
index 7f6e06844..543e25d0c 100644
--- a/lib/controller/router/response.go
+++ b/lib/controller/router/response.go
@@ -46,7 +46,7 @@ func applySelectParam(selectParam []string, orig map[string]interface{}) map[str
}
}
// Some keys are always preserved, even if not requested
- for _, k := range []string{"kind", "writable_by"} {
+ for _, k := range []string{"etag", "kind", "writable_by"} {
if v, ok := orig[k]; ok {
selected[k] = v
}
diff --git a/lib/controller/router/router_test.go b/lib/controller/router/router_test.go
index a17bd3bd8..5700f01e2 100644
--- a/lib/controller/router/router_test.go
+++ b/lib/controller/router/router_test.go
@@ -321,6 +321,8 @@ func (s *RouterIntegrationSuite) TestSelectParam(c *check.C) {
c.Check(rr.Code, check.Equals, http.StatusOK)
c.Check(resp["kind"], check.Equals, "arvados#container")
+ c.Check(resp["etag"], check.FitsTypeOf, "")
+ c.Check(resp["etag"], check.Not(check.Equals), "")
c.Check(resp["uuid"], check.HasLen, 27)
c.Check(resp["command"], check.HasLen, 2)
c.Check(resp["mounts"], check.IsNil)
diff --git a/sdk/go/arvados/container.go b/sdk/go/arvados/container.go
index 1d3b0962f..653312d86 100644
--- a/sdk/go/arvados/container.go
+++ b/sdk/go/arvados/container.go
@@ -9,6 +9,7 @@ import "time"
// Container is an arvados#container resource.
type Container struct {
UUID string `json:"uuid"`
+ Etag string `json:"etag"`
CreatedAt time.Time `json:"created_at"`
ModifiedByClientUUID string `json:"modified_by_client_uuid"`
ModifiedByUserUUID string `json:"modified_by_user_uuid"`
diff --git a/sdk/go/arvados/user.go b/sdk/go/arvados/user.go
index 950b2ff4e..68960144a 100644
--- a/sdk/go/arvados/user.go
+++ b/sdk/go/arvados/user.go
@@ -9,6 +9,7 @@ import "time"
// User is an arvados#user record
type User struct {
UUID string `json:"uuid"`
+ Etag string `json:"etag"`
IsActive bool `json:"is_active"`
IsAdmin bool `json:"is_admin"`
Username string `json:"username"`
commit 82b785e9232ef6899b32cf71fb3163ded846f141
Author: Tom Clegg <tom at tomclegg.ca>
Date: Tue Dec 10 10:31:06 2019 -0500
15922: Fix incorrect routes.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/lib/controller/rpc/conn.go b/lib/controller/rpc/conn.go
index 06e70efb7..bf6166f44 100644
--- a/lib/controller/rpc/conn.go
+++ b/lib/controller/rpc/conn.go
@@ -327,25 +327,25 @@ func (conn *Conn) UserUpdateUUID(ctx context.Context, options arvados.UpdateUUID
return resp, err
}
func (conn *Conn) UserMerge(ctx context.Context, options arvados.UserMergeOptions) (arvados.User, error) {
- ep := arvados.EndpointUserUpdateUUID
+ ep := arvados.EndpointUserMerge
var resp arvados.User
err := conn.requestAndDecode(ctx, &resp, ep, nil, options)
return resp, err
}
func (conn *Conn) UserActivate(ctx context.Context, options arvados.UserActivateOptions) (arvados.User, error) {
- ep := arvados.EndpointUserUpdateUUID
+ ep := arvados.EndpointUserActivate
var resp arvados.User
err := conn.requestAndDecode(ctx, &resp, ep, nil, options)
return resp, err
}
func (conn *Conn) UserSetup(ctx context.Context, options arvados.UserSetupOptions) (map[string]interface{}, error) {
- ep := arvados.EndpointUserUpdateUUID
+ ep := arvados.EndpointUserSetup
var resp map[string]interface{}
err := conn.requestAndDecode(ctx, &resp, ep, nil, options)
return resp, err
}
func (conn *Conn) UserUnsetup(ctx context.Context, options arvados.GetOptions) (arvados.User, error) {
- ep := arvados.EndpointUserUpdateUUID
+ ep := arvados.EndpointUserUnsetup
var resp arvados.User
err := conn.requestAndDecode(ctx, &resp, ep, nil, options)
return resp, err
commit 5bda418761e13724a986a9824bf5af5af17654dd
Author: Tom Clegg <tom at tomclegg.ca>
Date: Mon Dec 9 16:36:23 2019 -0500
15922: Preserve writable_by in user and collection responses.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go
index 174ece134..a12ebc1fa 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -345,6 +345,7 @@ var userAttrsCachedFromLoginCluster = map[string]bool{
"is_invited": false,
"owner_uuid": false,
"uuid": false,
+ "writable_by": false,
}
func (conn *Conn) UserList(ctx context.Context, options arvados.ListOptions) (arvados.UserList, error) {
diff --git a/lib/controller/router/response.go b/lib/controller/router/response.go
index 23462bcb0..7f6e06844 100644
--- a/lib/controller/router/response.go
+++ b/lib/controller/router/response.go
@@ -45,9 +45,11 @@ func applySelectParam(selectParam []string, orig map[string]interface{}) map[str
selected[attr] = v
}
}
- // Preserve "kind" even if not requested
- if v, ok := orig["kind"]; ok {
- selected["kind"] = v
+ // Some keys are always preserved, even if not requested
+ for _, k := range []string{"kind", "writable_by"} {
+ if v, ok := orig[k]; ok {
+ selected[k] = v
+ }
}
return selected
}
diff --git a/sdk/go/arvados/collection.go b/sdk/go/arvados/collection.go
index 4c9305f3f..5ac35e229 100644
--- a/sdk/go/arvados/collection.go
+++ b/sdk/go/arvados/collection.go
@@ -36,6 +36,7 @@ type Collection struct {
DeleteAt *time.Time `json:"delete_at"`
IsTrashed bool `json:"is_trashed"`
Properties map[string]interface{} `json:"properties"`
+ WritableBy []string `json:"writable_by,omitempty"`
}
func (c Collection) resourceName() string {
diff --git a/sdk/go/arvados/user.go b/sdk/go/arvados/user.go
index 30bc094d0..950b2ff4e 100644
--- a/sdk/go/arvados/user.go
+++ b/sdk/go/arvados/user.go
@@ -24,6 +24,7 @@ type User struct {
ModifiedByUserUUID string `json:"modified_by_user_uuid"`
ModifiedByClientUUID string `json:"modified_by_client_uuid"`
Prefs map[string]interface{} `json:"prefs"`
+ WritableBy []string `json:"writable_by,omitempty"`
}
// UserList is an arvados#userList resource.
commit 47f2363638b5ad65cec9a96d372563c16bea2907
Author: Tom Clegg <tom at tomclegg.ca>
Date: Mon Dec 9 09:51:55 2019 -0500
15922: Accept HEAD method on all GET routes.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/lib/controller/router/router.go b/lib/controller/router/router.go
index bc70963da..c41f103dc 100644
--- a/lib/controller/router/router.go
+++ b/lib/controller/router/router.go
@@ -298,12 +298,6 @@ func (rtr *router) addRoutes() {
},
} {
rtr.addRoute(route.endpoint, route.defaultOpts, route.exec)
- if route.endpoint.Method == "PATCH" {
- // Accept PUT as a synonym for PATCH.
- endpointPUT := route.endpoint
- endpointPUT.Method = "PUT"
- rtr.addRoute(endpointPUT, route.defaultOpts, route.exec)
- }
}
rtr.mux.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
httpserver.Errors(w, []string{"API endpoint not found"}, http.StatusNotFound)
@@ -313,8 +307,17 @@ func (rtr *router) addRoutes() {
})
}
+var altMethod = map[string]string{
+ "PATCH": "PUT", // Accept PUT as a synonym for PATCH
+ "GET": "HEAD", // Accept HEAD at any GET route
+}
+
func (rtr *router) addRoute(endpoint arvados.APIEndpoint, defaultOpts func() interface{}, exec routableFunc) {
- rtr.mux.Methods(endpoint.Method).Path("/" + endpoint.Path).HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
+ methods := []string{endpoint.Method}
+ if alt, ok := altMethod[endpoint.Method]; ok {
+ methods = append(methods, alt)
+ }
+ rtr.mux.Methods(methods...).Path("/" + endpoint.Path).HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
logger := ctxlog.FromContext(req.Context())
params, err := rtr.loadRequestParams(req, endpoint.AttrsKey)
if err != nil {
diff --git a/lib/controller/router/router_test.go b/lib/controller/router/router_test.go
index 7a7e3dd6f..a17bd3bd8 100644
--- a/lib/controller/router/router_test.go
+++ b/lib/controller/router/router_test.go
@@ -329,6 +329,11 @@ func (s *RouterIntegrationSuite) TestSelectParam(c *check.C) {
}
}
+func (s *RouterIntegrationSuite) TestHEAD(c *check.C) {
+ _, rr, _ := doRequest(c, s.rtr, arvadostest.ActiveTokenV2, "HEAD", "/arvados/v1/containers/"+arvadostest.QueuedContainerUUID, nil, nil)
+ c.Check(rr.Code, check.Equals, http.StatusOK)
+}
+
func (s *RouterIntegrationSuite) TestRouteNotFound(c *check.C) {
token := arvadostest.ActiveTokenV2
req := (&testReq{
diff --git a/services/keepproxy/keepproxy_test.go b/services/keepproxy/keepproxy_test.go
index 1c86a461a..aa3235680 100644
--- a/services/keepproxy/keepproxy_test.go
+++ b/services/keepproxy/keepproxy_test.go
@@ -142,6 +142,7 @@ func (s *ServerRequiredSuite) TestResponseViaHeader(c *C) {
resp, err := (&http.Client{}).Do(req)
c.Assert(err, Equals, nil)
c.Check(resp.Header.Get("Via"), Equals, "HTTP/1.1 keepproxy")
+ c.Assert(resp.StatusCode, Equals, http.StatusOK)
locator, err := ioutil.ReadAll(resp.Body)
c.Assert(err, Equals, nil)
resp.Body.Close()
commit 63205afef86bf2f50b829a6f0c863ee122fe785b
Author: Tom Clegg <tom at tomclegg.ca>
Date: Sat Dec 7 19:48:50 2019 -0500
15922: Change EnableBetaController14287 -> ForceLegacyAPI14.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml
index 98e6bd372..7779d7ebf 100644
--- a/lib/config/config.default.yml
+++ b/lib/config/config.default.yml
@@ -512,7 +512,7 @@ Clusters:
# "https://zzzzz.example.com/login") as an authorized redirect
# URL.
#
- # Requires EnableBetaController14287. ProviderAppID must be
+ # Incompatible with ForceLegacyAPI14. ProviderAppID must be
# blank.
GoogleClientID: ""
GoogleClientSecret: ""
@@ -1109,5 +1109,9 @@ Clusters:
<p>An administrator must activate your account before you can get
any further.</p>
- # Use experimental controller code (see https://dev.arvados.org/issues/14287)
- EnableBetaController14287: false
+ # Bypass new (Arvados 1.5) API implementations, and hand off
+ # requests directly to Rails instead. This can provide a temporary
+ # workaround for clients that are incompatible with the new API
+ # implementation. Note that it also disables some new federation
+ # features and will be removed in a future release.
+ ForceLegacyAPI14: false
diff --git a/lib/config/export.go b/lib/config/export.go
index c8bbbe1a5..e7278c5f3 100644
--- a/lib/config/export.go
+++ b/lib/config/export.go
@@ -124,7 +124,7 @@ var whitelist = map[string]bool{
"Containers.SupportedDockerImageFormats": true,
"Containers.SupportedDockerImageFormats.*": true,
"Containers.UsePreemptibleInstances": true,
- "EnableBetaController14287": false,
+ "ForceLegacyAPI14": false,
"Git": false,
"InstanceTypes": true,
"InstanceTypes.*": true,
diff --git a/lib/config/generated_config.go b/lib/config/generated_config.go
index ece3a627f..3e58d249b 100644
--- a/lib/config/generated_config.go
+++ b/lib/config/generated_config.go
@@ -518,7 +518,7 @@ Clusters:
# "https://zzzzz.example.com/login") as an authorized redirect
# URL.
#
- # Requires EnableBetaController14287. ProviderAppID must be
+ # Incompatible with ForceLegacyAPI14. ProviderAppID must be
# blank.
GoogleClientID: ""
GoogleClientSecret: ""
@@ -1115,6 +1115,10 @@ Clusters:
<p>An administrator must activate your account before you can get
any further.</p>
- # Use experimental controller code (see https://dev.arvados.org/issues/14287)
- EnableBetaController14287: false
+ # Bypass new (Arvados 1.5) API implementations, and hand off
+ # requests directly to Rails instead. This can provide a temporary
+ # workaround for clients that are incompatible with the new API
+ # implementation. Note that it also disables some new federation
+ # features and will be removed in a future release.
+ ForceLegacyAPI14: false
`)
diff --git a/lib/controller/federation_test.go b/lib/controller/federation_test.go
index 9dc4a3b81..d0bff84ea 100644
--- a/lib/controller/federation_test.go
+++ b/lib/controller/federation_test.go
@@ -57,9 +57,9 @@ func (s *FederationSuite) SetUpTest(c *check.C) {
c.Assert(s.remoteMock.Start(), check.IsNil)
cluster := &arvados.Cluster{
- ClusterID: "zhome",
- PostgreSQL: integrationTestCluster().PostgreSQL,
- EnableBetaController14287: enableBetaController14287,
+ ClusterID: "zhome",
+ PostgreSQL: integrationTestCluster().PostgreSQL,
+ ForceLegacyAPI14: forceLegacyAPI14,
}
cluster.TLS.Insecure = true
cluster.API.MaxItemsPerResponse = 1000
diff --git a/lib/controller/handler.go b/lib/controller/handler.go
index 28c616aa6..935a1b6cb 100644
--- a/lib/controller/handler.go
+++ b/lib/controller/handler.go
@@ -80,7 +80,7 @@ func (h *Handler) setup() {
rtr := router.New(federation.New(h.Cluster))
mux.Handle("/arvados/v1/config", rtr)
- if h.Cluster.EnableBetaController14287 {
+ if !h.Cluster.ForceLegacyAPI14 {
mux.Handle("/arvados/v1/collections", rtr)
mux.Handle("/arvados/v1/collections/", rtr)
mux.Handle("/arvados/v1/users", rtr)
diff --git a/lib/controller/handler_test.go b/lib/controller/handler_test.go
index 524300225..201c5ec02 100644
--- a/lib/controller/handler_test.go
+++ b/lib/controller/handler_test.go
@@ -23,11 +23,11 @@ import (
check "gopkg.in/check.v1"
)
-var enableBetaController14287 bool
+var forceLegacyAPI14 bool
// Gocheck boilerplate
func Test(t *testing.T) {
- for _, enableBetaController14287 = range []bool{false, true} {
+ for _, forceLegacyAPI14 = range []bool{false, true} {
check.TestingT(t)
}
}
@@ -45,10 +45,9 @@ func (s *HandlerSuite) SetUpTest(c *check.C) {
s.ctx, s.cancel = context.WithCancel(context.Background())
s.ctx = ctxlog.Context(s.ctx, ctxlog.New(os.Stderr, "json", "debug"))
s.cluster = &arvados.Cluster{
- ClusterID: "zzzzz",
- PostgreSQL: integrationTestCluster().PostgreSQL,
-
- EnableBetaController14287: enableBetaController14287,
+ ClusterID: "zzzzz",
+ PostgreSQL: integrationTestCluster().PostgreSQL,
+ ForceLegacyAPI14: forceLegacyAPI14,
}
s.cluster.TLS.Insecure = true
arvadostest.SetServiceURL(&s.cluster.Services.RailsAPI, "https://"+os.Getenv("ARVADOS_TEST_API_HOST"))
diff --git a/lib/controller/server_test.go b/lib/controller/server_test.go
index 37f148eb6..838de3556 100644
--- a/lib/controller/server_test.go
+++ b/lib/controller/server_test.go
@@ -35,10 +35,9 @@ func newServerFromIntegrationTestEnv(c *check.C) *httpserver.Server {
log := ctxlog.TestLogger(c)
handler := &Handler{Cluster: &arvados.Cluster{
- ClusterID: "zzzzz",
- PostgreSQL: integrationTestCluster().PostgreSQL,
-
- EnableBetaController14287: enableBetaController14287,
+ ClusterID: "zzzzz",
+ PostgreSQL: integrationTestCluster().PostgreSQL,
+ ForceLegacyAPI14: forceLegacyAPI14,
}}
handler.Cluster.TLS.Insecure = true
arvadostest.SetServiceURL(&handler.Cluster.Services.RailsAPI, "https://"+os.Getenv("ARVADOS_TEST_API_HOST"))
diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go
index 5c1314532..433e361e1 100644
--- a/sdk/go/arvados/config.go
+++ b/sdk/go/arvados/config.go
@@ -215,7 +215,7 @@ type Cluster struct {
InactivePageHTML string
}
- EnableBetaController14287 bool
+ ForceLegacyAPI14 bool
}
type Volume struct {
diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index dd74df236..2e093b396 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -717,7 +717,6 @@ def setup_config():
config = {
"Clusters": {
"zzzzz": {
- "EnableBetaController14287": ('14287' in os.environ.get('ARVADOS_EXPERIMENTAL', '')),
"ManagementToken": "e687950a23c3a9bceec28c6223a06c79",
"SystemRootToken": auth_token('system_user'),
"API": {
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list