From 668d59a4b0b054792425f2b02bc4df4e440eb5af Mon Sep 17 00:00:00 2001 From: Vincent Viloria Date: Mon, 15 Apr 2024 16:54:43 -0700 Subject: [PATCH] exclude classes with KinesisClientInternalApi annotation from backwards compatibility check --- .github/scripts/backwards_compatibility_check.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/scripts/backwards_compatibility_check.sh b/.github/scripts/backwards_compatibility_check.sh index 77d417a8..2a4a5962 100755 --- a/.github/scripts/backwards_compatibility_check.sh +++ b/.github/scripts/backwards_compatibility_check.sh @@ -31,10 +31,13 @@ diff <(echo "$LATEST_PACKAGES") <(echo "$CURRENT_PACKAGES") | grep '^<' && REMOV echo "Checking if methods in $LATEST_VERSION were removed in $CURRENT_VERSION" for package in $LATEST_PACKAGES do - # Get the second line of the output which indicates whether a class is public. Only classes that - # are public should be checked; other classes will not break backwards compatibility. + # Skip classes which are not public. Only public class should be checked since other classes will not break backwards compatibility. CLASS_DEFINITION=$(javap -classpath $LATEST_JAR $package | head -2 | tail -1) - if [[ $CLASS_DEFINITION != *"public"* ]] + + # Skip classes with the KinesisClientInternalApi annotation. These classes are subject to breaking backwards compatibility. + INTERNAL_API_RESULT=$(javap -v -classpath $LATEST_JAR $package | grep KinesisClientInternalApi) + + if [[ $CLASS_DEFINITION != *"public"* || $INTERNAL_API_RESULT != "" ]] then continue fi