You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Gitler)', 'This pull request targets master. That is not permitted for '+env.CHANGE_AUTHOR, '')
12
+
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Butler)', 'This pull request targets master. I am afraid that is not permitted for '+env.CHANGE_AUTHOR, '')
13
13
error "This pull request targets master. That is not permitted!"
14
14
}
15
15
elseif (env.CHANGE_TARGET=='master')
16
16
{
17
17
echo env.CHANGE_AUTHOR+' is a valid author for targeting master branch, skipping further validation'
if (fileExists(config.repository_root+'restyling.patch')) {
87
121
emailext (
88
-
subject: "Job '${env.JOB_NAME} #${env.BUILD_NUMBER} [PR#${env.CHANGE_ID}]' failed due to bad code styling",
89
-
body: """<p>Job '${env.JOB_NAME} [<a href="${env.CHANGE_URL}">PR#${env.CHANGE_ID}</a> - ${env.CHANGE_TITLE}]' failed because code style does not follow the standards.</p>
90
-
A patch to rectify the errors is attached. You apply the patch using:<br>
122
+
subject: "PR#${env.CHANGE_ID} - ${env.CHANGE_TITLE} has unfortunate code styling",
123
+
body: """<p>Greetings!<p>
124
+
I am afraid your pull request does not follow the MySensors standards with respect to coding style.</p>
125
+
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>
126
+
To assist you, I have prepared a patch for you that will reformat the code according to the coding style required.<br>
127
+
The patch is attached. You may apply the patch using:<br>
91
128
git apply restyling.patch<p>
92
-
If you disagree to this, please discuss it <a href="${env.CHANGE_URL}">here</a>.<p>
93
-
Yours sincerely, Gitler, on behalf of Jenkins""",
94
-
mimeType: 'text/html', to: '${env.CHANGE_AUTHOR_EMAIL}',
129
+
If you disagree with me, please discuss it <a href="${env.CHANGE_URL}">here</a>.<p>
130
+
--<br>
131
+
Yours sincerely, The Butler, serving the MySensors community""",
132
+
mimeType: 'text/html', to: env.CHANGE_AUTHOR_EMAIL,
reportFiles: 'butler.html', reportName: 'The Butler report', reportTitles: ''])
101
139
if (ret ==1) {
102
-
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Gitler)', 'Commit(s) does not meet coding standards', '${BUILD_URL}Gitler_report/gitler.html')
140
+
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Butler)', 'I am afraid the commit(s) needs some touchup, please check the details...', '${BUILD_URL}The_20Butler_20report/butler.html')
103
141
currentBuild.currentResult =='FAILURE'
104
-
echo "Termiated due to Gitler assert"// For BFA
105
-
echo "You can read the detailed error report here: "+env.BUILD_URL+"Gitler_report/"
106
-
error 'Termiated due to Gitler assert'
142
+
echo "Terminated due to Butler assert"// For BFA
143
+
echo "You can read the detailed error report here: "+env.BUILD_URL+"The_20Butler_20report/"
echo"<b>I am afraid there are some issues with your commit messages and/or use of keywords.</b><br>">> butler.html
64
+
echo"I highly recommend reading <a href="http://chris.beams.io/posts/git-commit">this guide</a> for tips on how to write a good commit message.<br>">> butler.html
65
+
echo"More specifically, MySensors have some <a href="https://www.mysensors.org/download/contributing">code contribution guidelines</a> that I am afraid all contributers need to follow.<br>">> butler.html
66
+
echo"<br>">> butler.html
67
+
echo"I can help guide you in how to change the commit message for a single-commit pull request:<br>">> butler.html
echo"I am afraid your coding style is not entirely in line with the MySensors preffered style.<b><br>A mail with a patch has been sent to you that, if applied to your PR, will make it follow the MySensors coding standards.</b><br>">> butler.html
85
+
echo"You can apply the patch using:<br>">> butler.html
86
+
echo"git apply restyling.patch<br>">> butler.html
87
+
echo"<br>">> butler.html
88
+
result=1
89
+
else
90
+
echo"This commit is meeting the coding standards, well done!<br>">> butler.html
91
+
echo"<br>">> butler.html
92
+
rm restyling.patch
93
+
fi
94
+
95
+
if [ $result-ne 0 ];then
96
+
echo"If you have any questions, please first read the <a href="https://www.mysensors.org/download/contributing">code contribution guidelines</a>.</b><br>">> butler.html
97
+
echo"<b>If you disagree to this, please discuss it in the GitHub pull request thread.</b><br>">> butler.html
98
+
echo"<br>">> butler.html
99
+
fi
100
+
echo"Yours sincerely, The Butler, serving the MySensors community<br>">> butler.html
0 commit comments