Skip to content

Commit 15351cd

Browse files
committed
MySensors 2.3.0 release
2 parents 64be32a + b84cd6a commit 15351cd

File tree

117 files changed

+9984
-2364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+9984
-2364
lines changed

.ci/arduino.groovy

Lines changed: 95 additions & 27 deletions
Large diffs are not rendered by default.

.ci/gitler.groovy renamed to .ci/butler.groovy

Lines changed: 55 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!groovy
22
def call(config) {
3-
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (Gitler)', 'Checking...', '${BUILD_URL}flowGraphTable/')
3+
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (Butler)', 'Checking...', '${BUILD_URL}flowGraphTable/')
44
if (env.CHANGE_TARGET == 'master' &&
55
(env.CHANGE_AUTHOR != 'bblacey' && env.CHANGE_AUTHOR != 'd00616' &&
66
env.CHANGE_AUTHOR != 'fallberg' && env.CHANGE_AUTHOR != 'henrikekblad' &&
@@ -9,13 +9,47 @@ def call(config) {
99
env.CHANGE_AUTHOR != 'tekka007' && env.CHANGE_AUTHOR != 'user2684' &&
1010
env.CHANGE_AUTHOR != 'Yveaux'))
1111
{
12-
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, '')
1313
error "This pull request targets master. That is not permitted!"
1414
}
1515
else if (env.CHANGE_TARGET == 'master')
1616
{
1717
echo env.CHANGE_AUTHOR + ' is a valid author for targeting master branch, skipping further validation'
18-
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Gitler)', 'Pass', '')
18+
dir(config.repository_root) {
19+
step([$class: 'GitChangelogRecorder', config: [configFile: 'git-changelog-settings.json',
20+
createFileTemplateContent: '''
21+
# Changelog
22+
{{#commits}}
23+
### {{{messageTitle}}}
24+
{{{messageBody}}}
25+
[{{hash}}](https://github.com/mysensors/MySensors/commit/{{hash}}) by {{authorName}} at *{{commitTime}}*
26+
{{/commits}}
27+
''',
28+
createFileTemplateFile: '', createFileUseTemplateContent: true,
29+
createFileUseTemplateFile: false, customIssues: [[link: '', name: '', pattern: '', title: ''],
30+
[link: '', name: '', pattern: '', title: '']], dateFormat: 'YYYY-MM-dd HH:mm:ss',
31+
file: 'ReleaseNotes.md', fromReference: env.CHANGE_TARGET, fromType: 'ref', gitHubApi: '',
32+
gitHubApiTokenCredentialsId: '', gitHubIssuePattern: '#([0-9]+)', gitHubToken: '',
33+
gitLabApiTokenCredentialsId: '', gitLabProjectName: '', gitLabServer: '', gitLabToken: '',
34+
ignoreCommitsIfMessageMatches: '^Merge.*',
35+
ignoreCommitsWithoutIssue: false, ignoreTagsIfNameMatches: '',
36+
jiraIssuePattern: '\\b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\b', jiraPassword: '', jiraServer: '',
37+
jiraUsername: '', jiraUsernamePasswordCredentialsId: '', mediaWikiPassword: '',
38+
mediaWikiTemplateContent: '', mediaWikiTemplateFile: '', mediaWikiTitle: '', mediaWikiUrl: '',
39+
mediaWikiUseTemplateContent: false, mediaWikiUseTemplateFile: false, mediaWikiUsername: '',
40+
noIssueName: 'No issue', readableTagName: '/([^/]+?)$', showSummary: false,
41+
showSummaryTemplateContent: '', showSummaryTemplateFile: '', showSummaryUseTemplateContent: false,
42+
showSummaryUseTemplateFile: false, subDirectory: '', timeZone: 'UTC',
43+
toReference: config.git_sha, toType: 'commit', untaggedName: 'Unreleased',
44+
useConfigFile: false, useFile: true, useGitHub: true, useGitHubApiTokenCredentials: false,
45+
useGitLab: false, useGitLabApiTokenCredentials: false, useIgnoreTagsIfNameMatches: false,
46+
useJira: false, useJiraUsernamePasswordCredentialsId: false, useMediaWiki: false,
47+
useReadableTagName: false, useSubDirectory: false]
48+
])
49+
}
50+
51+
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Butler)', 'Pass - Well done!', '')
52+
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Release changelog)', '', '${BUILD_URL}execution/node/3/ws/MySensors/ReleaseNotes.md/*view*/')
1953
return
2054
}
2155

