Skip to content
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

travis: warn about differing .travis.yml #4921

Merged
merged 2 commits into from
Mar 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions dist/tools/travis-scripts/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,31 @@ then
if [ "$BUILDTEST_MCU_GROUP" == "static-tests" ]
then
RESULT=0
RECALL="$1"

if git diff master HEAD -- .travis.yml &> /dev/null; then
# check if .travis.yml was changed in the current PR and skip if so
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the change to the travis file was intended?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? I hope changes to the .travis.yml are always intended (otherwise the reviewer does a really bad job). I don't understand your question... This test is testing if the .travis.yml was changed compared to master. If the change happen in the PR that triggered the build (i.e. it is most likely a PR that changed the .travis.yml) this test passes. Otherwise, .travis.yml was changed in master, leading to the problems described in #4920

if ! git diff --name-only $(git merge-base HEAD master)..HEAD -- \
.travis.yml &> 1; then
echo "==============================================================" >&2
echo -e "\033[1;31m.travis.yml differs in upstream.\033[0m"
echo -e "\033[1;31mPlease rebase your PR to current upstream or expect errors!!!!\033[0m" >&2
echo " git fetch https://github.com/RIOT-OS/RIOT master" >&2
echo " git rebase FETCH_HEAD" >&2
echo " git push -f origin $(git rev-parse --abbrev-ref HEAD)" >&2
echo "==============================================================" >&2
return 1
fi
fi

if [ "$RECALL" != "recall" ]; then
if git diff master HEAD -- "$0" &> /dev/null; then
git rebase master || git rebase --abort

"$0" "recall"
exit $?
fi
fi

git rebase master || git rebase --abort
RESULT=$(set_result $? $RESULT)
Expand Down