-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop parameters page in Wiki from just disappearing #6576
Merged
peterbarker
merged 5 commits into
ArduPilot:master
from
peterbarker:pr/build-parameters-fixes
Jan 29, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1a7bbbe
build_parameters.py: exit with non-zero exit code on errors
peterbarker dc60e85
update.sh: run with -ex
peterbarker 0f32f1f
build_parameters.py: require at least one commit from html parsing
peterbarker 8136d73
update.sh: make this much more verbose
peterbarker 0a072b3
update.sh: build versioned parameters unconditionally
peterbarker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
#!/bin/bash | ||
# check for changes in docs and run sphinx | ||
|
||
set -e | ||
set -x | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. debug? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I'm leaving it like this deliberately. One of these is even called out in the commit messages... |
||
export PYTHONUNBUFFERED=1 | ||
|
||
cd $HOME/build_wiki || exit 1 | ||
cd $HOME/build_wiki | ||
|
||
START=$(date +%s) | ||
|
||
|
@@ -32,34 +35,49 @@ lock_file build.lck || { | |
exit 1 | ||
} | ||
|
||
progress() { | ||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] update.sh: $*" | ||
} | ||
|
||
LOGFILE="logs/update-latest.log" | ||
progress "update.sh starting (see $LOGFILE)" | ||
|
||
test -n "$FORCEBUILD" || { | ||
(cd ardupilot_wiki && git fetch > /dev/null 2>&1) | ||
(cd sphinx_rtd_theme && git fetch > /dev/null 2>&1) | ||
progress "Fetching ardupilot_wiki" | ||
(cd ardupilot_wiki && git fetch) | ||
progress "Fetching sphinx_rtd_theme" | ||
(cd sphinx_rtd_theme && git fetch) | ||
|
||
changed=0 | ||
progress "Getting oldhash for ardupilot_wiki" | ||
oldhash=$(cd ardupilot_wiki && git rev-parse origin/master) | ||
progress "Getting newhash for ardupilot_wiki" | ||
newhash=$(cd ardupilot_wiki && git rev-parse HEAD) | ||
[ "$oldhash" = "$newhash" ] || { | ||
echo "ardupilot_wiki has changed $newhash $oldhash" | ||
progress "ardupilot_wiki has changed $newhash $oldhash" | ||
changed=1 | ||
} | ||
|
||
progress "Getting oldhash for sphinx_rtd_theme" | ||
oldhash=$(cd sphinx_rtd_theme && git rev-parse origin/master) | ||
progress "Getting newhash for sphinx_rtd_theme" | ||
newhash=$(cd sphinx_rtd_theme && git rev-parse HEAD) | ||
[ "$oldhash" = "$newhash" ] || { | ||
echo "sphinx_rtd_theme has changed $newhash $oldhash" | ||
progress "sphinx_rtd_theme has changed $newhash $oldhash" | ||
changed=1 | ||
} | ||
|
||
progress "Fetching parameters" | ||
PARAMSITES="ArduPlane ArduCopter AntennaTracker Rover AP_Periph Blimp" | ||
mkdir -p old_params new_params | ||
for site in $PARAMSITES; do | ||
wget "https://autotest.ardupilot.org/Parameters/$site/Parameters.rst" -O new_params/$site.rst 2> /dev/null | ||
wget "https://autotest.ardupilot.org/Parameters/$site/Parameters.rst" -O new_params/$site.rst | ||
done | ||
|
||
progress "Comparing parameters" | ||
for site in $PARAMSITES; do | ||
if ! cmp new_params/$site.rst old_params/$site.rst; then | ||
echo "$site.rst has changed" | ||
progress "$site.rst has changed" | ||
cp new_params/$site.rst old_params/$site.rst | ||
changed=1 | ||
fi | ||
|
@@ -68,30 +86,29 @@ test -n "$FORCEBUILD" || { | |
LOGMESSAGESITES="Plane Copter Tracker Rover Blimp" | ||
mkdir -p old_logmessages new_logmessages | ||
for site in $LOGMESSAGESITES; do | ||
wget "https://autotest.ardupilot.org/LogMessages/$site/LogMessages.rst" -O new_logmessages/$site.rst 2> /dev/null | ||
wget "https://autotest.ardupilot.org/LogMessages/$site/LogMessages.rst" -O new_logmessages/$site.rst | ||
done | ||
|
||
for site in $LOGMESSAGESITES; do | ||
if ! cmp new_logmessages/$site.rst old_logmessages/$site.rst; then | ||
echo "$site.rst has changed" | ||
progress "$site.rst has changed" | ||
cp new_logmessages/$site.rst old_logmessages/$site.rst | ||
changed=1 | ||
fi | ||
done | ||
|
||
[ $changed = 1 ] || exit 0 | ||
[ $changed = 1 ] || { | ||
progress "Nothing changed; no rebuild required, exiting" | ||
exit 0 | ||
} | ||
} | ||
|
||
progress "update.sh starting build" | ||
|
||
( | ||
date | ||
|
||
report() { | ||
cat <<EOF | mail -s 'wiki build failed' [email protected] | ||
A wiki build failed | ||
EOF | ||
} | ||
|
||
echo "[Buildlog] Updating ardupilot_wiki at $(date '+%Y-%m-%d-%H-%M-%S')" | ||
progress "Updating ardupilot_wiki" | ||
pushd ardupilot_wiki | ||
git checkout -f master | ||
git fetch origin | ||
|
@@ -100,7 +117,7 @@ git reset --hard origin/master | |
git clean -f -f -x -d -d | ||
popd | ||
|
||
echo "[Buildlog] Updating sphinx_rtd_theme at $(date '+%Y-%m-%d-%H-%M-%S')" | ||
progress "Updating sphinx_rtd_theme" | ||
pushd sphinx_rtd_theme | ||
git checkout -f master | ||
git fetch origin | ||
|
@@ -115,28 +132,33 @@ find -name "parameters*rst" -delete # Clean possible built and cached parameters | |
|
||
END_UPDATES=$(date +%s) | ||
|
||
DO_PARAM_VERSIONING=true | ||
if $DO_PARAM_VERSIONING; then | ||
echo "[Buildlog] Starting to build multiple parameters pages at $(date '+%Y-%m-%d-%H-%M-%S')" | ||
python3 build_parameters.py | ||
END_BUILD_MPARAMS=$(date +%s) | ||
MPARAMS_TIME=$(echo "($END_BUILD_MPARAMS - $END_UPDATES)" | bc) | ||
echo "[Buildlog] Time to run build_parameters.py: $MPARAMS_TIME seconds" | ||
else | ||
# we use this hwne calculating times, below | ||
END_BUILD_MPARAMS=$END_UPDATES | ||
fi | ||
|
||
echo "[Buildlog] Starting to build the wiki at $(date '+%Y-%m-%d-%H-%M-%S')" | ||
# python3 update.py --clean --parallel 4 # Build without versioning for parameters. It is better for editing wiki. | ||
python3 update.py --destdir /var/sites/wiki/web --clean --paramversioning --parallel 4 --enablebackups --verbose # Enables parameters versioning and backups, should be used only on the wiki server | ||
progress "Starting to build multiple parameters pages" | ||
python3 build_parameters.py || { | ||
progress "build_parameters.py failed" | ||
exit 1 | ||
} | ||
END_BUILD_MPARAMS=$(date +%s) | ||
MPARAMS_TIME=$(echo "($END_BUILD_MPARAMS - $END_UPDATES)" | bc) | ||
progress "Time to run build_parameters.py: $MPARAMS_TIME seconds" | ||
|
||
progress "Starting to build the wiki" | ||
# python3 update.py --clean --parallel 4 # Build without versioning for parameters. It is better for editing wiki. | ||
python3 update.py --destdir /var/sites/wiki/web --clean --paramversioning --parallel 1 --enablebackups --verbose || { | ||
progress "update.py failed" | ||
exit 1 | ||
} | ||
|
||
END_BUILD_WIKI=$(date +%s) | ||
WIKI_TIME=$(echo "($END_BUILD_WIKI - $END_BUILD_MPARAMS)/60" | bc) | ||
echo "[Buildlog] Time to build the wiki itself: $WIKI_TIME minutes" | ||
progress "Time to build the wiki itself: $WIKI_TIME minutes" | ||
SCRIPT_TIME=$(echo "($END_BUILD_WIKI - $START)/60" | bc) | ||
echo "[Buildlog] Time to run the full script: $SCRIPT_TIME minutes" | ||
progress "Time to run the full script: $SCRIPT_TIME minutes" | ||
|
||
|
||
) >$LOGFILE 2>&1 || { | ||
progress "update.sh failed; see $LOGFILE" | ||
} | ||
|
||
cat $LOGFILE >> logs/update.log | ||
|
||
) >> update.log 2>&1 | ||
progress "update.sh finished" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleaned (spelling) - ok I see it's a pre-existing wierdness, but an opportunity to fix it? (and commite)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really a good time to fix this sort of thing. The variable needs a completely new name, not just a spelling fix :-)
... and I don't even know if "commite" comes from a language-other-than-English or is just a typo...