You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/05/27 03:35:41 UTC

[GitHub] [flink] zentol opened a new pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

zentol opened a new pull request #12340:
URL: https://github.com/apache/flink/pull/12340


   This PR makes 2 changes to the `create_release_branch` release script:
   
   1) The japicmp reference version is now automatically updated.
      - For a major release x.y.0 the reference version is x.y-1.0
         - 1.10.0 checks against 1.9.0
      - For a minor release x.y.z the reference version is x.y.z-1
         - 1.10.1 checks against 1.10.0
   
   2) Enforce `@PublicEvolving` compatibility for minor versions
      - remove japicmp exclusion
      - un-comment the newly added japicmp inclusion


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-633979204


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2207",
       "triggerID" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2279",
       "triggerID" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "triggerType" : "PUSH"
     }, {
       "hash" : "122bae66113d7f2430c2568d594d39e38fe22585",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2292",
       "triggerID" : "122bae66113d7f2430c2568d594d39e38fe22585",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4c67c51b003823e1abd4373963f7d1ea53e829b6 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2207) 
   * b3a0dab10d3615b52001b02e3b5143274d0ddb08 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2279) 
   * 122bae66113d7f2430c2568d594d39e38fe22585 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2292) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] zentol commented on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
zentol commented on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-634127129


   A separate profile is imo overkill, when all we really need is to move one entry.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] zentol commented on a change in pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #12340:
URL: https://github.com/apache/flink/pull/12340#discussion_r431012339



##########
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:
       Doing that will just introduce confusion; recent discussions on the ML showed that several devs were not aware of our version scheme, so it could easily happen that another one sees this and thinks that's what we are using.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] zentol commented on a change in pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [flink] zentol merged pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
zentol merged pull request #12340:
URL: https://github.com/apache/flink/pull/12340


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-633979204


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2207",
       "triggerID" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2279",
       "triggerID" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "triggerType" : "PUSH"
     }, {
       "hash" : "122bae66113d7f2430c2568d594d39e38fe22585",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2292",
       "triggerID" : "122bae66113d7f2430c2568d594d39e38fe22585",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 122bae66113d7f2430c2568d594d39e38fe22585 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2292) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-633979204


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2207",
       "triggerID" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2279",
       "triggerID" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "triggerType" : "PUSH"
     }, {
       "hash" : "122bae66113d7f2430c2568d594d39e38fe22585",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "122bae66113d7f2430c2568d594d39e38fe22585",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4c67c51b003823e1abd4373963f7d1ea53e829b6 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2207) 
   * b3a0dab10d3615b52001b02e3b5143274d0ddb08 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2279) 
   * 122bae66113d7f2430c2568d594d39e38fe22585 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] zentol commented on a change in pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #12340:
URL: https://github.com/apache/flink/pull/12340#discussion_r431463367



