refs #12850 Merge branch '12850-docker-tag-version'
authorFernando Monserrat <fernando.monserrat@gmail.com>
Fri, 22 Dec 2017 15:18:01 +0000 (12:18 -0300)
committerFernando Monserrat <fernando.monserrat@gmail.com>
Fri, 22 Dec 2017 15:18:01 +0000 (12:18 -0300)
Arvados-DCO-1.1-Signed-off-by: Fernando Monserrat <fmonserrat@veritasgenetics.com>

README.md
build/check-copyright-notices
doc/user/cwl/bwa-mem/bwa-mem.cwl
sdk/go/arvados/collection_fs.go
sdk/go/arvados/collection_fs_test.go
services/keep-web/cadaver_test.go

index 367c3e8f60c5ccb2bb5f5490c32812ed0bbceca1..c480ffda4cca9c5141e954c75bbc41c35fd67b67 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-[//]: # Copyright (C) The Arvados Authors. All rights reserved.
-[//]: #
-[//]: # SPDX-License-Identifier: CC-BY-SA-3.0
+[comment]: # (Copyright © The Arvados Authors. All rights reserved.)
+[comment]: # ()
+[comment]: # (SPDX-License-Identifier: CC-BY-SA-3.0)
 
 [Arvados](https://arvados.org) is a free software distributed computing platform
 for bioinformatics, data science, and high throughput analysis of massive data
@@ -46,7 +46,7 @@ doc/README.textile for instructions.
 
 ## Community
 
-The [#arvados](irc://irc.oftc.net:6667/#arvados IRC) (Internet Relay Chat)
+The [#arvados](irc://irc.oftc.net:6667/#arvados) IRC (Internet Relay Chat)
 channel at the
 [Open and Free Technology Community (irc.oftc.net)](http://www.oftc.net/oftc/)
 is available for live discussion and support.  You can use a traditional IRC
@@ -58,7 +58,7 @@ is a forum for general discussion, questions, and news about Arvados
 development.  The
 [Arvados developer mailing list](http://lists.arvados.org/mailman/listinfo/arvados-dev)
 is a forum for more technical discussion, intended for developers and
-contributers to Arvados.
+contributors to Arvados.
 
 ## Development
 
@@ -73,6 +73,10 @@ Instructions for setting up a development environment and working on specific
 components can be found on the
 ["Hacking Arvados" page of the Arvados wiki](https://dev.arvados.org/projects/arvados/wiki/Hacking).
 
+## Contributing
+
+When making a pull request, please ensure *every git commit message* includes a one-line [Developer Certificate of Origin](https://dev.arvados.org/projects/arvados/wiki/Developer_Certificate_Of_Origin). If you have already made commits without it, fix them with `git commit --amend` or `git rebase`.
+
 ## Licensing
 
 Arvados is Free Software.  See COPYING for information about Arvados Free
index 5298371bd1591fed7178cd6b839f90715b8a56c4..f087188991c5c06a3b19a3b1e38325d9d29e5c52 100755 (executable)
@@ -49,163 +49,172 @@ EOF
 
 IFS=$'\n' read -a ignores -r -d $'\000' <.licenseignore || true
 result=0
-git ls-files -z ${@} | \
-    while read -rd $'\000' fnm
+
+coproc git ls-files -z ${@} </dev/null
+while read -rd $'\000' fnm
+do
+    grepAfter=2
+    grepBefore=0
+    cs=
+    cc=
+    ce=
+    fixer=
+    if [[ ! -f ${fnm} ]] || [[ -L ${fnm} ]] || [[ ! -s ${fnm} ]]
+    then
+        continue
+    fi
+
+    ignore=
+    for pattern in "${ignores[@]}"
     do
-        grepAfter=2
-        grepBefore=0
-        cs=
-        cc=
-        ce=
-        fixer=
-        if [[ ! -f ${fnm} ]] || [[ -L ${fnm} ]] || [[ ! -s ${fnm} ]]
+        if [[ ${fnm} == ${pattern} ]]
         then
-            continue
+            ignore=1
         fi
+    done
+    if [[ ${ignore} = 1 ]]; then continue; fi
 
-        ignore=
-        for pattern in "${ignores[@]}"
-        do
-            if [[ ${fnm} == ${pattern} ]]
+    case ${fnm} in
+        Makefile | */Makefile \
+            | *.dockerfile | */Dockerfile.* | */Dockerfile | *.dockerignore \
+            | */MANIFEST.in | */fuse.conf | */gitolite.rc \
+            | *.pl | *.pm | *.PL \
+            | *.rb | *.rb.example | *.rake | *.ru \
+            | *.gemspec | */Gemfile | */Rakefile \
+            | services/login-sync/bin/* \
+            | sdk/cli/bin/* \
+            | *.py \
+            | sdk/python/bin/arv-* \
+            | sdk/cwl/bin/* \
+            | services/nodemanager/bin/* \
+            | services/fuse/bin/* \
+            | tools/crunchstat-summary/bin/* \
+            | crunch_scripts/* \
+            | *.yaml | *.yml | *.yml.example | *.cwl \
+            | *.sh | *.service \
+            | */run | */run-service | */restart-dns-server \
+            | */nodemanager/doc/*.cfg \
+            | */nodemanager/tests/fake*.cfg.template \
+            | */nginx.conf \
+            | build/build.list)
+            fixer=fixer
+            cc="#"
+            ;;
+        *.md)
+            fixer=fixer
+            cc="[//]: #"
+            ;;
+        *.rst)
+            fixer=fixer
+            cc=".."
+            ;;
+        *.erb)
+            fixer=fixer
+            cs="<%# "
+            cc=""
+            ce=" %>"
+            ;;
+        *.liquid)
+            fixer=fixer
+            cs=$'{% comment %}\n'
+            cc=""
+            ce=$'\n{% endcomment %}'
+            grepAfter=3
+            grepBefore=1
+            ;;
+        *.textile)
+            fixer=fixer
+            cs="###. "
+            cc="...."
+            ce=
+            ;;
+        *.css)
+            fixer=fixer
+            cs="/* "
+            cc=""
+            ce=" */"
+            ;;
+        *.coffee)
+            fixer=fixer
+            cs="### "
+            cc=""
+            ce=" ###"
+            ;;
+        *.go | *.scss | *.java | *.js)
+            fixer=fixer
+            cc="//"
+            ;;
+        *.sql)
+            fixer=fixer
+            cc="--"
+            ;;
+        *.html | *.svg)
+            fixer=fixer
+            cs="<!-- "
+            cc=""
+            ce=" -->"
+            ;;
+        *)
+            cc="#"
+            hashbang=$(head -n1 ${fnm})
+            if [[ ${hashbang} = "#!/bin/sh" ]] ||  [[ ${hashbang} = "#!/bin/bash" ]]
             then
