summary refs log tree commit diff
path: root/scripts-dev/check-newsfragment
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2020-06-24 15:43:15 +0100
committerGitHub <noreply@github.com>2020-06-24 15:43:15 +0100
commit4200f54ca7bc1aeecb0c8236ab0e9b958b24afab (patch)
tree3994a75d145e0b6bb5e9439c53fa0884e2de3595 /scripts-dev/check-newsfragment
parentPrevent M_USER_IN_USE from being raised by registration methods until after e... (diff)
parentChangelog (diff)
downloadsynapse-4200f54ca7bc1aeecb0c8236ab0e9b958b24afab.tar.xz
Merge pull request #50 from matrix-org/dinsic-release-v1.15.x
Merge mainline release v1.15.1 into dinsic
Diffstat (limited to 'scripts-dev/check-newsfragment')
-rwxr-xr-xscripts-dev/check-newsfragment20
1 files changed, 16 insertions, 4 deletions
diff --git a/scripts-dev/check-newsfragment b/scripts-dev/check-newsfragment

index b8a85abe18..b55368ea6b 100755 --- a/scripts-dev/check-newsfragment +++ b/scripts-dev/check-newsfragment
@@ -7,7 +7,9 @@ set -e # make sure that origin/dinsic is up to date git remote set-branches --add origin dinsic -git fetch origin dinsic +git fetch -q origin dinsic + +pr="$BUILDKITE_PULL_REQUEST" # if there are changes in the debian directory, check that the debian changelog # has been updated @@ -20,20 +22,30 @@ fi # if there are changes *outside* the debian directory, check that the # newsfragments have been updated. -if git diff --name-only FETCH_HEAD... | grep -qv '^debian/'; then - tox -e check-newsfragment +if ! git diff --name-only FETCH_HEAD... | grep -qv '^debian/'; then + exit 0 fi +tox -qe check-newsfragment + echo echo "--------------------------" echo -# check that any new newsfiles on this branch end with a full stop. +matched=0 for f in `git diff --name-only FETCH_HEAD... -- changelog.d`; do + # check that any modified newsfiles on this branch end with a full stop. lastchar=`tr -d '\n' < $f | tail -c 1` if [ $lastchar != '.' -a $lastchar != '!' ]; then echo -e "\e[31mERROR: newsfragment $f does not end with a '.' or '!'\e[39m" >&2 exit 1 fi + + # see if this newsfile corresponds to the right PR + [[ -n "$pr" && "$f" == changelog.d/"$pr".* ]] && matched=1 done +if [[ -n "$pr" && "$matched" -eq 0 ]]; then + echo -e "\e[31mERROR: Did not find a news fragment with the right number: expected changelog.d/$pr.*.\e[39m" >&2 + exit 1 +fi