[gem5-dev] Change in gem5/gem5[develop]: util: Fix gerrit bot commit subject parser

2021-07-27 Thread Bobby R. Bruce (Gerrit) via gem5-dev
Bobby R. Bruce has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/48586 )


Change subject: util: Fix gerrit bot commit subject parser
..

util: Fix gerrit bot commit subject parser

Currently, if the commit subject does have tags, the parser will
return the list of tags as a NoneType object, which will be
iterated later. This caused the gerrit bot to fail.

This change lets the parser return the list of tags as an empty
list rather than a NoneType object. Also, a commit subject without
a semicolon `:` will be assumed as having no tags and the whole
subject is the commit message.

Signed-off-by: Hoa Nguyen 
Change-Id: Ie8c90e14bb85c4ce1c583121d02e75aa87db7811
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48586
Reviewed-by: Bobby R. Bruce 
Maintainer: Bobby R. Bruce 
Tested-by: kokoro 
---
M util/gerrit-bot/util.py
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Bobby R. Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/util/gerrit-bot/util.py b/util/gerrit-bot/util.py
index 31b9fcc..d836690 100644
--- a/util/gerrit-bot/util.py
+++ b/util/gerrit-bot/util.py
@@ -30,9 +30,10 @@
 parsed_subject = subject.split(":", maxsplit = 1)

 # If the subject does not have a colon, it either does not have tags
-# or does not have a message
+# or does not have a message. In this case, we assume that the subject
+# is the commit message.
 if len(parsed_subject) <= 1:
-return None, None
+return [], parsed_subject[0]

 tags = [ tag.strip() for tag in parsed_subject[0].split(",") ]
 message = parsed_subject[1]

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48586
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie8c90e14bb85c4ce1c583121d02e75aa87db7811
Gerrit-Change-Number: 48586
Gerrit-PatchSet: 2
Gerrit-Owner: Hoa Nguyen 
Gerrit-Reviewer: Bobby R. Bruce 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: util: Fix gerrit bot commit subject parser

2021-07-26 Thread Hoa Nguyen (Gerrit) via gem5-dev
Hoa Nguyen has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/48586 )



Change subject: util: Fix gerrit bot commit subject parser
..

util: Fix gerrit bot commit subject parser

Currently, if the commit subject does have tags, the parser will
return the list of tags as a NoneType object, which will be
iterated later. This caused the gerrit bot to fail.

This change lets the parser return the list of tags as an empty
list rather than a NoneType object. Also, a commit subject without
a semicolon `:` will be assumed as having no tags and the whole
subject is the commit message.

Signed-off-by: Hoa Nguyen 
Change-Id: Ie8c90e14bb85c4ce1c583121d02e75aa87db7811
---
M util/gerrit-bot/util.py
1 file changed, 3 insertions(+), 2 deletions(-)



diff --git a/util/gerrit-bot/util.py b/util/gerrit-bot/util.py
index 31b9fcc..d836690 100644
--- a/util/gerrit-bot/util.py
+++ b/util/gerrit-bot/util.py
@@ -30,9 +30,10 @@
 parsed_subject = subject.split(":", maxsplit = 1)

 # If the subject does not have a colon, it either does not have tags
-# or does not have a message
+# or does not have a message. In this case, we assume that the subject
+# is the commit message.
 if len(parsed_subject) <= 1:
-return None, None
+return [], parsed_subject[0]

 tags = [ tag.strip() for tag in parsed_subject[0].split(",") ]
 message = parsed_subject[1]

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/48586
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie8c90e14bb85c4ce1c583121d02e75aa87db7811
Gerrit-Change-Number: 48586
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s