From 6aa9b023f04e3151c85591ac02796c4536fa7958 Mon Sep 17 00:00:00 2001 From: Tusooa Zhu Date: Sun, 28 Aug 2022 11:13:36 -0400 Subject: Use dedicated script --- tools/check-changelog | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tools/check-changelog (limited to 'tools') diff --git a/tools/check-changelog b/tools/check-changelog new file mode 100644 index 000000000..970f3066f --- /dev/null +++ b/tools/check-changelog @@ -0,0 +1,22 @@ +#!/bin/sh + +echo $CI_MERGE_REQUEST_IID +ls changelog.d +count=0 +for i in add remove fix security skip; do + [ -f changelog.d/"$CI_MERGE_REQUEST_IID"."$i" ] + retcode=$? + if [ $retcode -eq 0 ]; then + echo "found $CI_MERGE_REQUEST_IID.$i" + else + echo "no $CI_MERGE_REQUEST_IID.$i" + fi + count=$(( $count + 1 - $retcode )) +done +if [ $count -eq 1 ]; then + echo "ok" + exit 0 +else + echo "must have a changelog entry or explicitly skip it" + exit 1 +fi -- cgit v1.2.3 From 89a40b867df13205e710c136e5c6cd9be1b76733 Mon Sep 17 00:00:00 2001 From: Haelwenn Date: Tue, 4 Apr 2023 16:20:46 +0000 Subject: Allow more than 1 changelog entry --- tools/check-changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/check-changelog b/tools/check-changelog index 970f3066f..c3e9e07c7 100644 --- a/tools/check-changelog +++ b/tools/check-changelog @@ -8,12 +8,12 @@ for i in add remove fix security skip; do retcode=$? if [ $retcode -eq 0 ]; then echo "found $CI_MERGE_REQUEST_IID.$i" + count=$(( count++ )) else echo "no $CI_MERGE_REQUEST_IID.$i" fi - count=$(( $count + 1 - $retcode )) done -if [ $count -eq 1 ]; then +if [ $count -gt 0 ]; then echo "ok" exit 0 else -- cgit v1.2.3 From 686c3e03bd6c13e732e95d2f81cc4bcd0acf015a Mon Sep 17 00:00:00 2001 From: tusooa Date: Tue, 4 Apr 2023 12:24:45 -0400 Subject: Fix counting --- tools/check-changelog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/check-changelog b/tools/check-changelog index c3e9e07c7..b94b52755 100644 --- a/tools/check-changelog +++ b/tools/check-changelog @@ -1,14 +1,14 @@ #!/bin/sh -echo $CI_MERGE_REQUEST_IID -ls changelog.d +echo "looking for change log of $CI_MERGE_REQUEST_IID" + count=0 for i in add remove fix security skip; do [ -f changelog.d/"$CI_MERGE_REQUEST_IID"."$i" ] retcode=$? if [ $retcode -eq 0 ]; then echo "found $CI_MERGE_REQUEST_IID.$i" - count=$(( count++ )) + count=$(( count + 1 )) else echo "no $CI_MERGE_REQUEST_IID.$i" fi -- cgit v1.2.3 From 50e237759a0aa378b32393ba57d50eaaff5029e0 Mon Sep 17 00:00:00 2001 From: tusooa Date: Sat, 22 Apr 2023 20:30:17 -0400 Subject: Use git diff to search for changelog entry --- tools/check-changelog | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'tools') diff --git a/tools/check-changelog b/tools/check-changelog index b94b52755..0b57c4d1e 100644 --- a/tools/check-changelog +++ b/tools/check-changelog @@ -1,22 +1,15 @@ #!/bin/sh -echo "looking for change log of $CI_MERGE_REQUEST_IID" +echo "looking for change log" -count=0 -for i in add remove fix security skip; do - [ -f changelog.d/"$CI_MERGE_REQUEST_IID"."$i" ] - retcode=$? - if [ $retcode -eq 0 ]; then - echo "found $CI_MERGE_REQUEST_IID.$i" - count=$(( count + 1 )) - else - echo "no $CI_MERGE_REQUEST_IID.$i" - fi -done -if [ $count -gt 0 ]; then - echo "ok" +git diff --raw $CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD -- changelog.d | \ + grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security\)$' +ret=$? + +if [ $ret -eq 0 ]; then + echo "found a changelog entry" exit 0 else - echo "must have a changelog entry or explicitly skip it" + echo "changelog entry not found" exit 1 fi -- cgit v1.2.3 From e13b331762881933d66597b3145b4d20d6e51912 Mon Sep 17 00:00:00 2001 From: tusooa Date: Sat, 22 Apr 2023 20:40:39 -0400 Subject: Fetch upstream in the repo --- tools/check-changelog | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/check-changelog b/tools/check-changelog index 0b57c4d1e..1409be9f0 100644 --- a/tools/check-changelog +++ b/tools/check-changelog @@ -2,7 +2,10 @@ echo "looking for change log" -git diff --raw $CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD -- changelog.d | \ +git remote add upstream https://git.pleroma.social/pleroma/pleroma.git +git fetch upstream ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}:refs/remotes/upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME + +git diff --raw upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD -- changelog.d | \ grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security\)$' ret=$? -- cgit v1.2.3 From 6a3fd8e01404f7fc4415626300d81c65c045a7d6 Mon Sep 17 00:00:00 2001 From: tusooa Date: Tue, 2 May 2023 22:16:00 -0400 Subject: Do not count for renames when diffing --- tools/check-changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/check-changelog b/tools/check-changelog index 1409be9f0..60692033f 100644 --- a/tools/check-changelog +++ b/tools/check-changelog @@ -5,7 +5,7 @@ echo "looking for change log" git remote add upstream https://git.pleroma.social/pleroma/pleroma.git git fetch upstream ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}:refs/remotes/upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME -git diff --raw upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD -- changelog.d | \ +git diff --raw --no-renames upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD -- changelog.d | \ grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security\)$' ret=$? -- cgit v1.2.3 From 6a13c2d180177692b976b179f0bd86f8f93e2803 Mon Sep 17 00:00:00 2001 From: tusooa Date: Wed, 25 Oct 2023 20:44:47 -0400 Subject: Add collect-changelog script --- tools/collect-changelog | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 tools/collect-changelog (limited to 'tools') diff --git a/tools/collect-changelog b/tools/collect-changelog new file mode 100755 index 000000000..1e12d5640 --- /dev/null +++ b/tools/collect-changelog @@ -0,0 +1,27 @@ +#!/bin/sh + +collectType() { + local suffix="$1" + local header="$2" + local printed=0 + for file in changelog.d/*."$suffix"; do + if [ '!' -f "$file" ]; then + continue + fi + if [ "$printed" = 0 ]; then + echo + echo "### $header" + printed=1 + fi + # Normalize any trailing newlines/spaces, etc. + echo "- $(cat "$file")" + done +} + +collectType security Security +collectType change Changed +collectType add Added +collectType fix Fixed +collectType remove Removed + +rm changelog.d/* -- cgit v1.2.3 From e1bc95ae6eb7a5474433a25268617277b3c9e85b Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Sat, 3 Jun 2023 14:03:51 -0400 Subject: Support a type called "change" --- tools/check-changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/check-changelog b/tools/check-changelog index 60692033f..64e59ae7f 100644 --- a/tools/check-changelog +++ b/tools/check-changelog @@ -6,7 +6,7 @@ git remote add upstream https://git.pleroma.social/pleroma/pleroma.git git fetch upstream ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}:refs/remotes/upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME git diff --raw --no-renames upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD -- changelog.d | \ - grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security\)$' + grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security|change\)$' ret=$? if [ $ret -eq 0 ]; then -- cgit v1.2.3 From addc5408ff570db955e06de1fbc4f7963538be04 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 8 Nov 2023 12:27:46 -0500 Subject: Fix changelogd grep syntax error --- tools/check-changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/check-changelog b/tools/check-changelog index 64e59ae7f..d053ed577 100644 --- a/tools/check-changelog +++ b/tools/check-changelog @@ -6,7 +6,7 @@ git remote add upstream https://git.pleroma.social/pleroma/pleroma.git git fetch upstream ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}:refs/remotes/upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME git diff --raw --no-renames upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD -- changelog.d | \ - grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security|change\)$' + grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security\|change\)$' ret=$? if [ $ret -eq 0 ]; then -- cgit v1.2.3 From 4648997a1017da68dcf5235e527e861f2c85cf91 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 15 Feb 2024 10:06:37 -0500 Subject: Support a new changelog entry type: deps --- tools/check-changelog | 2 +- tools/collect-changelog | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/check-changelog b/tools/check-changelog index d053ed577..28ef8454e 100644 --- a/tools/check-changelog +++ b/tools/check-changelog @@ -6,7 +6,7 @@ git remote add upstream https://git.pleroma.social/pleroma/pleroma.git git fetch upstream ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}:refs/remotes/upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME git diff --raw --no-renames upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD -- changelog.d | \ - grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security\|change\)$' + grep ' A\t' | grep '\.\(add\|change\|deps\|fix\|remove\|security\)$' ret=$? if [ $ret -eq 0 ]; then diff --git a/tools/collect-changelog b/tools/collect-changelog index 1e12d5640..d0e4905d4 100755 --- a/tools/collect-changelog +++ b/tools/collect-changelog @@ -23,5 +23,6 @@ collectType change Changed collectType add Added collectType fix Fixed collectType remove Removed +collectType deps Dependencies rm changelog.d/* -- cgit v1.2.3 From c9cd449bba73375c25f9ef4c31caf80d0506ff63 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Fri, 16 Feb 2024 12:51:39 -0500 Subject: Revert "Support a new changelog entry type: deps" This reverts commit 4648997a1017da68dcf5235e527e861f2c85cf91. --- tools/check-changelog | 2 +- tools/collect-changelog | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/check-changelog b/tools/check-changelog index 28ef8454e..d053ed577 100644 --- a/tools/check-changelog +++ b/tools/check-changelog @@ -6,7 +6,7 @@ git remote add upstream https://git.pleroma.social/pleroma/pleroma.git git fetch upstream ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}:refs/remotes/upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME git diff --raw --no-renames upstream/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME HEAD -- changelog.d | \ - grep ' A\t' | grep '\.\(add\|change\|deps\|fix\|remove\|security\)$' + grep ' A\t' | grep '\.\(skip\|add\|remove\|fix\|security\|change\)$' ret=$? if [ $ret -eq 0 ]; then diff --git a/tools/collect-changelog b/tools/collect-changelog index d0e4905d4..1e12d5640 100755 --- a/tools/collect-changelog +++ b/tools/collect-changelog @@ -23,6 +23,5 @@ collectType change Changed collectType add Added collectType fix Fixed collectType remove Removed -collectType deps Dependencies rm changelog.d/* -- cgit v1.2.3