##########
File path: tools/releasing/update_japicmp_configuration.sh
##########
@@ -0,0 +1,83 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+if [ -z "${NEW_VERSION}" ]; then
+    echo "NEW_VERSION was not set."
+    exit 1
+fi
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+# Idealized use-cases:
+# Scenario A) New major release X.Y.0
+#   Premise:
+#     There is a master branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.(Y-1).0 .
+#   Release flow:
+#     - update the master to X.(Y+1)-SNAPSHOT, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - create X.Y-SNAPSHOT branch, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - release X.Y.0
+#     - update the japicmp reference version of both master and X.Y-SNAPSHOT to X.Y.0
+#     - enable stronger compatibility constraints for X.Y-SNAPSHOT to ensure compatibility for PublicEvolving
+# Scenario B) New minor release X.Y.Z
+#   Premise:
+#     There is a snapshot branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.Y.(Z-1)
+#   Release flow:
+#     - create X.Y.Z-rc branch
+#     - update the japicmp reference version of X.Y.Z to X.Y.(Z-1)
+#     - release X.Y.Z
+#     - update the japicmp reference version of X.Y-SNAPSHOT to X.Y.Z
+
+POM=../pom.xml
+function enable_public_evolving_compatibility_checks() {
+  perl -pi -e 's#<!--(<include>\@org.apache.flink.annotation.PublicEvolving</include>)-->#${1}#' ${POM}
+  perl -pi -e 's#\t+<exclude>\@org.apache.flink.annotation.PublicEvolving.*\n##' ${POM}
+}
+
+function set_japicmp_reference_version() {
+  local version=$1
+
+  perl -pi -e 's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${version}'${2}#' ${POM}
+}
+
+current_branch=$(git rev-parse --abbrev-ref HEAD)
+
+if [[ ${current_branch} =~ -rc ]]; then
+  # release branch
+  version_prefix=$(echo "${NEW_VERSION}" | perl -p -e 's#(\d+\.\d+)\.\d+#$1#')
+  minor=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.\d+\.(\d+)#$1#')
+  if ! [[ ${minor} == "0" ]]; then
+    set_japicmp_reference_version ${version_prefix}.$((minor - 1))
+    # this is a safeguard in case the manual step of enabling checks after the X.Y.0 release was forgotten
+    enable_public_evolving_compatibility_checks
+  fi
+elif [[ ${current_branch} =~ -SNAPSHOT ]]; then

Review comment:
       When for example we just released 1.11.0 and want to updated 1.11-SNAPSHOT to check against 1.11.0 and enable compatibility guarantees .




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on a change in pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
rmetzger commented on a change in pull request #12340:
URL: https://github.com/apache/flink/pull/12340#discussion_r431413495



##########
File path: tools/releasing/update_japicmp_configuration.sh
##########
@@ -0,0 +1,83 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+if [ -z "${NEW_VERSION}" ]; then
+    echo "NEW_VERSION was not set."
+    exit 1
+fi
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+# Idealized use-cases:
+# Scenario A) New major release X.Y.0
+#   Premise:
+#     There is a master branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.(Y-1).0 .
+#   Release flow:
+#     - update the master to X.(Y+1)-SNAPSHOT, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - create X.Y-SNAPSHOT branch, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - release X.Y.0
+#     - update the japicmp reference version of both master and X.Y-SNAPSHOT to X.Y.0
+#     - enable stronger compatibility constraints for X.Y-SNAPSHOT to ensure compatibility for PublicEvolving
+# Scenario B) New minor release X.Y.Z
+#   Premise:
+#     There is a snapshot branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.Y.(Z-1)
+#   Release flow:
+#     - create X.Y.Z-rc branch
+#     - update the japicmp reference version of X.Y.Z to X.Y.(Z-1)
+#     - release X.Y.Z
+#     - update the japicmp reference version of X.Y-SNAPSHOT to X.Y.Z
+
+POM=../pom.xml
+function enable_public_evolving_compatibility_checks() {
+  perl -pi -e 's#<!--(<include>\@org.apache.flink.annotation.PublicEvolving</include>)-->#${1}#' ${POM}
+  perl -pi -e 's#\t+<exclude>\@org.apache.flink.annotation.PublicEvolving.*\n##' ${POM}
+}
+
+function set_japicmp_reference_version() {
+  local version=$1
+
+  perl -pi -e 's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${version}'${2}#' ${POM}
+}
+
+current_branch=$(git rev-parse --abbrev-ref HEAD)
+
+if [[ ${current_branch} =~ -rc ]]; then
+  # release branch
+  version_prefix=$(echo "${NEW_VERSION}" | perl -p -e 's#(\d+\.\d+)\.\d+#$1#')
+  minor=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.\d+\.(\d+)#$1#')
+  if ! [[ ${minor} == "0" ]]; then
+    set_japicmp_reference_version ${version_prefix}.$((minor - 1))
+    # this is a safeguard in case the manual step of enabling checks after the X.Y.0 release was forgotten
+    enable_public_evolving_compatibility_checks
+  fi
+elif [[ ${current_branch} =~ -SNAPSHOT ]]; then

