refined the notification msg for submission
authorJF Ding <jian-feng.ding@intel.com>
Mon, 29 Jul 2013 02:01:46 +0000 (10:01 +0800)
committerLin A Yang <lin.a.yang@intel.com>
Mon, 29 Jul 2013 03:57:12 +0000 (20:57 -0700)
according Anas' suggestion

Change-Id: I6d6eb4c23a70f9f8a90c32605c4aa629582f55fb
Reviewed-on: https://otctools.jf.intel.com/review/5654
Reviewed-by: Lin A Yang <lin.a.yang@intel.com>
Tested-by: Lin A Yang <lin.a.yang@intel.com>
job_submitobs.py

index 4b94c74..d3f46ee 100755 (executable)
@@ -29,22 +29,30 @@ WRONG_VERSION_MSG = '- The tag means you want to submit commit %s in %s branch'\
                     ' to OBS, but this commit does NOT exist in %s branch. '\
                     'Please use correct branch name as version in tag name '\
                     'submit/{version}/{date.time}.'
+
 WRONG_DATE_MSG = '- The date %s in tag does NOT follow correct format. You can'\
                  ' use shell command "date --utc +%%Y%%m%%d.%%H%%M%%S" to '\
                  'generate it, like 20120801.083113.'
-UNDER_REVIEW_MSG = '- The commit %s is still under review in gerrit. After '\
-                   'reviewer accpet this commit, it will be submitted to OBS '\
-                   'corresponding project.'
+
+UNDER_REVIEW_MSG = '- The commit %s is still under review in gerrit. '\
+                   'It will be submitted to the matching project in the build '\
+                   'system after it has passed review. '
+
 WRONG_COMMIT_MSG = '- The commit %s tag attached does NOT exist in git tree or'\
                    ' gerrit open change. Please make sure the commit has been '\
                    'pushed to gerrit and correct magical ref refs/for/branch.'
+
 UNKNOWN_FORMAT_MSG = '- Unknown tag format, please follow the format '\
                      'submit/{version}/{date.time}.'
+
 NOT_ANNOTATED_MSG = '- Tag should be annotated tag.'
+
 SUGGESTION = 'Suggest to use "gbs submit" to trigger submission, or use '\
              'following command to create tag "git tag '\
              'submit/${version}/$(date --utc +%%Y%%m%%d.%%H%%M%%S) -m "****" ".'
+
 TITLE_FAILED = '[Submit Request Failed]: tag: %s in %s'
+
 EMAIL_FOOTER = '\n\n--------------------------------------------------------\n'\
                'Automatically generated by backend service.\n'\
                'Please DO NOT Reply!'
@@ -148,12 +156,17 @@ def check_tag_format(git, mygerrit, event, tag):
     # post comment to gerrit and send email if check failed
     if message:
         print message
-        msg = 'The tag %s is pushed, but this submission failed because of "\
-                "following reason(s):\n\n' % tag + '\n'.join(message)
+
+        msg = 'The tag %s was pushed, but it was not completed because of '\
+                'the following reason(s):\n\n' % tag + '\n'.join(message)
+
         if len(message) != 1 or message[0] != UNDER_REVIEW_MSG % psr:
             msg += '\n\n' + SUGGESTION
+
         mygerrit.review(commit = psr, message = msg)
+
         send_mail(TITLE_FAILED % (tag, event['project']), msg, tagger)
+
         return False
 
     return True