From db13625aa123cd0b217fd70ba840b3685ffe0ecc Mon Sep 17 00:00:00 2001 From: Marcel Hlopko Date: Thu, 4 May 2017 16:04:23 +0200 Subject: Do not put PiperOrigin-RevId tag into relnotes Change-Id: If79da71d2939517724d92cbe470173b5d68e3019 PiperOrigin-RevId: 155075510 --- scripts/release/relnotes.sh | 8 +++++++- scripts/release/relnotes_test.sh | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'scripts/release') diff --git a/scripts/release/relnotes.sh b/scripts/release/relnotes.sh index aed0b5cc17..817ea621d7 100755 --- a/scripts/release/relnotes.sh +++ b/scripts/release/relnotes.sh @@ -77,7 +77,13 @@ function get_release_notes_commits() { # RELNOTES_NEW for new features changes # RELNOTES for other changes function extract_release_note() { - local relnote="$(git show -s $1 --pretty=format:%B | awk '/^RELNOTES(\[[^\]]+\])?:/,/^$/')" + local find_relnote_awk_script=" + BEGIN { in_relnote = 0 } + /^$/ { in_relnote = 0 } + /^PiperOrigin-RevId:.*$/ { in_relnote = 0 } + /^RELNOTES(\[[^\]]+\])?:/ { in_relnote = 1 } + { if (in_relnote) { print } }" + local relnote="$(git show -s $1 --pretty=format:%B | awk "${find_relnote_awk_script}")" local regex="^RELNOTES(\[([a-zA-Z]*)\])?:[[:space:]]*([^[:space:]].*[^[:space:]])[[:space:]]*$" if [[ "$relnote" =~ $regex ]]; then local relnote_kind=${BASH_REMATCH[2]} diff --git a/scripts/release/relnotes_test.sh b/scripts/release/relnotes_test.sh index 56278b1f46..0cf42b46ab 100755 --- a/scripts/release/relnotes_test.sh +++ b/scripts/release/relnotes_test.sh @@ -224,4 +224,18 @@ Cherry picks: assert_equals "$expected" "$actual" } +function test_extract_release_note_for_pre_copybara_commits() { + local expected='added --with_aspect_deps to blaze query, that prints additional information about aspects of target when --output is set to {xml, proto, record}.' + extract_release_note 14d905b5cce9a1bbc2911331809b03679b23dad1 + local actual=$(printf "%s\n" "${RELNOTES_NEW[@]}") + assert_equals "${expected}" "${actual}" +} + +function test_extract_release_note_for_post_copybara_commits() { + local expected="'output_groups' and 'instrumented_files' cannot be specified in DefaultInfo." + extract_release_note e788964a6ebc2c4966456ac74044f4f44a126fe5 + local actual=$(printf "%s\n" "${RELNOTES_[@]}") + assert_equals "${expected}" "${actual}" +} + run_suite "Release notes generation tests" -- cgit v1.2.3