Review comment:
       when do we have a branch name containing "-SNAPSHOT"? Shouldn't this be a check on the version set in the ./pom.xml ?

##########
File path: tools/releasing/update_japicmp_configuration.sh
##########
@@ -0,0 +1,83 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+if [ -z "${NEW_VERSION}" ]; then
+    echo "NEW_VERSION was not set."
+    exit 1
+fi
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+# Idealized use-cases:
+# Scenario A) New major release X.Y.0
+#   Premise:
+#     There is a master branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.(Y-1).0 .
+#   Release flow:
+#     - update the master to X.(Y+1)-SNAPSHOT, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - create X.Y-SNAPSHOT branch, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - release X.Y.0
+#     - update the japicmp reference version of both master and X.Y-SNAPSHOT to X.Y.0
+#     - enable stronger compatibility constraints for X.Y-SNAPSHOT to ensure compatibility for PublicEvolving
+# Scenario B) New minor release X.Y.Z
+#   Premise:
+#     There is a snapshot branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.Y.(Z-1)
+#   Release flow:
+#     - create X.Y.Z-rc branch
+#     - update the japicmp reference version of X.Y.Z to X.Y.(Z-1)
+#     - release X.Y.Z
+#     - update the japicmp reference version of X.Y-SNAPSHOT to X.Y.Z
+
+POM=../pom.xml
+function enable_public_evolving_compatibility_checks() {
+  perl -pi -e 's#<!--(<include>\@org.apache.flink.annotation.PublicEvolving</include>)-->#${1}#' ${POM}
+  perl -pi -e 's#\t+<exclude>\@org.apache.flink.annotation.PublicEvolving.*\n##' ${POM}
+}
+
+function set_japicmp_reference_version() {
+  local version=$1
+
+  perl -pi -e 's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${version}'${2}#' ${POM}
+}
+
+current_branch=$(git rev-parse --abbrev-ref HEAD)
+
+if [[ ${current_branch} =~ -rc ]]; then
+  # release branch
+  version_prefix=$(echo "${NEW_VERSION}" | perl -p -e 's#(\d+\.\d+)\.\d+#$1#')
+  minor=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.\d+\.(\d+)#$1#')
+  if ! [[ ${minor} == "0" ]]; then
+    set_japicmp_reference_version ${version_prefix}.$((minor - 1))
+    # this is a safeguard in case the manual step of enabling checks after the X.Y.0 release was forgotten
+    enable_public_evolving_compatibility_checks
+  fi
+elif [[ ${current_branch} =~ -SNAPSHOT ]]; then
+  # snapshot branch
+  set_japicmp_reference_version ${NEW_VERSION}
+  enable_public_evolving_compatibility_checks
+elif [[ ${current_branch} =~ ^master$ ]]; then

