[ARVADOS] updated: 2.1.0-541-g5fc96ed11

Git user git at public.arvados.org
Wed Mar 31 12:37:38 UTC 2021


Summary of changes:
 lib/deduplicationreport/command.go | 1 -
 lib/deduplicationreport/report.go  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

  discards  858af9a6b965b39d5abb7f779b9d082528c88a2b (commit)
       via  5fc96ed11f3b6312f09ecb34417eb9eac6e69a32 (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 (858af9a6b965b39d5abb7f779b9d082528c88a2b)
            \
             N -- N -- N (5fc96ed11f3b6312f09ecb34417eb9eac6e69a32)

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 5fc96ed11f3b6312f09ecb34417eb9eac6e69a32
Author: Ward Vandewege <ward at curii.com>
Date:   Wed Mar 31 08:10:06 2021 -0400

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

diff --git a/lib/deduplicationreport/command.go b/lib/deduplicationreport/command.go
index 2fdf221b0..93cdb61d3 100644
--- a/lib/deduplicationreport/command.go
+++ b/lib/deduplicationreport/command.go
@@ -18,7 +18,7 @@ type command struct{}
 type NoPrefixFormatter struct{}
 
 func (f *NoPrefixFormatter) Format(entry *logrus.Entry) ([]byte, error) {
-	return []byte(entry.Message), nil
+	return []byte(entry.Message + "\n"), nil
 }
 
 // RunCommand implements the subcommand "deduplication-report <collection> <collection> ..."
diff --git a/lib/deduplicationreport/report.go b/lib/deduplicationreport/report.go
index 8109b5dbd..d01d20fd7 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) ([]string, error) {
 	flags := flag.NewFlagSet("", flag.ContinueOnError)
 	flags.SetOutput(stderr)
 	flags.Usage = func() {
@@ -69,27 +69,26 @@ Options:
 	loglevel := flags.String("log-level", "info", "logging level (debug, info, ...)")
 	err := flags.Parse(args)
 	if err == flag.ErrHelp {
-		return 1, inputs
+		return nil, err
 	} else if err != nil {
-		return 2, inputs
+		return nil, err
 	}
 
-	inputs = flags.Args()
+	inputs := flags.Args()
 
 	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")
+		return inputs, err
 	}
 
 	lvl, err := logrus.ParseLevel(*loglevel)
 	if err != nil {
-		return 2, inputs
+		return inputs, err
 	}
 	logger.SetLevel(lvl)
-	return
+	return inputs, err
 }
 
 func blockList(collection arvados.Collection) (blocks map[string]int) {
@@ -103,15 +102,16 @@ 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
+
+	inputs, err = parseFlags(prog, args, logger, stderr)
+	if err != nil {
+		if err != flag.ErrHelp {
+			logger.Error(err.Error())
+			return 2
 		}
-		return
+		return 0
 	}
 
 	// Arvados Client setup

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list