You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/11/07 21:22:24 UTC

[GitHub] [beam] benWize opened a new pull request, #24020: [ Github Actions ] - Cut Release Branch Workflow

benWize opened a new pull request, #24020:
URL: https://github.com/apache/beam/pull/24020

   As part of the [Beam Release Process](https://beam.apache.org/contribute/release-guide/), the following PR includes the workflow to run the [cut_release_branch.sh](https://github.com/apache/beam/blob/master/release/src/main/scripts/cut_release_branch.sh) script described in [step 5. Use cut_release_branch.sh to cut a release branch
   ](https://beam.apache.org/contribute/release-guide/#use-cut_release_branchsh-to-cut-a-release-branch)
   
   Files:
   - Cut Release Branch: .github/workflows/cut_release_branch.yml
   - Updated CI.md file
   
   ------------------------
   
   Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and mention them in a comment (`R: @username`).
    - [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
    - [ ] Update `CHANGES.md` with noteworthy changes.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/get-started-contributing/#make-the-reviewers-job-easier).
   
   To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
   
   GitHub Actions Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   [![Build python source distribution and wheels](https://github.com/apache/beam/workflows/Build%20python%20source%20distribution%20and%20wheels/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Go tests](https://github.com/apache/beam/workflows/Go%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
   
   See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
   


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] benWize commented on a diff in pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
benWize commented on code in PR #24020:
URL: https://github.com/apache/beam/pull/24020#discussion_r1029900803


##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then

Review Comment:
   Thanks for your suggestion, I changed it to use else



##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then
+            echo "The input for NEXT_RELEASE does not match a valid format [0-9].[0-9].[0-9]"
+            exit 1
+          fi
+          echo "NEXT_VERSION_IN_BASE_BRANCH=${NEXT_VERSION_IN_BASE_BRANCH}" >> $GITHUB_ENV
+      - name: Echo value
+        run: |
+          echo "NEXT_VERSION_IN_BASE_BRANCH: $NEXT_VERSION_IN_BASE_BRANCH"

Review Comment:
   Removed it



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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] kennknowles commented on a diff in pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
kennknowles commented on code in PR #24020:
URL: https://github.com/apache/beam/pull/24020#discussion_r1036243415


##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,111 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    needs: update_release_branch
+    runs-on: [self-hosted, ubuntu-20.04]
+    env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then

Review Comment:
   The regex should be `[0-9]+\.[0-9]+\.[0-9]+` here and in the error message below.



##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then
+            echo "The input for NEXT_RELEASE does not match a valid format [0-9].[0-9].[0-9]"
+            exit 1
+          fi
+          echo "NEXT_VERSION_IN_BASE_BRANCH=${NEXT_VERSION_IN_BASE_BRANCH}" >> $GITHUB_ENV
+      - name: Echo value
+        run: |
+          echo "NEXT_VERSION_IN_BASE_BRANCH: $NEXT_VERSION_IN_BASE_BRANCH"
+      - name: Check out code
+        uses: actions/checkout@v3
+      - name: Set git config
+        run: |
+          git config user.name $GITHUB_ACTOR
+          git config user.email actions@"$RUNNER_NAME".local
+      - name: Update master branch
+        run: |
+          bash "${SCRIPT_DIR}/set_version.sh" "${NEXT_VERSION_IN_BASE_BRANCH}"
+          echo "==============Update master branch as following================"
+          git diff
+          echo "==============================================================="
+      - name: Commit and Push to master branch files with Next Version
+        run: |
+          git add buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+          git add gradle.properties
+          git add sdks/python/apache_beam/version.py
+          git add sdks/go/pkg/beam/core/core.go
+          git commit -m "Moving to ${NEXT_VERSION_IN_BASE_BRANCH}-SNAPSHOT on master branch."
+          git push origin ${MASTER_BRANCH}
+
+  update_release_branch:

Review Comment:
   Ordering does matter.`update_master` should run first (the opposite of what you have now). If you cut the branch first, then a PR could merge after the cut point and you have commits with the wrong SNAPSHOT version on them.
   
   The branch should be cut on the parent commit of the one from `update_master`. In other words, the last commit on master with the SNAPSHOT version.
   
   In fact, the two versions are really symmetrical. You can either think of it as a release branch being cut and master updating the version _or_ you can think of it as the release branch being a continuation of the main branch, and a new `master` branch being created with the new snapshot version. The latter interpretation is actually very helpful for me to think about things.
   
   So in fact updating the version on the master branch should be committed first to step any new PRs being merged. If any PRs were merged with the old SNAPSHOT version, the release branch should cut from their merge commit.



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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] benWize commented on a diff in pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
benWize commented on code in PR #24020:
URL: https://github.com/apache/beam/pull/24020#discussion_r1029901187


##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then
+            echo "The input for NEXT_RELEASE does not match a valid format [0-9].[0-9].[0-9]"
+            exit 1
+          fi
+          echo "NEXT_VERSION_IN_BASE_BRANCH=${NEXT_VERSION_IN_BASE_BRANCH}" >> $GITHUB_ENV
+      - name: Echo value
+        run: |
+          echo "NEXT_VERSION_IN_BASE_BRANCH: $NEXT_VERSION_IN_BASE_BRANCH"
+      - name: Check out code
+        uses: actions/checkout@v3
+      - name: Set git config
+        run: |
+          git config user.name $GITHUB_ACTOR
+          git config user.email actions@"$RUNNER_NAME".local
+      - name: Update master branch
+        run: |
+          bash "${SCRIPT_DIR}/set_version.sh" "${NEXT_VERSION_IN_BASE_BRANCH}"
+          echo "==============Update master branch as following================"
+          git diff
+          echo "==============================================================="
+      - name: Commit and Push to master branch files with Next Version
+        run: |
+          git add buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+          git add gradle.properties
+          git add sdks/python/apache_beam/version.py
+          git add sdks/go/pkg/beam/core/core.go

Review Comment:
   I think we can use git add *, changed it



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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] kennknowles commented on pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
kennknowles commented on PR #24020:
URL: https://github.com/apache/beam/pull/24020#issuecomment-1334323581

   I see. I will cut the release branch manually.


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] benWize commented on pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
benWize commented on PR #24020:
URL: https://github.com/apache/beam/pull/24020#issuecomment-1332549801

   Thanks, @kennknowles, I changed the regex and the job dependency 


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] kennknowles commented on pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
kennknowles commented on PR #24020:
URL: https://github.com/apache/beam/pull/24020#issuecomment-1332663717

   Thinking about how this runs, it will already have chosen a commit so the two jobs do not have any dependency on each other. They will have the same effect regardless.
   
   I believe the best way to do it would be to advance the master branch version in a separate step and then explicitly pass the best commit to the cut release branch.
   
   But for now we should just merge and go ahead and I will try this action out for cutting the current branch. It is as good as what we do today (unless a release manager is careful and does it manually)


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] github-actions[bot] commented on pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #24020:
URL: https://github.com/apache/beam/pull/24020#issuecomment-1314431523

   Assigning reviewers. If you would like to opt out of this review, comment `assign to next reviewer`:
   
   R: @damccorm for label build.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
   
   The PR bot will only process comments in the main thread (not review comments).


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] damccorm commented on a diff in pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
damccorm commented on code in PR #24020:
URL: https://github.com/apache/beam/pull/24020#discussion_r1028088067


