From 6fb405f0bb0001bedf3af6d1cf7672f9e477ebac Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Fri, 7 Feb 2025 18:02:08 +0100 Subject: [PATCH 1/2] Report list of modified upgrade.txt or UPGRADING.md files Signed-off-by: Daniel Ziegenberg --- remote_branch_checker/remote_branch_checker.sh | 6 ++++++ .../local_ci_fixture_upgrade_txt_for_405.regex | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/remote_branch_checker/remote_branch_checker.sh b/remote_branch_checker/remote_branch_checker.sh index c64a190..897cc9d 100755 --- a/remote_branch_checker/remote_branch_checker.sh +++ b/remote_branch_checker/remote_branch_checker.sh @@ -321,6 +321,12 @@ mv ${WORKSPACE}/work/patchset.files.tmp ${WORKSPACE}/work/patchset.files if [[ ${versionbranch} -ge 405 ]]; then if grep -q 'UPGRADING.md\|upgrade.txt' ${WORKSPACE}/work/patchset.files; then echo "Error: The patchset contains changes to upgrade.txt or UPGRADING.md files." | tee -a ${errorfile} + + dirtyupgrades="$( grep 'UPGRADING.md\|upgrade.txt' ${WORKSPACE}/work/patchset.files )" + if [[ -n "${dirtyupgrades}" ]]; then + echo "Error: File(s) affected:" | tee -a ${errorfile} + echo "${dirtyupgrades}" | sed "/^${WORKSPACE}//g" | sed 's/^/Error: /' | tee -a ${errorfile} + fi fi fi diff --git a/tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_txt_for_405.regex b/tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_txt_for_405.regex index 563714d..14ea503 100644 --- a/tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_txt_for_405.regex +++ b/tests/fixtures/remote_branch_checker/local_ci_fixture_upgrade_txt_for_405.regex @@ -5,3 +5,8 @@ condensedresult="smurf,error,1,0:overview,error,1,0 The patchset contains changes to upgrade.txt or UPGRADING.md files. +File(s) affected: +UPGRADING.md +lib/upgrade.txt +mod/assign/UPGRADING.md +mod/assign/upgrade.txt From 9d833064150b291235705cdb3a081c7566819d93 Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Fri, 7 Feb 2025 18:15:50 +0100 Subject: [PATCH 2/2] Accommodate for changes in vendored UPGRADING.md files Signed-off-by: Daniel Ziegenberg --- remote_branch_checker/remote_branch_checker.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/remote_branch_checker/remote_branch_checker.sh b/remote_branch_checker/remote_branch_checker.sh index 897cc9d..f13aae7 100755 --- a/remote_branch_checker/remote_branch_checker.sh +++ b/remote_branch_checker/remote_branch_checker.sh @@ -318,11 +318,12 @@ sed '/^$/d' ${WORKSPACE}/work/patchset.files > ${WORKSPACE}/work/patchset.files. mv ${WORKSPACE}/work/patchset.files.tmp ${WORKSPACE}/work/patchset.files # For 4.5 and up, verify that the we aren't modifying any upgrade.txt or UPGRADING.md files. +# lib/guzzlehttp/guzzle/UPGRADING.md is a false positive. It's a vendored file. if [[ ${versionbranch} -ge 405 ]]; then - if grep -q 'UPGRADING.md\|upgrade.txt' ${WORKSPACE}/work/patchset.files; then + if sed '/lib\/guzzlehttp\/guzzle\/UPGRADING.md/d' ${WORKSPACE}/work/patchset.files | grep -q 'UPGRADING.md\|upgrade.txt'; then echo "Error: The patchset contains changes to upgrade.txt or UPGRADING.md files." | tee -a ${errorfile} - dirtyupgrades="$( grep 'UPGRADING.md\|upgrade.txt' ${WORKSPACE}/work/patchset.files )" + dirtyupgrades="$( sed '/lib\/guzzlehttp\/guzzle\/UPGRADING.md/d' ${WORKSPACE}/work/patchset.files | grep 'UPGRADING.md\|upgrade.txt' )" if [[ -n "${dirtyupgrades}" ]]; then echo "Error: File(s) affected:" | tee -a ${errorfile} echo "${dirtyupgrades}" | sed "/^${WORKSPACE}//g" | sed 's/^/Error: /' | tee -a ${errorfile}