[ARVADOS] updated: 1.3.0-2303-gf917ac6ef

Git user git at public.arvados.org
Thu Feb 27 18:48:10 UTC 2020


Summary of changes:
 lib/boot/supervisor.go                      | 44 ++++++++++++++++-------------
 lib/controller/localdb/login_test.go        |  2 ++
 services/api/test/integration/users_test.rb | 10 ++++++-
 3 files changed, 36 insertions(+), 20 deletions(-)

       via  f917ac6efacd74eb4b074a4326d14b5ca89f68da (commit)
       via  b42daf8e7d9009c2eeca0236866c27de67b0068a (commit)
       via  54dc69a87762ae17c1b0d72464611640589d2e44 (commit)
      from  7bbb0940b0398d17bb85fe410c3f23e4cd6ec8d6 (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 f917ac6efacd74eb4b074a4326d14b5ca89f68da
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Thu Feb 27 13:47:19 2020 -0500

    15954: Don't touch GEM_ vars if rvm is in use.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/lib/boot/supervisor.go b/lib/boot/supervisor.go
index e10fa23fa..c11129f9e 100644
--- a/lib/boot/supervisor.go
+++ b/lib/boot/supervisor.go
@@ -122,7 +122,7 @@ func (super *Supervisor) run(cfg *arvados.Config) error {
 	super.configfile = conffile.Name()
 
 	super.environ = os.Environ()
-	super.cleanEnv()
+	super.cleanEnv([]string{"ARVADOS_"})
 	super.setEnv("ARVADOS_CONFIG", super.configfile)
 	super.setEnv("RAILS_ENV", super.ClusterType)
 	super.setEnv("TMPDIR", super.tempdir)
@@ -296,17 +296,11 @@ func (super *Supervisor) prependEnv(key, prepend string) {
 	super.environ = append(super.environ, key+"="+prepend)
 }
 
-var cleanEnvPrefixes = []string{
-	"GEM_HOME=",
-	"GEM_PATH=",
-	"ARVADOS_",
-}
-
-func (super *Supervisor) cleanEnv() {
+func (super *Supervisor) cleanEnv(prefixes []string) {
 	var cleaned []string
 	for _, s := range super.environ {
 		drop := false
-		for _, p := range cleanEnvPrefixes {
+		for _, p := range prefixes {
 			if strings.HasPrefix(s, p) {
 				drop = true
 				break
@@ -354,17 +348,29 @@ func (super *Supervisor) installGoProgram(ctx context.Context, srcpath string) (
 	return binfile, err
 }
 
+func (super *Supervisor) usingRVM() bool {
+	return os.Getenv("rvm_path") != ""
+}
+
 func (super *Supervisor) setupRubyEnv() error {
-	cmd := exec.Command("gem", "env", "gempath")
-	cmd.Env = super.environ
-	buf, err := cmd.Output() // /var/lib/arvados/.gem/ruby/2.5.0/bin:...
-	if err != nil || len(buf) == 0 {
-		return fmt.Errorf("gem env gempath: %v", err)
-	}
-	gempath := string(bytes.Split(buf, []byte{':'})[0])
-	super.prependEnv("PATH", gempath+"/bin:")
-	super.setEnv("GEM_HOME", gempath)
-	super.setEnv("GEM_PATH", gempath)
+	if !super.usingRVM() {
+		// (If rvm is in use, assume the caller has everything
+		// set up as desired)
+		super.cleanEnv([]string{
+			"GEM_HOME=",
+			"GEM_PATH=",
+		})
+		cmd := exec.Command("gem", "env", "gempath")
+		cmd.Env = super.environ
+		buf, err := cmd.Output() // /var/lib/arvados/.gem/ruby/2.5.0/bin:...
+		if err != nil || len(buf) == 0 {
+			return fmt.Errorf("gem env gempath: %v", err)
+		}
+		gempath := string(bytes.Split(buf, []byte{':'})[0])
+		super.prependEnv("PATH", gempath+"/bin:")
+		super.setEnv("GEM_HOME", gempath)
+		super.setEnv("GEM_PATH", gempath)
+	}
 	// Passenger install doesn't work unless $HOME is ~user
 	u, err := user.Current()
 	if err != nil {

commit b42daf8e7d9009c2eeca0236866c27de67b0068a
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Thu Feb 27 12:05:10 2020 -0500

    15954: Fix config for login tests.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/lib/controller/localdb/login_test.go b/lib/controller/localdb/login_test.go
index 4fb0fbcee..db6daa195 100644
--- a/lib/controller/localdb/login_test.go
+++ b/lib/controller/localdb/login_test.go
@@ -146,6 +146,8 @@ func (s *LoginSuite) SetUpTest(c *check.C) {
 
 	cfg, err := config.NewLoader(nil, ctxlog.TestLogger(c)).Load()
 	s.cluster, err = cfg.GetCluster("")
+	s.cluster.Login.ProviderAppID = ""
+	s.cluster.Login.ProviderAppSecret = ""
 	s.cluster.Login.GoogleClientID = "test%client$id"
 	s.cluster.Login.GoogleClientSecret = "test#client/secret"
 	s.cluster.Users.PreferDomainForUsername = "PreferDomainForUsername.example.com"

commit 54dc69a87762ae17c1b0d72464611640589d2e44
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Thu Feb 27 11:58:48 2020 -0500

    15954: Fix test.
    
    The following "setup user" call was only succeeding because the "uuid"
    param was being ignored and the call was processed as a no-op ("admin
    account is already set up, nothing to do").
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/services/api/test/integration/users_test.rb b/services/api/test/integration/users_test.rb
index ee230d514..4be89a245 100644
--- a/services/api/test/integration/users_test.rb
+++ b/services/api/test/integration/users_test.rb
@@ -326,7 +326,7 @@ class UsersTest < ActionDispatch::IntegrationTest
 
   end
 
-  test "cannot set is_activate to false directly" do
+  test "cannot set is_active to false directly" do
     post('/arvados/v1/users',
       params: {
         user: {
@@ -339,6 +339,14 @@ class UsersTest < ActionDispatch::IntegrationTest
     user = json_response
     assert_equal false, user['is_active']
 
+    token = act_as_system_user do
+      ApiClientAuthorization.create!(user: User.find_by_uuid(user['uuid']), api_client: ApiClient.all.first).api_token
+    end
+    post("/arvados/v1/user_agreements/sign",
+        params: {uuid: 'zzzzz-4zz18-t68oksiu9m80s4y'},
+        headers: {"HTTP_AUTHORIZATION" => "Bearer #{token}"})
+    assert_response :success
+
     post("/arvados/v1/users/#{user['uuid']}/activate",
       params: {},
       headers: auth(:admin))

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list