Skip to content

Commit

Permalink
Release notes: correctly strip out none, n/a, no
Browse files Browse the repository at this point in the history
The previous regex was only matching lines and was not even correctly
doing so. We no match everything that is starting with none, n/a or
no as a sentence or as a full line. We also match empty string and
'.' as a full line.

RELNOTES: .
RELNOTES: None.
RELNOTES: No.

Change-Id: I6e85627170ce35e652c90a37e735b7db93c88b4e
PiperOrigin-RevId: 172452278
  • Loading branch information
damienmg authored and buchgr committed Oct 18, 2017
1 parent 7cebd1f commit 445a879
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/release/relnotes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function extract_release_note() {
if [[ "$relnote" =~ $regex ]]; then
local relnote_kind=${BASH_REMATCH[2]}
local relnote_text="${BASH_REMATCH[3]}"
if [[ ! "$(echo $relnote_text | awk '{print tolower($0)}')" =~ ^(none|n/a|no[ \.])?.?$ ]]; then
if [[ ! "$(echo $relnote_text | awk '{print tolower($0)}')" =~ ^((none|n/a|no)(\.( .*)?)?|\.)$ ]]; then
eval "RELNOTES_${relnote_kind}+=(\"\${relnote_text}\")"
fi
fi
Expand Down
13 changes: 13 additions & 0 deletions scripts/release/relnotes_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,17 @@ a9c46e5907be66248b6218ae70e0a1d999c696d5
assert_equals "${expected}" "${actual}"
}

function test_nonone_relnotes() {
git checkout -q 2ea4fa26281175c316651ec50784b820a9f409cf
local expected='Incompatible changes:
- --javabase=<absolute path> and --host_javabase=<absolute path>
are not supported anymore. If you need this functionality
java_runtime_suite(name="suite", default=":runtime")
java_runtime(name="runtime", java_home=<path to the JDK>) is an
alternative.'
local actual="$(release_notes 7c605cf6ea9755a06e5abb16a631faac8ebe2937)"
assert_equals "${expected}" "${actual}"
}

run_suite "Release notes generation tests"

0 comments on commit 445a879

Please sign in to comment.