-                ignore=1
-            fi
-        done
-        if [[ ${ignore} = 1 ]]; then continue; fi
-
-        case ${fnm} in
-            Makefile | */Makefile \
-                | *.dockerfile | */Dockerfile.* | */Dockerfile | *.dockerignore \
-                | */MANIFEST.in | */fuse.conf | */gitolite.rc \
-                | *.pl | *.pm | *.PL \
-                | *.rb | *.rb.example | *.rake | *.ru \
-                | *.gemspec | */Gemfile | */Rakefile \
-                | services/login-sync/bin/* \
-                | sdk/cli/bin/* \
-                | *.py \
-                | sdk/python/bin/arv-* \
-                | sdk/cwl/bin/* \
-                | services/nodemanager/bin/* \
-                | services/fuse/bin/* \
-                | tools/crunchstat-summary/bin/* \
-                | crunch_scripts/* \
-                | *.yaml | *.yml | *.yml.example | *.cwl \
-                | *.sh | *.service \
-                | */run | */run-service | */restart-dns-server \
-                | */nodemanager/doc/*.cfg \
-                | */nodemanager/tests/fake*.cfg.template \
-                | */nginx.conf \
-                | build/build.list)
-                fixer=fixer
-                cc="#"
-                ;;
-            *.md)
-                fixer=fixer
-                cc="[//]: #"
-                ;;
-            *.rst)
-                fixer=fixer
-                cc=".."
-                ;;
-            *.erb)
-                fixer=fixer
-                cs="<%# "
-                cc=""
-                ce=" %>"
-                ;;
-            *.liquid)
-                fixer=fixer
-                cs=$'{% comment %}\n'
-                cc=""
-                ce=$'\n{% endcomment %}'
-                grepAfter=3
-                grepBefore=1
-                ;;
-            *.textile)
-                fixer=fixer
-                cs="###. "
-                cc="...."
-                ce=
-                ;;
-            *.css)
-                fixer=fixer
-                cs="/* "
-                cc=""
-                ce=" */"
-                ;;
-            *.coffee)
                 fixer=fixer
