' 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!'
# 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