##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then

Review Comment:
   Any reason not to just use an `else`?



##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then
+            echo "The input for NEXT_RELEASE does not match a valid format [0-9].[0-9].[0-9]"
+            exit 1
+          fi
+          echo "NEXT_VERSION_IN_BASE_BRANCH=${NEXT_VERSION_IN_BASE_BRANCH}" >> $GITHUB_ENV
+      - name: Echo value
+        run: |
+          echo "NEXT_VERSION_IN_BASE_BRANCH: $NEXT_VERSION_IN_BASE_BRANCH"
+      - name: Check out code
+        uses: actions/checkout@v3
+      - name: Set git config
+        run: |
+          git config user.name $GITHUB_ACTOR
+          git config user.email actions@"$RUNNER_NAME".local
+      - name: Update master branch
+        run: |
+          bash "${SCRIPT_DIR}/set_version.sh" "${NEXT_VERSION_IN_BASE_BRANCH}"
+          echo "==============Update master branch as following================"
+          git diff
+          echo "==============================================================="
+      - name: Commit and Push to master branch files with Next Version
+        run: |
+          git add buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+          git add gradle.properties
+          git add sdks/python/apache_beam/version.py
+          git add sdks/go/pkg/beam/core/core.go

Review Comment:
   Can this just be `git add *` or does `set_version.sh` change more than just that?