-                cs="### "
-                cc=""
-                ce=" ###"
-                ;;
-            *.go | *.scss | *.java | *.js)
-                fixer=fixer
-                cc="//"
-                ;;
-            *.sql)
-                fixer=fixer
-                cc="--"
-                ;;
-            *.html | *.svg)
-                fixer=fixer
-                cs="<!-- "
-                cc=""
-                ce=" -->"
-                ;;
-            *)
-                cc="#"
-                hashbang=$(head -n1 ${fnm})
-                if [[ ${hashbang} = "#!/bin/sh" ]] ||  [[ ${hashbang} = "#!/bin/bash" ]]
-                then
-                    fixer=fixer
-                fi
-                ;;
-        esac
-        wantGPL="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
+            fi
+            ;;
+    esac
+    wantGPL="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
 ${cc}
 ${cc}${cc:+ }SPDX-License-Identifier: AGPL-3.0${ce}"
-        wantApache="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
+    wantApache="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
 ${cc}
 ${cc}${cc:+ }SPDX-License-Identifier: Apache-2.0${ce}"
-        wantBYSA="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
+    wantBYSA="${cs:-${cc}${cc:+ }}Copyright (C) The Arvados Authors. All rights reserved.
 ${cc}
 ${cc}${cc:+ }SPDX-License-Identifier: CC-BY-SA-3.0${ce}"