@@ -51,7 +85,7 @@ def call(config) {
5185
createFileTemplateContent: '''
5286
{{#commits}}
5387
{{#messageBodyItems}}
54-
{{.}}
88+
{{.}}
5589
{{/messageBodyItems}}
5690
{{/commits}}
5791
''',
@@ -81,31 +115,35 @@ def call(config) {
81115
ret = sh(returnStatus: true,
82116
script:"""#!/bin/bash
83117
cd ${config.repository_root}/.ci
84-
./gitler.sh""")
118+
./butler.sh""")
85119

86120
if (fileExists(config.repository_root+'restyling.patch')) {
87121
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>
91128
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,
95133
attachLog: false, compressLog: false, attachmentsPattern: config.repository_root+'restyling.patch'
96134
)
97135
}
98136
publishHTML([allowMissing: true, alwaysLinkToLastBuild: false, keepAll: true,
99137
reportDir: config.repository_root,
100-
reportFiles: 'gitler.html', reportName: 'Gitler report', reportTitles: ''])
138+
reportFiles: 'butler.html', reportName: 'The Butler report', reportTitles: ''])
101139
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')
103141
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/"
144+
error 'Terminated due to Butler assert'
107145
} else {
108-
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Gitler)', 'Pass', '')
146+
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Butler)', 'Pass - Well done!', '${BUILD_URL}The_20Butler_20report/butler.html')
109147
}
110148
}
111149

.ci/butler.sh

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/bin/bash
2+
# Yes, this script can be improved immensly...
3+
cd ..
4+
5+
result=0
6+
7+
echo "No subjects are of invalid size<br>" > too_long_subjects.txt
8+
echo "No subjects with leading lower case characters<br>" > leading_lowercases.txt
9+
echo "No subjects with trailing periods<br>" > trailing_periods.txt
10+
echo "No body lines are too wide<br>" > too_long_body_lines.txt
11+
echo "No keywords are missing in keywords.txt<br>" > missing_keywords.txt
12+
echo "No occurences of the deprecated boolean data type<br>" >> booleans.txt
13+
14+
too_long_subjects=`awk 'length > 72' subjects.txt`
15+
if [ -n "$too_long_subjects" ]; then
16+
echo "<b>Commit subjects that are too wide (&gt;72 characters):</b>" > too_long_subjects.txt
17+
echo "$too_long_subjects" >> too_long_subjects.txt
18+
sed -i -e 's/$/<br>/' too_long_subjects.txt
19+
result=1
20+
fi
21+
leading_lowercases=`awk '/^[[:lower:][:punct:]]/' subjects.txt`
22+
if [ -n "$leading_lowercases" ]; then
23+
echo "<b>Commit subjects with leading lowercase characters:</b>" > leading_lowercases.txt
24+
echo "$leading_lowercases" >> leading_lowercases.txt
25+
sed -i -e 's/$/<br>/' leading_lowercases.txt
26+
result=1
27+
fi
28+
trailing_periods=`awk '/(\.)$/' subjects.txt`
29+
if [ -n "$trailing_periods" ]; then
30+
echo "<b>Commit subjects with trailing periods:</b>" > trailing_periods.txt
31+
echo "$trailing_periods" >> trailing_periods.txt
32+
sed -i -e 's/$/<br>/' trailing_periods.txt
33+
result=1
34+
fi
35+
36+
too_long_body_lines=`awk 'length > 72' bodies.txt`
37+
if [ -n "$too_long_body_lines" ]; then
38+
echo "<b>Body lines that are too wide (&gt;72 characters):</b>" > too_long_body_lines.txt
39+
echo "$too_long_body_lines" >> too_long_body_lines.txt
40+
sed -i -e 's/$/<br>/' too_long_body_lines.txt
41+
result=1
42+
fi
43+
44+
missing_keywords=$(for keyword in $(grep -A999 '#if DOXYGEN' MyConfig.h | grep -B999 '#endif' | grep '#define' | awk '{ print $2 '} | grep -e '^MY_'); do grep -q $keyword keywords.txt || echo $keyword; done)
45+
if [ -n "$missing_keywords" ]; then
46+
echo "<b>Keywords that are missing from keywords.txt:</b>" > missing_keywords.txt
47+
echo "$missing_keywords" >> missing_keywords.txt
48+
sed -i -e 's/$/<br>/' missing_keywords.txt
49+
result=1
50+
fi
51+
52+
# Evaluate if there exists booleans in the code tree (not counting this file)
53+
if git grep -q boolean -- `git ls-files | grep -v butler.sh`; then
54+
echo "<b>You have added at least one occurence of the deprecated boolean data type. Please use bool instead.</b><br>" > booleans.txt
55+
result=1
56+
fi
57+
58+
printf "%s" "<html>" > butler.html
59+
echo "Greetings! Here is my evaluation of your pull request:<br>" >> butler.html
60+
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
61+
echo "<br>" >> butler.html
62+
if [ $result -ne 0 ]; then
63+
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
68+
echo "git checkout &lt;your_branch&gt;<br>" >> butler.html
69+
echo "git commit --amend<br>" >> butler.html
70+
echo "git push origin HEAD:&lt;your_branch_on_github&gt; -f<br>" >> butler.html
71+
echo "<br>" >> butler.html
72+
echo "To change the commit messages for a multiple-commit pull request:<br>" >> butler.html
73+
echo "git checkout &lt;your_branch&gt;<br>" >> butler.html
74+
echo "git rebase -i &lt;sha_of_parent_to_the_earliest_commit_you_want_to_change&gt;<br>" >> butler.html
75+
echo "Replace \"pick\" with \"r\" or \"reword\" on the commits you need to change message for<br>" >> butler.html
76+
echo "git push origin HEAD:&lt;your_branch_on_github&gt; -f<br>" >> butler.html
77+
echo "<br>" >> butler.html
78+
fi
79+
80+
# Evaluate coding style
81+
astyle --options=.mystools/astyle/config/style.cfg -nq --recursive "*.h" "*.c" "*.cpp"
82+
git diff > restyling.patch
83+
if [ -s restyling.patch ]; then
84+
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
101+
printf "%s" "</html>" >> butler.html
102+
exit $result

.ci/doxygen.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def call(config) {
66
Documentation/doxygen.sh"""
77
warnings canComputeNew: false, canResolveRelativePaths: false,
88
defaultEncoding: '',
9-
excludePattern: '''.*/sha204_library\\.h,.*/drivers/Linux/.*,.*/cores/esp8266/.*,hardware/.*''',
9+
excludePattern: '''.*/sha204_library\\.h,.*/drivers/Linux/.*,.*/drivers/TinyGSM/.*,.*/cores/esp8266/.*,hardware/.*''',
1010
failedTotalAll: '', healthy: '', includePattern: '', messagesPattern: '',
1111
parserConfigurations: [[parserName: 'Doxygen', pattern: config.repository_root+'doxygen.log']],
1212
unHealthy: '', unstableTotalAll: '0'
@@ -19,7 +19,7 @@ def call(config) {
1919
// Publish docs to API server
2020
if (env.BRANCH_NAME == 'master') {
2121
sh """#!/bin/bash
22-
scp -r ${config.repository_root}Documentation/html [email protected]"""
22+
scp -r ${config.repository_root}Documentation/html [email protected]:"""
2323
} else if (env.BRANCH_NAME == 'development') {
2424
sh """#!/bin/bash
2525
scp -r ${config.repository_root}Documentation/html [email protected]:beta"""

.ci/gitler.sh

Lines changed: 0 additions & 93 deletions
This file was deleted.

.ci/linux.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def buildSerial(config) {
3434
buildLinux(config, '--my-debug=disable --my-transport=none --my-gateway=serial', 'Serial')
3535
if (currentBuild.currentResult == 'UNSTABLE') {
3636
config.pr.setBuildStatus(config, 'ERROR', 'Toll gate (Linux builds - Serial GW)', 'Warnings found', '${BUILD_URL}warnings28Result/new')
37-
error 'Termiated due to warnings found'
37+
error 'Terminated due to warnings found'
3838
} else if (currentBuild.currentResult == 'FAILURE') {
3939
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Linux builds - Serial GW)', 'Build error', '${BUILD_URL}')
4040
} else {
@@ -47,7 +47,7 @@ def buildEthernet(config) {
4747
buildLinux(config, '--my-debug=enable --my-transport=rs485 --my-gateway=ethernet', 'Ethernet')
4848
if (currentBuild.currentResult == 'UNSTABLE') {
4949
config.pr.setBuildStatus(config, 'ERROR', 'Toll gate (Linux builds - Ethernet GW)', 'Warnings found', '${BUILD_URL}warnings28Result/new')
50-
error 'Termiated due to warnings found'
50+
error 'Terminated due to warnings found'
5151
} else if (currentBuild.currentResult == 'FAILURE') {
5252
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Linux builds - Ethernet GW)', 'Build error', '${BUILD_URL}')
5353
} else {
@@ -60,7 +60,7 @@ def buildMQTT(config) {
6060
buildLinux(config, '--my-debug=disable --my-transport=none --my-gateway=mqtt', 'MQTT')
6161
if (currentBuild.currentResult == 'UNSTABLE') {
6262
config.pr.setBuildStatus(config, 'ERROR', 'Toll gate (Linux builds - MQTT GW)', 'Warnings found', '${BUILD_URL}warnings28Result/new')
63-
error 'Termiated due to warnings found'
63+
error 'Terminated due to warnings found'
6464
} else if (currentBuild.currentResult == 'FAILURE') {
6565
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Linux builds - MQTT GW)', 'Build error', '${BUILD_URL}')
6666
} else {

0 commit comments

Comments
 (0)