Review comment:
       This case (and the previous one) require a manual invocation of `update_japicmp_configuration.sh` by the RM, right? (I assume you'll update the wiki?)

##########
File path: tools/releasing/update_japicmp_configuration.sh
##########
@@ -0,0 +1,83 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+if [ -z "${NEW_VERSION}" ]; then
+    echo "NEW_VERSION was not set."
+    exit 1
+fi
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+# Idealized use-cases:
+# Scenario A) New major release X.Y.0
+#   Premise:
+#     There is a master branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.(Y-1).0 .
+#   Release flow:
+#     - update the master to X.(Y+1)-SNAPSHOT, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - create X.Y-SNAPSHOT branch, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - release X.Y.0
+#     - update the japicmp reference version of both master and X.Y-SNAPSHOT to X.Y.0
+#     - enable stronger compatibility constraints for X.Y-SNAPSHOT to ensure compatibility for PublicEvolving
+# Scenario B) New minor release X.Y.Z
+#   Premise:
+#     There is a snapshot branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.Y.(Z-1)
+#   Release flow:
+#     - create X.Y.Z-rc branch
+#     - update the japicmp reference version of X.Y.Z to X.Y.(Z-1)
+#     - release X.Y.Z
+#     - update the japicmp reference version of X.Y-SNAPSHOT to X.Y.Z
+
+POM=../pom.xml
+function enable_public_evolving_compatibility_checks() {
+  perl -pi -e 's#<!--(<include>\@org.apache.flink.annotation.PublicEvolving</include>)-->#${1}#' ${POM}
+  perl -pi -e 's#\t+<exclude>\@org.apache.flink.annotation.PublicEvolving.*\n##' ${POM}
+}
+
+function set_japicmp_reference_version() {
+  local version=$1
+
+  perl -pi -e 's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${version}'${2}#' ${POM}
+}
+
+current_branch=$(git rev-parse --abbrev-ref HEAD)
+
+if [[ ${current_branch} =~ -rc ]]; then

Review comment:
       for this case, the RM doesn't need to invoke this script, because it is called from the `create_release_branch.sh` script, right?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-633979204


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2207",
       "triggerID" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4c67c51b003823e1abd4373963f7d1ea53e829b6 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2207) 
   * b3a0dab10d3615b52001b02e3b5143274d0ddb08 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] zentol commented on a change in pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #12340:
URL: https://github.com/apache/flink/pull/12340#discussion_r431015632



##########
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:
       It wasn't the original idea, I just remembered wrong how the release process works.
   
   As for the manual work, the RM has to un-comment the line, remove the exclusion and update the reference version to the last release minor version.
   
   Ultimately the logic is identical, so I'll see if I can refactor this update into a separate script that the RM can call.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-633979204


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2207",
       "triggerID" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2279",
       "triggerID" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "triggerType" : "PUSH"
     }, {
       "hash" : "122bae66113d7f2430c2568d594d39e38fe22585",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2292",
       "triggerID" : "122bae66113d7f2430c2568d594d39e38fe22585",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * b3a0dab10d3615b52001b02e3b5143274d0ddb08 Azure: [CANCELED](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2279) 
   * 122bae66113d7f2430c2568d594d39e38fe22585 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2292) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-633976919






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] zentol commented on a change in pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #12340:
URL: https://github.com/apache/flink/pull/12340#discussion_r431462487



##########
File path: tools/releasing/update_japicmp_configuration.sh
##########
@@ -0,0 +1,83 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+if [ -z "${NEW_VERSION}" ]; then
+    echo "NEW_VERSION was not set."
+    exit 1
+fi
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+# Idealized use-cases:
+# Scenario A) New major release X.Y.0
+#   Premise:
+#     There is a master branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.(Y-1).0 .
+#   Release flow:
+#     - update the master to X.(Y+1)-SNAPSHOT, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - create X.Y-SNAPSHOT branch, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - release X.Y.0
+#     - update the japicmp reference version of both master and X.Y-SNAPSHOT to X.Y.0
+#     - enable stronger compatibility constraints for X.Y-SNAPSHOT to ensure compatibility for PublicEvolving
+# Scenario B) New minor release X.Y.Z
+#   Premise:
+#     There is a snapshot branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.Y.(Z-1)
+#   Release flow:
+#     - create X.Y.Z-rc branch
+#     - update the japicmp reference version of X.Y.Z to X.Y.(Z-1)
+#     - release X.Y.Z
+#     - update the japicmp reference version of X.Y-SNAPSHOT to X.Y.Z
+
+POM=../pom.xml
+function enable_public_evolving_compatibility_checks() {
+  perl -pi -e 's#<!--(<include>\@org.apache.flink.annotation.PublicEvolving</include>)-->#${1}#' ${POM}
+  perl -pi -e 's#\t+<exclude>\@org.apache.flink.annotation.PublicEvolving.*\n##' ${POM}
+}
+
+function set_japicmp_reference_version() {
+  local version=$1
+
+  perl -pi -e 's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${version}'${2}#' ${POM}
+}
+
+current_branch=$(git rev-parse --abbrev-ref HEAD)
+
+if [[ ${current_branch} =~ -rc ]]; then

