[v2] devtools: warn about release notes updates

Message ID 20210520103938.18069-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] devtools: warn about release notes updates |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-abi-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Functional fail Functional Testing issues
ci/iol-mellanox-Performance fail Performance Testing issues
ci/iol-testing fail Testing issues

Commit Message

David Marchand May 20, 2021, 10:39 a.m. UTC
  Touching release notes should only be for the current version.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
Changes since v1:
- dropped unrelevant change,
- simplified VERSION extract and updated variable names,

---
 devtools/checkpatches.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
  

Comments

Thomas Monjalon May 20, 2021, 9:13 p.m. UTC | #1
20/05/2021 12:39, David Marchand:
> Touching release notes should only be for the current version.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Applied, thanks
  

Patch

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index db4c7d8301..aff7d2a161 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -198,6 +198,15 @@  check_internal_tags() { # <patch>
 	return $res
 }
 
+check_release_notes() { # <patch>
+	rel_notes_prefix=doc/guides/rel_notes/release_
+	IFS=. read year month release < VERSION
+	current_rel_notes=${rel_notes_prefix}${year}_${month}.rst
+
+	! grep -e '^--- a/'$rel_notes_prefix -e '^+++ b/'$rel_notes_prefix $1 |
+		grep -v $current_rel_notes
+}
+
 number=0
 range='origin/main..'
 quiet=false
@@ -289,6 +298,14 @@  check () { # <patch> <commit> <title>
 		ret=1
 	fi
 
+	! $verbose || printf '\nChecking release notes updates:\n'
+	report=$(check_release_notes "$tmpinput")
+	if [ $? -ne 0 ] ; then
+		$headline_printed || print_headline "$3"
+		printf '%s\n' "$report"
+		ret=1
+	fi
+
 	if [ "$tmpinput" != "$1" ]; then
 		rm -f "$tmpinput"
 		trap - INT