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



##########
File path: pom.xml
##########
@@ -1961,6 +1961,8 @@ under the License.
                                                        
<onlyModified>true</onlyModified>
                                                        <includes>
                                                                
<include>@org.apache.flink.annotation.Public</include>
+                                                               <!-- The 
following line must be un-commented for minor releases-->

Review comment:
       Maybe update the comment that this will be done automatically by a 
script?

##########
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:
       Isn't "major.minor.patch" the "[official](https://semver.org/)" 
terminology for versions?

##########
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:
       Shouldn't these changes go into `releasing/update_branch_version.sh`? 
This file here seems to be used for preparing release candidate branches. 
(According to 
https://cwiki.apache.org/confluence/display/FLINK/Creating+a+Flink+Release#CreatingaFlinkRelease-Createareleasebranch)
 

##########
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:
       I know that we are not using the right terminologies in Flink, but maybe 
this is our chance of slowly introducing new terms.

##########
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:
       Ah, so the idea is that the build of a `release-x.y.z-rci` branch would 
fail (as a last resort) because the japicmp plugin gets reconfigured as part of 
the release process.
   But ideally the release managers manually uncomment this one line in the pom 
in the `release-X.Y` branch.




----------------------------------------------------------------
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