Review comment:
       correct

##########
File path: tools/releasing/update_japicmp_configuration.sh
##########
@@ -0,0 +1,83 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+if [ -z "${NEW_VERSION}" ]; then
+    echo "NEW_VERSION was not set."
+    exit 1
+fi
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+# Idealized use-cases:
+# Scenario A) New major release X.Y.0
+#   Premise:
+#     There is a master branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.(Y-1).0 .
+#   Release flow:
+#     - update the master to X.(Y+1)-SNAPSHOT, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - create X.Y-SNAPSHOT branch, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - release X.Y.0
+#     - update the japicmp reference version of both master and X.Y-SNAPSHOT to X.Y.0
+#     - enable stronger compatibility constraints for X.Y-SNAPSHOT to ensure compatibility for PublicEvolving
+# Scenario B) New minor release X.Y.Z
+#   Premise:
+#     There is a snapshot branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.Y.(Z-1)
+#   Release flow:
+#     - create X.Y.Z-rc branch
+#     - update the japicmp reference version of X.Y.Z to X.Y.(Z-1)
+#     - release X.Y.Z
+#     - update the japicmp reference version of X.Y-SNAPSHOT to X.Y.Z
+
+POM=../pom.xml
+function enable_public_evolving_compatibility_checks() {
+  perl -pi -e 's#<!--(<include>\@org.apache.flink.annotation.PublicEvolving</include>)-->#${1}#' ${POM}
+  perl -pi -e 's#\t+<exclude>\@org.apache.flink.annotation.PublicEvolving.*\n##' ${POM}
+}
+
+function set_japicmp_reference_version() {
+  local version=$1
+
+  perl -pi -e 's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${version}'${2}#' ${POM}
+}
+
+current_branch=$(git rev-parse --abbrev-ref HEAD)
+
+if [[ ${current_branch} =~ -rc ]]; then
+  # release branch
+  version_prefix=$(echo "${NEW_VERSION}" | perl -p -e 's#(\d+\.\d+)\.\d+#$1#')
+  minor=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.\d+\.(\d+)#$1#')
+  if ! [[ ${minor} == "0" ]]; then
+    set_japicmp_reference_version ${version_prefix}.$((minor - 1))
+    # this is a safeguard in case the manual step of enabling checks after the X.Y.0 release was forgotten
+    enable_public_evolving_compatibility_checks
+  fi
+elif [[ ${current_branch} =~ -SNAPSHOT ]]; then
+  # snapshot branch
+  set_japicmp_reference_version ${NEW_VERSION}
+  enable_public_evolving_compatibility_checks
+elif [[ ${current_branch} =~ ^master$ ]]; then

Review comment:
       correct




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
rmetzger commented on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-634201576


   I'm not saying you should do it the way I would have done it :) And yeah, it would be a lot of noise in our pom files for such a tiny change.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on a change in pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
rmetzger commented on a change in pull request #12340:
URL: https://github.com/apache/flink/pull/12340#discussion_r431045521



##########
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:
       +1 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on a change in pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
rmetzger commented on a change in pull request #12340:
URL: https://github.com/apache/flink/pull/12340#discussion_r431635006



