MartijnVisser commented on code in PR #1:
URL: 
https://github.com/apache/flink-connector-shared-utils/pull/1#discussion_r1010743355


##########
README.md:
##########
@@ -1 +1,79 @@
-This repository contains utilities for [Apache 
Flink](https://flink.apache.org/) connectors.
\ No newline at end of file
+This is a collection of release utils for [Apache 
Flink](https://flink.apache.org/) connectors.
+
+# Integration
+
+The scripts assume that they are integrated into a connector repo as a 
submodule into the connector repo
+under `tools/releasing/<some directory>`.
+
+# Usage
+
+Some scripts rely on environment variables to be set.  
+These are checked at the start of each script.  
+Any instance of `${some_variable}` in this document refers to an environment 
variable that is used by the respective
+script.
+
+## check_environment.sh
+
+Runs some pre-release checks for the current environment, for example that all 
required programs are available.  
+This should be run once at the start of the release process.
+
+## publish_snapshot_branch.sh
+
+Creates (and pushes!) a new snapshot branch for the current commit.  
+The branch name is automatically determined from the version in the pom.  
+This script should be called when work on a new major/minor version has 
started.

Review Comment:
   ```suggestion
   This script should be called when work on a new major/minor version of the 
connector has started.
   ```



##########
_init.sh:
##########
@@ -0,0 +1,45 @@
+#!/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.
+#
+
+# all scripts should contain this line + source ${SCRIPT_DIR}/_init.sh
+SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+export SHELLOPTS
+
+###########################
+
+MVN=${MVN:-mvn}
+
+if [ "$(uname)" == "Darwin" ]; then

Review Comment:
   While I have Darwin, I can also both run `sha512sum` and `shasum -a 512`. 
Don't think that's an issue for this script's purpose though



##########
check_environment.sh:
##########
@@ -0,0 +1,67 @@
+#!/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.
+#
+
+SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
+
+source "${SCRIPT_DIR}/_init.sh"
+
+EXIT_CODE=0
+
+function check_program_available {
+  if program=$(command -v ${1}); then
+    printf "\t%-10s%s\n" "${1}" "using ${program}"
+  else
+    printf "\t%-10s%s\n" "${1}" "is not available."
+    EXIT_CODE=1
+  fi
+}
+
+echo "Checking program availability:"
+check_program_available git
+check_program_available tar
+check_program_available rsync
+check_program_available gpg
+check_program_available perl
+check_program_available sed
+check_program_available svn
+check_program_available ${MVN}

Review Comment:
   Just to double check, any version of Maven for connectors should suffice, 
right? Doesn't need to be 3.2.5 like for Flink itself



##########
README.md:
##########
@@ -1 +1,79 @@
-This repository contains utilities for [Apache 
Flink](https://flink.apache.org/) connectors.
\ No newline at end of file
+This is a collection of release utils for [Apache 
Flink](https://flink.apache.org/) connectors.
+
+# Integration
+
+The scripts assume that they are integrated into a connector repo as a 
submodule into the connector repo
+under `tools/releasing/<some directory>`.
+
+# Usage
+
+Some scripts rely on environment variables to be set.  
+These are checked at the start of each script.  
+Any instance of `${some_variable}` in this document refers to an environment 
variable that is used by the respective
+script.
+
+## check_environment.sh
+
+Runs some pre-release checks for the current environment, for example that all 
required programs are available.  
+This should be run once at the start of the release process.
+
+## publish_snapshot_branch.sh
+
+Creates (and pushes!) a new snapshot branch for the current commit.  
+The branch name is automatically determined from the version in the pom.  
+This script should be called when work on a new major/minor version has 
started.
+
+## update_branch_version.sh
+
+Updates the version in the poms of the current branch to `${NEW_VERSION}`.
+
+## stage_source_release.sh
+
+Creates a source release from the current branch and pushes it via `svn`
+to [dist.apache.org](https://dist.apache.org/repops/dist/dev/flink).  
+The version is automatically determined from the version in the pom.  
+The created `svn` directory will contain a `-rc${RC_NUM}` suffix.
+
+## stage_jars.sh
+
+Creates the jars from the current branch and deploys them to 
[repository.apache.org](https://repository.apache.org).  
+The version will be suffixed with `-${FLINK_MINOR_VERSION}` to indicate the 
supported Flink version.  
+If a particular version of a connector supports multiple Flink versions then 
this script should be called multiple
+times.
+
+## publish_git_tag.sh
+
+Creates a release tag for the current branch and pushes it to GitHub.
+The tag will be suffixed with `-rc${RC_NUM}`, if `${RC_NUM}` was set.  
+This script should only be used _after_ the `-SNAPSHOT` version suffix was 
removd via `update_branch_version.sh`.
+
+## update_japicmp_configuration.sh
+
+Sets the japicmp reference version in the pom of the current branch to 
`${NEW_VERSION}`, enables compatibility checks
+for `@PublicEvolving` when used on snapshot branches an clears the list of 
exclusions.  
+This should be called after a release on the associated snapshot branch. If it 
was a minor release it should
+additionally be called on the `main` branch.
+
+# Common workflow
+
+1. run `publish_snapshot_branch.sh`
+2. do some development work on the created snapshot branch
+3. checkout a specific commit to create a release from
+4. run `check_environment.sh`

Review Comment:
   I think it makes more sense to have this as the first step and not the 4th. 
The `publish_snapshots_branch.sh` uses Maven and git, which are checked for 
availability in `check_environment.sh`. 



##########
publish_git_tag.sh:
##########
@@ -0,0 +1,46 @@
+#!/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.
+#
+
+SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
+
+source ${SCRIPT_DIR}/_init.sh
+source ${SCRIPT_DIR}/_utils.sh
+
+###########################
+
+RC_NUM=${RC_NUM:-none}
+
+###########################
+
+function create_release_tag {
+  cd "${SOURCE_DIR}"
+
+  version=$(get_pom_version)
+
+  tag=v${version}
+  if [ "$RC_NUM" != "none" ]; then
+    tag=${tag}-rc${RC_NUM}
+  fi

Review Comment:
   Does it make sense to add a check here that verifies if the version doesn't 
contain SNAPSHOT anymore? 



-- 
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: dev-unsubscr...@flink.apache.org

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

Reply via email to