Skip to content

Commit

Permalink
Remove use of titles by CI Butler (#1125)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinHjelmare authored and fallberg committed Jun 18, 2018
1 parent 805e2c6 commit 9b2c5f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .ci/butler.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def call(config) {
env.CHANGE_AUTHOR != 'tekka007' && env.CHANGE_AUTHOR != 'user2684' &&
env.CHANGE_AUTHOR != 'Yveaux'))
{
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Butler)', 'Sir, This pull request targets master. I am afraid that is not permitted for '+env.CHANGE_AUTHOR, '')
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Butler)', 'This pull request targets master. I am afraid that is not permitted for '+env.CHANGE_AUTHOR, '')
error "This pull request targets master. That is not permitted!"
}
else if (env.CHANGE_TARGET == 'master')
Expand Down Expand Up @@ -48,7 +48,7 @@ def call(config) {
])
}

config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Butler)', 'Pass - Well done Master!', '')
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Butler)', 'Pass - Well done!', '')
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Release changelog)', '', '${BUILD_URL}execution/node/3/ws/MySensors/ReleaseNotes.md/*view*/')
return
}
Expand Down Expand Up @@ -85,7 +85,7 @@ def call(config) {
createFileTemplateContent: '''
{{#commits}}
{{#messageBodyItems}}
{{.}}
{{.}}
{{/messageBodyItems}}
{{/commits}}
''',
Expand Down Expand Up @@ -120,7 +120,7 @@ def call(config) {
if (fileExists(config.repository_root+'restyling.patch')) {
emailext (
subject: "PR#${env.CHANGE_ID} - ${env.CHANGE_TITLE} has unfortunate code styling",
body: """<p>Greetings Sir!<p>
body: """<p>Greetings!<p>
I am afraid your pull request does not follow the MySensors standards with respect to coding style.</p>
That is ok, you are perhaps a first time committer to this repository. Please read the <a href="https://www.mysensors.org/download/contributing">code contribution guidelines</a> for help on how to format your code.<p>
To assist you, I have prepared a patch for you that will reformat the code according to the coding style required.<br>
Expand All @@ -143,7 +143,7 @@ def call(config) {
echo "You can read the detailed error report here: "+env.BUILD_URL+"The_20Butler_20report/"
error 'Terminated due to Butler assert'
} else {
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Butler)', 'Pass - Well done Sir!', '${BUILD_URL}The_20Butler_20report/butler.html')
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Butler)', 'Pass - Well done!', '${BUILD_URL}The_20Butler_20report/butler.html')
}
}

Expand Down
4 changes: 2 additions & 2 deletions .ci/butler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if git grep -q boolean -- `git ls-files | grep -v butler.sh`; then
fi

printf "%s" "<html>" > butler.html
echo "Greetings Sir! Here is my evaluation of your pull request:<br>" >> butler.html
echo "Greetings! Here is my evaluation of your pull request:<br>" >> butler.html
awk 'FNR==1{print "<br>"}1' too_long_subjects.txt leading_lowercases.txt trailing_periods.txt too_long_body_lines.txt missing_keywords.txt booleans.txt >> butler.html
echo "<br>" >> butler.html
if [ $result -ne 0 ]; then
Expand Down Expand Up @@ -87,7 +87,7 @@ if [ -s restyling.patch ]; then
echo "<br>" >> butler.html
result=1
else
echo "This commit is meeting the coding standards, well done Sir!<br>" >> butler.html
echo "This commit is meeting the coding standards, well done!<br>" >> butler.html
echo "<br>" >> butler.html
rm restyling.patch
fi
Expand Down
8 changes: 4 additions & 4 deletions .ci/pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def call(Closure body) {

config.tests = findFiles(glob: config.library_root+'tests/**/*.ino')
config.examples = findFiles(glob: config.library_root+'examples/**/*.ino')

}

parallel Doxygen: {
Expand Down Expand Up @@ -177,7 +177,7 @@ def call(Closure body) {
message: "Failed to build <${env.CHANGE_URL}|PR#${env.CHANGE_ID} - ${env.CHANGE_TITLE}>. Job <${env.BUILD_URL}|${env.JOB_NAME} #${env.BUILD_NUMBER}> ended with ${currentBuild.result}."
emailext (
subject: "PR#${env.CHANGE_ID} - ${env.CHANGE_TITLE} failed to build",
body: '''Greetings Sir!<p>
body: '''Greetings!<p>
I am The Butler. My task is to help you create a pull request that fit the MySensors organizations coding style and builds for all supported platforms.<p>
I am afraid I failed to validate your pull request. Result was '''+currentBuild.result+'''.
<br>Please check the attached build log or <a href="${BUILD_URL}">here</a> for a hint on what the problem might be.<p>
Expand All @@ -196,7 +196,7 @@ def call(Closure body) {
message: "Failed to build branch ${env.BRANCH_NAME}. Job <${env.BUILD_URL}|${env.JOB_NAME} #${env.BUILD_NUMBER}> ended with ${currentBuild.result}."
emailext (
subject: "MySensors branch ${env.BRANCH_NAME} failed to build",
body: '''Sir, I am afraid I failed to build branch ${BRANCH_NAME}. Result was '''+currentBuild.result+'''.
body: '''I am afraid I failed to build branch ${BRANCH_NAME}. Result was '''+currentBuild.result+'''.
<br>Please check the attached build log or <a href="${BUILD_URL}">here</a> for a hint on what the problem might be.<p>
Changes:<br>
${CHANGES}<p>
Expand All @@ -215,4 +215,4 @@ def call(Closure body) {
}
}
}
return this
return this

0 comments on commit 9b2c5f7

Please sign in to comment.