-        found=$(head -n20 "$fnm" | egrep -A${grepAfter} -B${grepBefore} 'Copyright.*Arvados' || true)
-        case ${fnm} in
-            Makefile | build/* | lib/* | tools/* | apps/* | services/* | sdk/cli/bin/crunch-job)
-                want=${wantGPL}
-                ;;
-            crunch_scripts/* | backports/* | docker/* | sdk/*)
-                want=${wantApache}
-                ;;
-            README.md | doc/*)
-                want=${wantBYSA}
-                ;;
-            *)
-                want=
-                ;;
-        esac
-        case "$found" in
-            "$wantGPL")
-                ;;
-            "$wantApache")
-                ;;
-            "$wantBYSA")
-                ;;
-            "")
-                if [[ -z ${found} ]] && [[ -n ${want} ]] && [[ $fix = true ]] && [[ $fixer != "" ]]
-                then
-                    ${fixer} ${fnm}
-                else
-                    echo "missing copyright notice: $fnm"
-                    result=1
-                fi
-                ;;
-            *)
-                echo "nonstandard copyright notice: $fnm '${found}'"
+    wantBYSAmd="[comment]: # (Copyright © The Arvados Authors. All rights reserved.)
+[comment]: # ()
+[comment]: # (SPDX-License-Identifier: CC-BY-SA-3.0)"
+    found=$(head -n20 "$fnm" | egrep -A${grepAfter} -B${grepBefore} 'Copyright.*Arvados' || true)
+    case ${fnm} in
+        Makefile | build/* | lib/* | tools/* | apps/* | services/* | sdk/cli/bin/crunch-job)
+            want=${wantGPL}
+            ;;
+        crunch_scripts/* | backports/* | docker/* | sdk/*)
+            want=${wantApache}
+            ;;
+        doc/*)
+            want=${wantBYSA}
+            ;;
+        README.md)
+            want=${wantBYSAmd}
+            ;;
+        *)
+            want=
+            ;;
+    esac
+    case "$found" in
+        "$wantGPL")
+            ;;
+        "$wantApache")
+            ;;
+        "$wantBYSA")
+            ;;
+        "$wantBYSAmd")
+            ;;
+        "")
+            if [[ -z ${found} ]] && [[ -n ${want} ]] && [[ $fix = true ]] && [[ $fixer != "" ]]
+            then
+                ${fixer} ${fnm}
+            else
+                echo "missing copyright notice: $fnm"
                 result=1
-                ;;
-        esac
-    done
+            fi
+            ;;
+        *)
+            echo "nonstandard copyright notice: $fnm '${found}'"
+            result=1
+            ;;
+    esac
+done <&${COPROC[0]}
 exit $result
index b5c9f82a1a5f79970a97e92d91fce7de9268430c..20019712645902dbd1962b86a48bb8e59643c7b9 100755 (executable)
@@ -8,9 +8,9 @@ class: CommandLineTool
 
 hints:
   DockerRequirement:
-    dockerPull: biodckr/bwa
+    dockerPull: lh3lh3/bwa
 
-baseCommand: [bwa, mem]
+baseCommand: [mem]
 
 arguments:
   - {prefix: "-t", valueFrom: $(runtime.cores)}
index 7bbbaa492c71298157f3cfebc96dfade89966ae0..d8ee2a2b1c5175697bf39369274ff6c0a42e7310 100644 (file)
@@ -1078,6 +1078,10 @@ func (dn *dirnode) Rename(oldname, newname string) error {
        if !ok {
                return os.ErrNotExist
        }
+       if locked[oldinode] {
+               // oldinode cannot become a descendant of itself.
+               return ErrInvalidArgument
+       }
        if existing, ok := newdn.inodes[newname]; ok {
                // overwriting an existing file or dir
                if dn, ok := existing.(*dirnode); ok {
index 57ba3255947439ded25834e6b8841cd51fe70f48..bd5d08bcf5e8f278606be6bac2037ce7b9215ecb 100644 (file)
@@ -599,6 +599,30 @@ func (s *CollectionFSSuite) TestRemove(c *check.C) {
        c.Check(err, check.IsNil)
 }
 
+func (s *CollectionFSSuite) TestRenameError(c *check.C) {
+       fs, err := (&Collection{}).FileSystem(s.client, s.kc)
+       c.Assert(err, check.IsNil)
+       err = fs.Mkdir("first", 0755)
+       c.Assert(err, check.IsNil)
+       err = fs.Mkdir("first/second", 0755)
+       c.Assert(err, check.IsNil)
+       f, err := fs.OpenFile("first/second/file", os.O_CREATE|os.O_WRONLY, 0755)
+       c.Assert(err, check.IsNil)
+       f.Write([]byte{1, 2, 3, 4, 5})
+       f.Close()
+       err = fs.Rename("first", "first/second/third")
+       c.Check(err, check.Equals, ErrInvalidArgument)
+       err = fs.Rename("first", "first/third")
+       c.Check(err, check.Equals, ErrInvalidArgument)
+       err = fs.Rename("first/second", "second")
+       c.Check(err, check.IsNil)
+       f, err = fs.OpenFile("second/file", 0, 0)
+       c.Assert(err, check.IsNil)
+       data, err := ioutil.ReadAll(f)
+       c.Check(err, check.IsNil)
+       c.Check(data, check.DeepEquals, []byte{1, 2, 3, 4, 5})
+}
+
 func (s *CollectionFSSuite) TestRename(c *check.C) {
        fs, err := (&Collection{}).FileSystem(s.client, s.kc)
        c.Assert(err, check.IsNil)
index d4a89c844b567a4d2fb8d3a94f8138e365a672d7..eb323674b9013daa80b7ee7bc1d472dcdd21cf01 100644 (file)
@@ -131,6 +131,17 @@ func (s *IntegrationSuite) TestWebdavWithCadaver(c *check.C) {
                        cmd:   "move newdir0/testfile newdir1/\n",
                        match: `(?ms).*Moving .* succeeded.*`,
                },
+               {
+                       path:  writePath,
+                       cmd:   "move newdir1 newdir1/\n",
+                       match: `(?ms).*Moving .* failed.*`,
+               },
+               {
+                       path:  writePath,
+                       cmd:   "get newdir1/testfile '" + checkfile.Name() + "'\n",
+                       match: `(?ms).*succeeded.*`,
+                       data:  testdata,
+               },
                {
                        path:  writePath,
                        cmd:   "put '" + localfile.Name() + "' newdir1/testfile1\n",