zentol commented on a change in pull request #12340:
URL: https://github.com/apache/flink/pull/12340#discussion_r430530801



##########
File path: tools/releasing/create_release_branch.sh
##########
@@ -59,6 +59,22 @@ git checkout -b $target_branch
 #change version in all pom files
 find . -name 'pom.xml' -type f -exec perl -pi -e 
's#<version>(.*)'$OLD_VERSION'(.*)</version>#<version>${1}'$NEW_VERSION'${2}</version>#'
 {} \;
 
+ultra=$(echo "${NEW_VERSION}" | perl -p -e 's#(\d+)\.\d+\.\d+#$1#')
+major=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.(\d+)\.\d+#$1#')
+minor=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.\d+\.(\d+)#$1#')

Review comment:
       no;  we use ?.major.minor unfortunately.

##########
File path: tools/releasing/create_release_branch.sh
##########
@@ -59,6 +59,22 @@ git checkout -b $target_branch
 #change version in all pom files
 find . -name 'pom.xml' -type f -exec perl -pi -e 
's#<version>(.*)'$OLD_VERSION'(.*)</version>#<version>${1}'$NEW_VERSION'${2}</version>#'
 {} \;
 
+ultra=$(echo "${NEW_VERSION}" | perl -p -e 's#(\d+)\.\d+\.\d+#$1#')
+major=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.(\d+)\.\d+#$1#')
+minor=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.\d+\.(\d+)#$1#')
+
+# update japicmp configuration
+if [[ ${minor} == "0" ]]; then
+  # set japicmp reference version to previous major version
+  perl -pi -e 
's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${ultra}.$((${major}-1)).0'${2}#'
 pom.xml
+else
+  # set japicmp reference version to previous minor version
+  perl -pi -e 
's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${ultra}.${major}.$(($minor
 - 1))'${2}#' pom.xml
+  # harden compatibility constraints for minor versions
+  perl -pi -e 
's#<!--(<include>\@org.apache.flink.annotation.PublicEvolving</include>)-->#${1}#'
 pom.xml
+  perl -pi -e 
's#\t+<exclude>\@org.apache.flink.annotation.PublicEvolving.*\n##' pom.xml
+fi

Review comment:
       hmm, you're right, but I think we should have both.
   
   For the release-X.Y branches we have to update the configuration manually, 
so this PR is more of a final safeguard for actual releases in case the the 
update is forgotten, which is basically guaranteed to happen at some point.

##########
File path: tools/releasing/create_release_branch.sh
##########
@@ -59,6 +59,22 @@ git checkout -b $target_branch
 #change version in all pom files
 find . -name 'pom.xml' -type f -exec perl -pi -e 
's#<version>(.*)'$OLD_VERSION'(.*)</version>#<version>${1}'$NEW_VERSION'${2}</version>#'
 {} \;
 
+ultra=$(echo "${NEW_VERSION}" | perl -p -e 's#(\d+)\.\d+\.\d+#$1#')
+major=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.(\d+)\.\d+#$1#')
+minor=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.\d+\.(\d+)#$1#')
+
+# update japicmp configuration
+if [[ ${minor} == "0" ]]; then
+  # set japicmp reference version to previous major version
+  perl -pi -e 
's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${ultra}.$((${major}-1)).0'${2}#'
 pom.xml
+else
+  # set japicmp reference version to previous minor version
+  perl -pi -e 
's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${ultra}.${major}.$(($minor
 - 1))'${2}#' pom.xml
+  # harden compatibility constraints for minor versions
+  perl -pi -e 
's#<!--(<include>\@org.apache.flink.annotation.PublicEvolving</include>)-->#${1}#'
 pom.xml
+  perl -pi -e 
's#\t+<exclude>\@org.apache.flink.annotation.PublicEvolving.*\n##' pom.xml
+fi

Review comment:
       hmm, you're right, but I think we should have both.
   
   For the release-X.Y branches we have to update the configuration manually, 
so this PR is more of a final safeguard for actual releases in case the the 
manual update is forgotten, which is basically guaranteed to happen at some 
point.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to