##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then

Review Comment:
   Then you could just echo that directly into the GITHUB_ENV as well.



##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then
+            echo "The input for NEXT_RELEASE does not match a valid format [0-9].[0-9].[0-9]"
+            exit 1
+          fi
+          echo "NEXT_VERSION_IN_BASE_BRANCH=${NEXT_VERSION_IN_BASE_BRANCH}" >> $GITHUB_ENV
+      - name: Echo value
+        run: |
+          echo "NEXT_VERSION_IN_BASE_BRANCH: $NEXT_VERSION_IN_BASE_BRANCH"
+      - name: Check out code
+        uses: actions/checkout@v3
+      - name: Set git config
+        run: |
+          git config user.name $GITHUB_ACTOR
+          git config user.email actions@"$RUNNER_NAME".local
+      - name: Update master branch
+        run: |
+          bash "${SCRIPT_DIR}/set_version.sh" "${NEXT_VERSION_IN_BASE_BRANCH}"
+          echo "==============Update master branch as following================"
+          git diff
+          echo "==============================================================="
+      - name: Commit and Push to master branch files with Next Version
+        run: |
+          git add buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+          git add gradle.properties
+          git add sdks/python/apache_beam/version.py
+          git add sdks/go/pkg/beam/core/core.go
+          git commit -m "Moving to ${NEXT_VERSION_IN_BASE_BRANCH}-SNAPSHOT on master branch."
+          git push origin ${MASTER_BRANCH}
+
+  update_release_branch:

Review Comment:
   Does the ordering matter here? Should `update_master` have a dependency on this step and run after it?



##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then
+            echo "The input for NEXT_RELEASE does not match a valid format [0-9].[0-9].[0-9]"
+            exit 1
+          fi
+          echo "NEXT_VERSION_IN_BASE_BRANCH=${NEXT_VERSION_IN_BASE_BRANCH}" >> $GITHUB_ENV
+      - name: Echo value
+        run: |
+          echo "NEXT_VERSION_IN_BASE_BRANCH: $NEXT_VERSION_IN_BASE_BRANCH"

Review Comment:
   Do we need this? Why not just print it in the previous step if you want that information?



##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then
+            echo "The input for NEXT_RELEASE does not match a valid format [0-9].[0-9].[0-9]"
+            exit 1
+          fi
+          echo "NEXT_VERSION_IN_BASE_BRANCH=${NEXT_VERSION_IN_BASE_BRANCH}" >> $GITHUB_ENV
+      - name: Echo value
+        run: |
+          echo "NEXT_VERSION_IN_BASE_BRANCH: $NEXT_VERSION_IN_BASE_BRANCH"
+      - name: Check out code
+        uses: actions/checkout@v3
+      - name: Set git config
+        run: |
+          git config user.name $GITHUB_ACTOR
+          git config user.email actions@"$RUNNER_NAME".local
+      - name: Update master branch
+        run: |
+          bash "${SCRIPT_DIR}/set_version.sh" "${NEXT_VERSION_IN_BASE_BRANCH}"
+          echo "==============Update master branch as following================"
+          git diff
+          echo "==============================================================="
+      - name: Commit and Push to master branch files with Next Version
+        run: |
+          git add buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+          git add gradle.properties
+          git add sdks/python/apache_beam/version.py
+          git add sdks/go/pkg/beam/core/core.go
+          git commit -m "Moving to ${NEXT_VERSION_IN_BASE_BRANCH}-SNAPSHOT on master branch."
+          git push origin ${MASTER_BRANCH}
+
+  update_release_branch:
+    runs-on: [self-hosted, ubuntu-20.04]
+    env:
+      RELEASE: ${{ github.event.inputs.RELEASE_VERSION }}
+    steps:
+      - name: Validate Release Version
+        run: |
+          if [[ ${RELEASE} =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            RELEASE_VERSION=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$RELEASE_VERSION" ]]; then

Review Comment:
   Same comments about `else`



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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] damccorm commented on pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
damccorm commented on PR #24020:
URL: https://github.com/apache/beam/pull/24020#issuecomment-1322131581

   I reviewed this for correctness/style, but I'm not super-familiar with the actual steps needed to run it. @kennknowles could you take a look as the next release manager?


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] benWize commented on a diff in pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
benWize commented on code in PR #24020:
URL: https://github.com/apache/beam/pull/24020#discussion_r1029901862