##########
File path: tools/releasing/update_japicmp_configuration.sh
##########
@@ -0,0 +1,83 @@
+#!/usr/bin/env bash
+
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+if [ -z "${NEW_VERSION}" ]; then
+    echo "NEW_VERSION was not set."
+    exit 1
+fi
+
+CURR_DIR=`pwd`
+if [[ `basename $CURR_DIR` != "tools" ]] ; then
+  echo "You have to call the script from the tools/ dir"
+  exit 1
+fi
+
+# Idealized use-cases:
+# Scenario A) New major release X.Y.0
+#   Premise:
+#     There is a master branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.(Y-1).0 .
+#   Release flow:
+#     - update the master to X.(Y+1)-SNAPSHOT, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - create X.Y-SNAPSHOT branch, but keep the reference version intact since X.Y.0 is not released (yet)
+#     - release X.Y.0
+#     - update the japicmp reference version of both master and X.Y-SNAPSHOT to X.Y.0
+#     - enable stronger compatibility constraints for X.Y-SNAPSHOT to ensure compatibility for PublicEvolving
+# Scenario B) New minor release X.Y.Z
+#   Premise:
+#     There is a snapshot branch with a version X.Y-SNAPSHOT, with a japicmp reference version of X.Y.(Z-1)
+#   Release flow:
+#     - create X.Y.Z-rc branch
+#     - update the japicmp reference version of X.Y.Z to X.Y.(Z-1)
+#     - release X.Y.Z
+#     - update the japicmp reference version of X.Y-SNAPSHOT to X.Y.Z
+
+POM=../pom.xml
+function enable_public_evolving_compatibility_checks() {
+  perl -pi -e 's#<!--(<include>\@org.apache.flink.annotation.PublicEvolving</include>)-->#${1}#' ${POM}
+  perl -pi -e 's#\t+<exclude>\@org.apache.flink.annotation.PublicEvolving.*\n##' ${POM}
+}
+
+function set_japicmp_reference_version() {
+  local version=$1
+
+  perl -pi -e 's#(<japicmp.referenceVersion>).*(</japicmp.referenceVersion>)#${1}'${version}'${2}#' ${POM}
+}
+
+current_branch=$(git rev-parse --abbrev-ref HEAD)
+
+if [[ ${current_branch} =~ -rc ]]; then
+  # release branch
+  version_prefix=$(echo "${NEW_VERSION}" | perl -p -e 's#(\d+\.\d+)\.\d+#$1#')
+  minor=$(echo "${NEW_VERSION}" | perl -p -e 's#\d+\.\d+\.(\d+)#$1#')
+  if ! [[ ${minor} == "0" ]]; then
+    set_japicmp_reference_version ${version_prefix}.$((minor - 1))
+    # this is a safeguard in case the manual step of enabling checks after the X.Y.0 release was forgotten
+    enable_public_evolving_compatibility_checks
+  fi
+elif [[ ${current_branch} =~ -SNAPSHOT ]]; then

Review comment:
       Will also be a manual invocation of the script described in the release guide?
   The RM will have to rename `release-1.11` to `release-1.11-SNAPSHOT` and then run this script after 1.11.0 has been released?
   
   I still wonder why this check is on the branch name, and not the version.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] zentol commented on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
zentol commented on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-634642654


   @rmetzger I've updated the PR.
   
   I've added `tools\releasing\update_japicmp_configuration.sh` to handle the configuration updates for both releases and master/snapshot branches. The file also contains a description for which scenarios it should be used for.
   It covers all cases without any extra configuration from the outside; so the RM just has to call it and commit the changes.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-633979204






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #12340:
URL: https://github.com/apache/flink/pull/12340#issuecomment-633979204


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2207",
       "triggerID" : "4c67c51b003823e1abd4373963f7d1ea53e829b6",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2279",
       "triggerID" : "b3a0dab10d3615b52001b02e3b5143274d0ddb08",
       "triggerType" : "PUSH"
     }, {
       "hash" : "122bae66113d7f2430c2568d594d39e38fe22585",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2292",
       "triggerID" : "122bae66113d7f2430c2568d594d39e38fe22585",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4c519b3424be300a5d0462a2f7d11e822a28afc7",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2356",
       "triggerID" : "4c519b3424be300a5d0462a2f7d11e822a28afc7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4c519b3424be300a5d0462a2f7d11e822a28afc7 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=2356) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [flink] rmetzger commented on a change in pull request #12340: [FLINK-17844][build] Enforce @PublicEvolving compatibility for minor versions

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org