[ARVADOS] updated: 2.1.0-541-gda29f2126

Git user git at public.arvados.org
Tue Mar 30 17:48:17 UTC 2021


Summary of changes:
 lib/deduplicationreport/report.go | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

  discards  5b3b5b84f6d22f07ef72f191ea44f8c2f2c862c3 (commit)
       via  da29f21261586780cc13678134eaa39da8fe8e50 (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 (5b3b5b84f6d22f07ef72f191ea44f8c2f2c862c3)
            \
             N -- N -- N (da29f21261586780cc13678134eaa39da8fe8e50)

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 da29f21261586780cc13678134eaa39da8fe8e50
Author: Ward Vandewege <ward at curii.com>
Date:   Tue Mar 30 13:23:03 2021 -0400

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

diff --git a/lib/deduplicationreport/report.go b/lib/deduplicationreport/report.go
index 8109b5dbd..c8f4d22ea 100644
--- a/lib/deduplicationreport/report.go
+++ b/lib/deduplicationreport/report.go
@@ -29,7 +29,7 @@ func deDuplicate(inputs []string) (trimmed []string) {
 	return
 }
 
-func parseFlags(prog string, args []string, logger *logrus.Logger, stderr io.Writer) (exitcode int, inputs []string) {
+func parseFlags(prog string, args []string, logger *logrus.Logger, stderr io.Writer) (exitcode int, inputs []string, err error) {
 	flags := flag.NewFlagSet("", flag.ContinueOnError)
 	flags.SetOutput(stderr)
 	flags.Usage = func() {
@@ -67,11 +67,11 @@ Options:
 		flags.PrintDefaults()
 	}
 	loglevel := flags.String("log-level", "info", "logging level (debug, info, ...)")
-	err := flags.Parse(args)
+	err = flags.Parse(args)
 	if err == flag.ErrHelp {
-		return 1, inputs
+		return 0, inputs, err
 	} else if err != nil {
-		return 2, inputs
+		return 2, inputs, err
 	}
 
 	inputs = flags.Args()
@@ -79,14 +79,13 @@ Options:
 	inputs = deDuplicate(inputs)
 
 	if len(inputs) < 1 {
-		logger.Errorf("Error: no collections provided")
-		flags.Usage()
-		return 2, inputs
+		err = fmt.Errorf("Error: no collections provided\n")
+		return 2, inputs, err
 	}
 
 	lvl, err := logrus.ParseLevel(*loglevel)
 	if err != nil {
-		return 2, inputs
+		return 2, inputs, err
 	}
 	logger.SetLevel(lvl)
 	return
@@ -105,11 +104,12 @@ func blockList(collection arvados.Collection) (blocks map[string]int) {
 func report(prog string, args []string, logger *logrus.Logger, stdout, stderr io.Writer) (exitcode int) {
 
 	var inputs []string
-	exitcode, inputs = parseFlags(prog, args, logger, stderr)
-	if exitcode != 0 {
-		if exitcode == 1 {
-			// Asking for the cli help should not result in a non-zero exit code
-			exitcode = 0
+	var err error
+
+	exitcode, inputs, err = parseFlags(prog, args, logger, stderr)
+	if err != nil || exitcode != 0 {
+		if err != nil {
+			logger.Errorf(err.Error())
 		}
 		return
 	}
@@ -117,7 +117,7 @@ func report(prog string, args []string, logger *logrus.Logger, stdout, stderr io
 	// Arvados Client setup
 	arv, err := arvadosclient.MakeArvadosClient()
 	if err != nil {
-		logger.Errorf("Error creating Arvados object: %s", err)
+		logger.Errorf("Error creating Arvados object: %s\n", err)
 		exitcode = 1
 		return
 	}
@@ -144,7 +144,7 @@ func report(prog string, args []string, logger *logrus.Logger, stdout, stderr io
 			uuid = input
 		}
 		if !strings.Contains(uuid, "-4zz18-") {
-			logger.Errorf("Error: uuid must refer to collection object")
+			logger.Errorf("Error: uuid must refer to collection object\n")
 			exitcode = 1
 			return
 		}
@@ -159,14 +159,14 @@ func report(prog string, args []string, logger *logrus.Logger, stdout, stderr io
 			var collection arvados.Collection
 			err = arv.Get("collections", uuid, nil, &collection)
 			if err != nil {
-				logger.Errorf("Error: unable to retrieve collection: %s", err)
+				logger.Errorf("Error: unable to retrieve collection: %s\n", err)
 				exitcode = 1
 				return
 			}
 			blocks[uuid] = make(map[string]int)
 			blocks[uuid] = blockList(collection)
 			if pdh != "" && collection.PortableDataHash != pdh {
-				logger.Errorf("Error: the collection with UUID %s has PDH %s, but a different PDH was provided in the arguments: %s", uuid, collection.PortableDataHash, pdh)
+				logger.Errorf("Error: the collection with UUID %s has PDH %s, but a different PDH was provided in the arguments: %s\n", uuid, collection.PortableDataHash, pdh)
 				exitcode = 1
 				return
 			}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list