From c760014c9dc0a59116f4d92c0eb82463350e2eb1 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 3 Aug 2020 11:10:42 -0700 Subject: [PATCH 1/5] Add link to contributing guide to check-newsfragment err output --- scripts-dev/check-newsfragment | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts-dev/check-newsfragment b/scripts-dev/check-newsfragment index 98a618f6b2de..4230db3a5bf7 100755 --- a/scripts-dev/check-newsfragment +++ b/scripts-dev/check-newsfragment @@ -16,6 +16,8 @@ pr="$BUILDKITE_PULL_REQUEST" if ! git diff --quiet FETCH_HEAD... -- debian; then if git diff --quiet FETCH_HEAD... -- debian/changelog; then echo "Updates to debian directory, but no update to the changelog." >&2 + echo "Please see the contributing guide for more information:" >&2 + echo "https://github.com/matrix-org/synapse/blob/develop/CONTRIBUTING.md#debian-changelog" >&2 exit 1 fi fi @@ -26,7 +28,12 @@ if ! git diff --name-only FETCH_HEAD... | grep -qv '^debian/'; then exit 0 fi -tox -qe check-newsfragment +# Print a link to the contributing guide if the user makes a mistake +CONTRIBUTING_GUIDE_TEXT="Please see the contributing guide for more information: +https://github.com/matrix-org/synapse/blob/develop/CONTRIBUTING.md#changelog" + +# If check-newsfragment returns a non-zero exit code, print the contributing guide and exit +tox -qe check-newsfragment || (echo -e "$CONTRIBUTING_GUIDE_TEXT" >&2 && exit 1) echo echo "--------------------------" @@ -38,6 +45,7 @@ for f in `git diff --name-only FETCH_HEAD... -- changelog.d`; do 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 + echo -e "$CONTRIBUTING_GUIDE_TEXT" >&2 exit 1 fi @@ -47,5 +55,6 @@ 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 + echo -e "$CONTRIBUTING_GUIDE_TEXT" >&2 exit 1 fi From 4f7a509287165a686c41eefe4f623da9e781bc5e Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 3 Aug 2020 11:25:45 -0700 Subject: [PATCH 2/5] Make the question stand out more --- scripts-dev/check-newsfragment | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts-dev/check-newsfragment b/scripts-dev/check-newsfragment index 4230db3a5bf7..c44faaf81dbf 100755 --- a/scripts-dev/check-newsfragment +++ b/scripts-dev/check-newsfragment @@ -16,7 +16,7 @@ pr="$BUILDKITE_PULL_REQUEST" if ! git diff --quiet FETCH_HEAD... -- debian; then if git diff --quiet FETCH_HEAD... -- debian/changelog; then echo "Updates to debian directory, but no update to the changelog." >&2 - echo "Please see the contributing guide for more information:" >&2 + echo "!! Please see the contributing guide for more information:" >&2 echo "https://github.com/matrix-org/synapse/blob/develop/CONTRIBUTING.md#debian-changelog" >&2 exit 1 fi @@ -29,7 +29,7 @@ if ! git diff --name-only FETCH_HEAD... | grep -qv '^debian/'; then fi # Print a link to the contributing guide if the user makes a mistake -CONTRIBUTING_GUIDE_TEXT="Please see the contributing guide for more information: +CONTRIBUTING_GUIDE_TEXT="!! Please see the contributing guide for more information: https://github.com/matrix-org/synapse/blob/develop/CONTRIBUTING.md#changelog" # If check-newsfragment returns a non-zero exit code, print the contributing guide and exit From 267aac524a10df40b2a6980044008841c4088b7e Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 3 Aug 2020 11:26:16 -0700 Subject: [PATCH 3/5] Add a by-default open section to the log output So users don't have to click-to-expand to see error messages/hints --- scripts-dev/check-newsfragment | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts-dev/check-newsfragment b/scripts-dev/check-newsfragment index c44faaf81dbf..8b9ad293ed86 100755 --- a/scripts-dev/check-newsfragment +++ b/scripts-dev/check-newsfragment @@ -3,6 +3,8 @@ # A script which checks that an appropriate news file has been added on this # branch. +echo -e "+++ \033[32mChecking newsfragment\033[m" + set -e # make sure that origin/develop is up to date From 8a176a2d4c85609b39a7da7af4c18d79391b1e4e Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 3 Aug 2020 11:35:28 -0700 Subject: [PATCH 4/5] Change the wording slightly --- scripts-dev/check-newsfragment | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts-dev/check-newsfragment b/scripts-dev/check-newsfragment index 8b9ad293ed86..448cadb8298c 100755 --- a/scripts-dev/check-newsfragment +++ b/scripts-dev/check-newsfragment @@ -18,7 +18,7 @@ pr="$BUILDKITE_PULL_REQUEST" if ! git diff --quiet FETCH_HEAD... -- debian; then if git diff --quiet FETCH_HEAD... -- debian/changelog; then echo "Updates to debian directory, but no update to the changelog." >&2 - echo "!! Please see the contributing guide for more information:" >&2 + echo "!! Please see the contributing guide for help writing your changelog entry:" >&2 echo "https://github.com/matrix-org/synapse/blob/develop/CONTRIBUTING.md#debian-changelog" >&2 exit 1 fi @@ -31,7 +31,7 @@ if ! git diff --name-only FETCH_HEAD... | grep -qv '^debian/'; then fi # Print a link to the contributing guide if the user makes a mistake -CONTRIBUTING_GUIDE_TEXT="!! Please see the contributing guide for more information: +CONTRIBUTING_GUIDE_TEXT="!! Please see the contributing guide for help writing your changelog entry: https://github.com/matrix-org/synapse/blob/develop/CONTRIBUTING.md#changelog" # If check-newsfragment returns a non-zero exit code, print the contributing guide and exit From 73d6eac3081b32e4be35383e2abc3bfbd773e6ac Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 3 Aug 2020 11:38:56 -0700 Subject: [PATCH 5/5] Changelog --- changelog.d/8024.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/8024.misc diff --git a/changelog.d/8024.misc b/changelog.d/8024.misc new file mode 100644 index 000000000000..4bc739502bf6 --- /dev/null +++ b/changelog.d/8024.misc @@ -0,0 +1 @@ +Reduce less useful output in the newsfragment CI step. Add a link to the changelog section of the contributing guide on error. \ No newline at end of file