Skip to content

Commit

Permalink
MySensors 2.3.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
fallberg committed Jun 18, 2018
2 parents 64be32a + b84cd6a commit 15351cd
Show file tree
Hide file tree
Showing 117 changed files with 9,984 additions and 2,364 deletions.
122 changes: 95 additions & 27 deletions .ci/arduino.groovy

Large diffs are not rendered by default.

72 changes: 55 additions & 17 deletions .ci/gitler.groovy → .ci/butler.groovy
@@ -1,6 +1,6 @@
#!groovy
def call(config) {
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (Gitler)', 'Checking...', '${BUILD_URL}flowGraphTable/')
config.pr.setBuildStatus(config, 'PENDING', 'Toll gate (Butler)', 'Checking...', '${BUILD_URL}flowGraphTable/')
if (env.CHANGE_TARGET == 'master' &&
(env.CHANGE_AUTHOR != 'bblacey' && env.CHANGE_AUTHOR != 'd00616' &&
env.CHANGE_AUTHOR != 'fallberg' && env.CHANGE_AUTHOR != 'henrikekblad' &&
Expand All @@ -9,13 +9,47 @@ def call(config) {
env.CHANGE_AUTHOR != 'tekka007' && env.CHANGE_AUTHOR != 'user2684' &&
env.CHANGE_AUTHOR != 'Yveaux'))
{
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Gitler)', 'This pull request targets master. 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')
{
echo env.CHANGE_AUTHOR + ' is a valid author for targeting master branch, skipping further validation'
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Gitler)', 'Pass', '')
dir(config.repository_root) {
step([$class: 'GitChangelogRecorder', config: [configFile: 'git-changelog-settings.json',
createFileTemplateContent: '''
# Changelog
{{#commits}}
### {{{messageTitle}}}
{{{messageBody}}}
[{{hash}}](https://github.com/mysensors/MySensors/commit/{{hash}}) by {{authorName}} at *{{commitTime}}*
{{/commits}}
''',
createFileTemplateFile: '', createFileUseTemplateContent: true,
createFileUseTemplateFile: false, customIssues: [[link: '', name: '', pattern: '', title: ''],
[link: '', name: '', pattern: '', title: '']], dateFormat: 'YYYY-MM-dd HH:mm:ss',
file: 'ReleaseNotes.md', fromReference: env.CHANGE_TARGET, fromType: 'ref', gitHubApi: '',
gitHubApiTokenCredentialsId: '', gitHubIssuePattern: '#([0-9]+)', gitHubToken: '',
gitLabApiTokenCredentialsId: '', gitLabProjectName: '', gitLabServer: '', gitLabToken: '',
ignoreCommitsIfMessageMatches: '^Merge.*',
ignoreCommitsWithoutIssue: false, ignoreTagsIfNameMatches: '',
jiraIssuePattern: '\\b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\b', jiraPassword: '', jiraServer: '',
jiraUsername: '', jiraUsernamePasswordCredentialsId: '', mediaWikiPassword: '',
mediaWikiTemplateContent: '', mediaWikiTemplateFile: '', mediaWikiTitle: '', mediaWikiUrl: '',
mediaWikiUseTemplateContent: false, mediaWikiUseTemplateFile: false, mediaWikiUsername: '',
noIssueName: 'No issue', readableTagName: '/([^/]+?)$', showSummary: false,
showSummaryTemplateContent: '', showSummaryTemplateFile: '', showSummaryUseTemplateContent: false,
showSummaryUseTemplateFile: false, subDirectory: '', timeZone: 'UTC',
toReference: config.git_sha, toType: 'commit', untaggedName: 'Unreleased',
useConfigFile: false, useFile: true, useGitHub: true, useGitHubApiTokenCredentials: false,
useGitLab: false, useGitLabApiTokenCredentials: false, useIgnoreTagsIfNameMatches: false,
useJira: false, useJiraUsernamePasswordCredentialsId: false, useMediaWiki: false,
useReadableTagName: false, useSubDirectory: false]
])
}

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 @@ -51,7 +85,7 @@ def call(config) {
createFileTemplateContent: '''
{{#commits}}
{{#messageBodyItems}}
{{.}}
{{.}}
{{/messageBodyItems}}
{{/commits}}
''',
Expand Down Expand Up @@ -81,31 +115,35 @@ def call(config) {
ret = sh(returnStatus: true,
script:"""#!/bin/bash
cd ${config.repository_root}/.ci
./gitler.sh""")
./butler.sh""")

if (fileExists(config.repository_root+'restyling.patch')) {
emailext (
subject: "Job '${env.JOB_NAME} #${env.BUILD_NUMBER} [PR#${env.CHANGE_ID}]' failed due to bad code styling",
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>
A patch to rectify the errors is attached. You apply the patch using:<br>
subject: "PR#${env.CHANGE_ID} - ${env.CHANGE_TITLE} has unfortunate code styling",
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>
The patch is attached. You may apply the patch using:<br>
git apply restyling.patch<p>
If you disagree to this, please discuss it <a href="${env.CHANGE_URL}">here</a>.<p>
Yours sincerely, Gitler, on behalf of Jenkins""",
mimeType: 'text/html', to: '${env.CHANGE_AUTHOR_EMAIL}',
If you disagree with me, please discuss it <a href="${env.CHANGE_URL}">here</a>.<p>
--<br>
Yours sincerely, The Butler, serving the MySensors community""",
mimeType: 'text/html', to: env.CHANGE_AUTHOR_EMAIL,
attachLog: false, compressLog: false, attachmentsPattern: config.repository_root+'restyling.patch'
)
}
publishHTML([allowMissing: true, alwaysLinkToLastBuild: false, keepAll: true,
reportDir: config.repository_root,
reportFiles: 'gitler.html', reportName: 'Gitler report', reportTitles: ''])
reportFiles: 'butler.html', reportName: 'The Butler report', reportTitles: ''])
if (ret == 1) {
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Gitler)', 'Commit(s) does not meet coding standards', '${BUILD_URL}Gitler_report/gitler.html')
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')
currentBuild.currentResult == 'FAILURE'
echo "Termiated due to Gitler assert" // For BFA
echo "You can read the detailed error report here: "+env.BUILD_URL+"Gitler_report/"
error 'Termiated due to Gitler assert'
echo "Terminated due to Butler assert" // For BFA
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 (Gitler)', 'Pass', '')
config.pr.setBuildStatus(config, 'SUCCESS', 'Toll gate (Butler)', 'Pass - Well done!', '${BUILD_URL}The_20Butler_20report/butler.html')
}
}

Expand Down
102 changes: 102 additions & 0 deletions .ci/butler.sh
@@ -0,0 +1,102 @@
#!/bin/bash
# Yes, this script can be improved immensly...
cd ..

result=0

echo "No subjects are of invalid size<br>" > too_long_subjects.txt
echo "No subjects with leading lower case characters<br>" > leading_lowercases.txt
echo "No subjects with trailing periods<br>" > trailing_periods.txt
echo "No body lines are too wide<br>" > too_long_body_lines.txt
echo "No keywords are missing in keywords.txt<br>" > missing_keywords.txt
echo "No occurences of the deprecated boolean data type<br>" >> booleans.txt

too_long_subjects=`awk 'length > 72' subjects.txt`
if [ -n "$too_long_subjects" ]; then
echo "<b>Commit subjects that are too wide (&gt;72 characters):</b>" > too_long_subjects.txt
echo "$too_long_subjects" >> too_long_subjects.txt
sed -i -e 's/$/<br>/' too_long_subjects.txt
result=1
fi
leading_lowercases=`awk '/^[[:lower:][:punct:]]/' subjects.txt`
if [ -n "$leading_lowercases" ]; then
echo "<b>Commit subjects with leading lowercase characters:</b>" > leading_lowercases.txt
echo "$leading_lowercases" >> leading_lowercases.txt
sed -i -e 's/$/<br>/' leading_lowercases.txt
result=1
fi
trailing_periods=`awk '/(\.)$/' subjects.txt`
if [ -n "$trailing_periods" ]; then
echo "<b>Commit subjects with trailing periods:</b>" > trailing_periods.txt
echo "$trailing_periods" >> trailing_periods.txt
sed -i -e 's/$/<br>/' trailing_periods.txt
result=1
fi

too_long_body_lines=`awk 'length > 72' bodies.txt`
if [ -n "$too_long_body_lines" ]; then
echo "<b>Body lines that are too wide (&gt;72 characters):</b>" > too_long_body_lines.txt
echo "$too_long_body_lines" >> too_long_body_lines.txt
sed -i -e 's/$/<br>/' too_long_body_lines.txt
result=1
fi

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)
if [ -n "$missing_keywords" ]; then
echo "<b>Keywords that are missing from keywords.txt:</b>" > missing_keywords.txt
echo "$missing_keywords" >> missing_keywords.txt
sed -i -e 's/$/<br>/' missing_keywords.txt
result=1
fi

# Evaluate if there exists booleans in the code tree (not counting this file)
if git grep -q boolean -- `git ls-files | grep -v butler.sh`; then
echo "<b>You have added at least one occurence of the deprecated boolean data type. Please use bool instead.</b><br>" > booleans.txt
result=1
fi

printf "%s" "<html>" > 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
echo "<b>I am afraid there are some issues with your commit messages and/or use of keywords.</b><br>" >> butler.html
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
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
echo "<br>" >> butler.html
echo "I can help guide you in how to change the commit message for a single-commit pull request:<br>" >> butler.html
echo "git checkout &lt;your_branch&gt;<br>" >> butler.html
echo "git commit --amend<br>" >> butler.html
echo "git push origin HEAD:&lt;your_branch_on_github&gt; -f<br>" >> butler.html
echo "<br>" >> butler.html
echo "To change the commit messages for a multiple-commit pull request:<br>" >> butler.html
echo "git checkout &lt;your_branch&gt;<br>" >> butler.html
echo "git rebase -i &lt;sha_of_parent_to_the_earliest_commit_you_want_to_change&gt;<br>" >> butler.html
echo "Replace \"pick\" with \"r\" or \"reword\" on the commits you need to change message for<br>" >> butler.html
echo "git push origin HEAD:&lt;your_branch_on_github&gt; -f<br>" >> butler.html
echo "<br>" >> butler.html
fi

# Evaluate coding style
astyle --options=.mystools/astyle/config/style.cfg -nq --recursive "*.h" "*.c" "*.cpp"
git diff > restyling.patch
if [ -s restyling.patch ]; then
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
echo "You can apply the patch using:<br>" >> butler.html
echo "git apply restyling.patch<br>" >> butler.html
echo "<br>" >> butler.html
result=1
else
echo "This commit is meeting the coding standards, well done!<br>" >> butler.html
echo "<br>" >> butler.html
rm restyling.patch
fi

if [ $result -ne 0 ]; then
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
echo "<b>If you disagree to this, please discuss it in the GitHub pull request thread.</b><br>" >> butler.html
echo "<br>" >> butler.html
fi
echo "Yours sincerely, The Butler, serving the MySensors community<br>" >> butler.html
printf "%s" "</html>" >> butler.html
exit $result
4 changes: 2 additions & 2 deletions .ci/doxygen.groovy
Expand Up @@ -6,7 +6,7 @@ def call(config) {
Documentation/doxygen.sh"""
warnings canComputeNew: false, canResolveRelativePaths: false,
defaultEncoding: '',
excludePattern: '''.*/sha204_library\\.h,.*/drivers/Linux/.*,.*/cores/esp8266/.*,hardware/.*''',
excludePattern: '''.*/sha204_library\\.h,.*/drivers/Linux/.*,.*/drivers/TinyGSM/.*,.*/cores/esp8266/.*,hardware/.*''',
failedTotalAll: '', healthy: '', includePattern: '', messagesPattern: '',
parserConfigurations: [[parserName: 'Doxygen', pattern: config.repository_root+'doxygen.log']],
unHealthy: '', unstableTotalAll: '0'
Expand All @@ -19,7 +19,7 @@ def call(config) {
// Publish docs to API server
if (env.BRANCH_NAME == 'master') {
sh """#!/bin/bash
scp -r ${config.repository_root}Documentation/html docs@direct.openhardware.io"""
scp -r ${config.repository_root}Documentation/html docs@direct.openhardware.io:"""
} else if (env.BRANCH_NAME == 'development') {
sh """#!/bin/bash
scp -r ${config.repository_root}Documentation/html docs@direct.openhardware.io:beta"""
Expand Down
93 changes: 0 additions & 93 deletions .ci/gitler.sh

This file was deleted.

6 changes: 3 additions & 3 deletions .ci/linux.groovy
Expand Up @@ -34,7 +34,7 @@ def buildSerial(config) {
buildLinux(config, '--my-debug=disable --my-transport=none --my-gateway=serial', 'Serial')
if (currentBuild.currentResult == 'UNSTABLE') {
config.pr.setBuildStatus(config, 'ERROR', 'Toll gate (Linux builds - Serial GW)', 'Warnings found', '${BUILD_URL}warnings28Result/new')
error 'Termiated due to warnings found'
error 'Terminated due to warnings found'
} else if (currentBuild.currentResult == 'FAILURE') {
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Linux builds - Serial GW)', 'Build error', '${BUILD_URL}')
} else {
Expand All @@ -47,7 +47,7 @@ def buildEthernet(config) {
buildLinux(config, '--my-debug=enable --my-transport=rs485 --my-gateway=ethernet', 'Ethernet')
if (currentBuild.currentResult == 'UNSTABLE') {
config.pr.setBuildStatus(config, 'ERROR', 'Toll gate (Linux builds - Ethernet GW)', 'Warnings found', '${BUILD_URL}warnings28Result/new')
error 'Termiated due to warnings found'
error 'Terminated due to warnings found'
} else if (currentBuild.currentResult == 'FAILURE') {
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Linux builds - Ethernet GW)', 'Build error', '${BUILD_URL}')
} else {
Expand All @@ -60,7 +60,7 @@ def buildMQTT(config) {
buildLinux(config, '--my-debug=disable --my-transport=none --my-gateway=mqtt', 'MQTT')
if (currentBuild.currentResult == 'UNSTABLE') {
config.pr.setBuildStatus(config, 'ERROR', 'Toll gate (Linux builds - MQTT GW)', 'Warnings found', '${BUILD_URL}warnings28Result/new')
error 'Termiated due to warnings found'
error 'Terminated due to warnings found'
} else if (currentBuild.currentResult == 'FAILURE') {
config.pr.setBuildStatus(config, 'FAILURE', 'Toll gate (Linux builds - MQTT GW)', 'Build error', '${BUILD_URL}')
} else {
Expand Down

0 comments on commit 15351cd

Please sign in to comment.