##########
.github/workflows/cut_release_branch.yml:
##########
@@ -0,0 +1,123 @@
+# 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.
+
+# This workflow will update apache beam master branch with next release version
+# and cut release branch for current development version.
+
+# To learn more about GitHub Actions in Apache Beam check the CI.md
+
+name: Cut Release Branch
+on:
+  workflow_dispatch:
+    inputs:
+      RELEASE_VERSION:
+        description: Beam version of current release
+        required: true
+      NEXT_VERSION:
+        description: Next release version
+        required: true
+
+jobs:
+  update_master:
+    runs-on: [self-hosted, ubuntu-20.04]
+      env:
+      MASTER_BRANCH: master
+      NEXT_RELEASE: ${{ github.event.inputs.NEXT_VERSION }}
+      SCRIPT_DIR: ./release/src/main/scripts
+    steps:
+      - name: Validate Next Version
+        run: |
+          if [[ $NEXT_RELEASE =~ ([0-9]\.[0-9]*\.[0-9]) ]]; then
+            NEXT_VERSION_IN_BASE_BRANCH=${BASH_REMATCH[1]}
+          fi
+          if [[ -z "$NEXT_VERSION_IN_BASE_BRANCH" ]]; then
+            echo "The input for NEXT_RELEASE does not match a valid format [0-9].[0-9].[0-9]"
+            exit 1
+          fi
+          echo "NEXT_VERSION_IN_BASE_BRANCH=${NEXT_VERSION_IN_BASE_BRANCH}" >> $GITHUB_ENV
+      - name: Echo value
+        run: |
+          echo "NEXT_VERSION_IN_BASE_BRANCH: $NEXT_VERSION_IN_BASE_BRANCH"
+      - name: Check out code
+        uses: actions/checkout@v3
+      - name: Set git config
+        run: |
+          git config user.name $GITHUB_ACTOR
+          git config user.email actions@"$RUNNER_NAME".local
+      - name: Update master branch
+        run: |
+          bash "${SCRIPT_DIR}/set_version.sh" "${NEXT_VERSION_IN_BASE_BRANCH}"
+          echo "==============Update master branch as following================"
+          git diff
+          echo "==============================================================="
+      - name: Commit and Push to master branch files with Next Version
+        run: |
+          git add buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+          git add gradle.properties
+          git add sdks/python/apache_beam/version.py
+          git add sdks/go/pkg/beam/core/core.go
+          git commit -m "Moving to ${NEXT_VERSION_IN_BASE_BRANCH}-SNAPSHOT on master branch."
+          git push origin ${MASTER_BRANCH}
+
+  update_release_branch:

Review Comment:
   Added as a dependency



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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] kennknowles merged pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
kennknowles merged PR #24020:
URL: https://github.com/apache/beam/pull/24020


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] kennknowles commented on pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
kennknowles commented on PR #24020:
URL: https://github.com/apache/beam/pull/24020#issuecomment-1334323815

   Though this one does not require a self-hosted runner.


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] kennknowles commented on pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
kennknowles commented on PR #24020:
URL: https://github.com/apache/beam/pull/24020#issuecomment-1332499905

   The invariants we want to hold for the commit history:
   
    - Any commit on any branch should have a -SNAPSHOT version
    - RCs and releases should be on tags that are not on branches (because they are terminal)
    - For any release tag X.Y.Z every commit included in the tag has a <= version.
    - For any commit with X.Y.Z-SNAPSHOT version, it is included in the RC and release tags for X.Y.Z


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] github-actions[bot] commented on pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #24020:
URL: https://github.com/apache/beam/pull/24020#issuecomment-1332057162

   Reminder, please take a look at this pr: @damccorm 


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] benWize commented on pull request #24020: [Github Actions] - Cut Release Branch Workflow

Posted by GitBox <gi...@apache.org>.
benWize commented on PR #24020:
URL: https://github.com/apache/beam/pull/24020#issuecomment-1332746338

   This workflow is marked to run in a `self-hosted` runner https://github.com/benWize/beam/blob/8ae7a942fa30e37f7b9f1e42417f0da1f2036fff/.github/workflows/cut_release_branch.yml#L36, maybe we can change it to use a GitHub action runner for now, and switch back to self-hosted when those are ready.
   @kennknowles 
   


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org