Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 7cac900

Browse files
Spruce up the check-newsfragment CI output (#8024)
This PR: * Reduces the amount of noise in the `check-newsfragment` CI output by hiding the dependency installation output by default. * Prints a link to the changelog/debian changelog section of the contributing guide if an error is found.
1 parent 8ff2ded commit 7cac900

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

changelog.d/8024.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Reduce less useful output in the newsfragment CI step. Add a link to the changelog section of the contributing guide on error.

scripts-dev/check-newsfragment

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# A script which checks that an appropriate news file has been added on this
44
# branch.
55

6+
echo -e "+++ \033[32mChecking newsfragment\033[m"
7+
68
set -e
79

810
# make sure that origin/develop is up to date
@@ -16,6 +18,8 @@ pr="$BUILDKITE_PULL_REQUEST"
1618
if ! git diff --quiet FETCH_HEAD... -- debian; then
1719
if git diff --quiet FETCH_HEAD... -- debian/changelog; then
1820
echo "Updates to debian directory, but no update to the changelog." >&2
21+
echo "!! Please see the contributing guide for help writing your changelog entry:" >&2
22+
echo "https://github.com/matrix-org/synapse/blob/develop/CONTRIBUTING.md#debian-changelog" >&2
1923
exit 1
2024
fi
2125
fi
@@ -26,7 +30,12 @@ if ! git diff --name-only FETCH_HEAD... | grep -qv '^debian/'; then
2630
exit 0
2731
fi
2832

29-
tox -qe check-newsfragment
33+
# Print a link to the contributing guide if the user makes a mistake
34+
CONTRIBUTING_GUIDE_TEXT="!! Please see the contributing guide for help writing your changelog entry:
35+
https://github.com/matrix-org/synapse/blob/develop/CONTRIBUTING.md#changelog"
36+
37+
# If check-newsfragment returns a non-zero exit code, print the contributing guide and exit
38+
tox -qe check-newsfragment || (echo -e "$CONTRIBUTING_GUIDE_TEXT" >&2 && exit 1)
3039

3140
echo
3241
echo "--------------------------"
@@ -38,6 +47,7 @@ for f in `git diff --name-only FETCH_HEAD... -- changelog.d`; do
3847
lastchar=`tr -d '\n' < $f | tail -c 1`
3948
if [ $lastchar != '.' -a $lastchar != '!' ]; then
4049
echo -e "\e[31mERROR: newsfragment $f does not end with a '.' or '!'\e[39m" >&2
50+
echo -e "$CONTRIBUTING_GUIDE_TEXT" >&2
4151
exit 1
4252
fi
4353

@@ -47,5 +57,6 @@ done
4757

4858
if [[ -n "$pr" && "$matched" -eq 0 ]]; then
4959
echo -e "\e[31mERROR: Did not find a news fragment with the right number: expected changelog.d/$pr.*.\e[39m" >&2
60+
echo -e "$CONTRIBUTING_GUIDE_TEXT" >&2
5061
exit 1
5162
fi

0 commit comments

Comments
 (0)