From 3b5c59ec04f8db6c66f5dfed3ac5b043b26c67d2 Mon Sep 17 00:00:00 2001 From: nakulj Date: Fri, 12 Jul 2024 09:46:49 -0700 Subject: [PATCH] fix backwards compatibility check (#1361) --- .github/scripts/backwards_compatibility_check.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/scripts/backwards_compatibility_check.sh b/.github/scripts/backwards_compatibility_check.sh index 7094fd7dc..78f95cc60 100755 --- a/.github/scripts/backwards_compatibility_check.sh +++ b/.github/scripts/backwards_compatibility_check.sh @@ -67,7 +67,16 @@ find_removed_methods() { then echo "New minor release is being performed. Ignoring changes in classes marked with @KinesisClientInternalApi annotation." fi - local latest_classes=$(jar tf $LATEST_JAR | grep .class | tr / . | sed 's/\.class$//') + local latest_classes=$( + jar tf $LATEST_JAR | + grep .class | + tr / . | + sed 's/\.class$//' | + # skip generated proto classes since these have a lot of inherited methods + # that are not outputted by javap. besides, generated java code is not a + # good indicator of proto compatibility- it will not capture reserved + # tags or deprecated fields. + grep -v 'software\.amazon\.kinesis\.retrieval\.kpl\.Messages') for class in $latest_classes do if (is_kinesis_client_internal_api "$class" && is_new_minor_release) || is_non_public_class "$class" @@ -83,7 +92,7 @@ find_removed_methods() { local removed_methods=$(diff <(echo "$LATEST_METHODS") <(echo "$CURRENT_METHODS") | grep '^<') # ignore synthetic access methods - these are not available to users and will not break backwards compatibility - removed_methods=$(echo "$removed_methods" | grep -v "access\$[0-9]00") + removed_methods=$(echo "$removed_methods" | grep -v "access\$[0-9]\+") if [[ "$removed_methods" != "" ]] then @@ -116,4 +125,4 @@ main() { get_backwards_compatible_result } -main \ No newline at end of file +main