This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new 040fb1d point go client mod path to new repo (#9922)
040fb1d is described below
commit 040fb1db029ce8927037184a39428d0c69d80e64
Author: QP Hou <[email protected]>
AuthorDate: Wed Jul 22 00:56:55 2020 -0700
point go client mod path to new repo (#9922)
* point go client mod path to new repo
---
clients/gen/go.sh | 2 +-
scripts/ci/openapi/client_codegen_diff.sh | 13 +++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/clients/gen/go.sh b/clients/gen/go.sh
index 8c58efa..2a6637c 100755
--- a/clients/gen/go.sh
+++ b/clients/gen/go.sh
@@ -52,7 +52,7 @@ SPEC_PATH="${SPEC_PATH}" \
OUTPUT_DIR="${OUTPUT_DIR}" \
gen_client go \
--package-name airflow \
- --git-repo-id airflow/clients/go/airflow \
+ --git-repo-id airflow-client-go/airflow \
--additional-properties "${go_config[*]}"
# patch generated client to support problem HTTP API
diff --git a/scripts/ci/openapi/client_codegen_diff.sh
b/scripts/ci/openapi/client_codegen_diff.sh
index 6b846fe..c2edbda 100755
--- a/scripts/ci/openapi/client_codegen_diff.sh
+++ b/scripts/ci/openapi/client_codegen_diff.sh
@@ -22,22 +22,27 @@ SCRIPTS_CI_DIR=$(dirname "${BASH_SOURCE[0]}")
. "${SCRIPTS_CI_DIR}"/../libraries/_initialization.sh
get_environment_for_builds_on_ci
+set -e
+
git remote add target "https://github.com/${CI_TARGET_REPO}"
git fetch target "${CI_TARGET_BRANCH}:${CI_TARGET_BRANCH}" --depth=1
echo "Diffing openapi spec against ${CI_TARGET_BRANCH}..."
SPEC_FILE=airflow/api_connexion/openapi/v1.yaml
-if ! git diff --name-only "${CI_TARGET_BRANCH}" HEAD | grep "${SPEC_FILE}" ;
then
- echo "no openapi spec change detected, going to skip client code gen
validation."
+if ! git diff --name-only "${CI_TARGET_BRANCH}" HEAD | grep
"${SPEC_FILE}\|clients/gen" ; then
+ echo "No openapi spec change detected, going to skip client code gen
validation."
exit 0
fi
-echo "openapi spec change detected. comparing codegen diff..."
+echo "OpenAPI spec change detected. comparing codegen diff..."
+# generate client for current patch
mkdir -p ./clients/go/airflow
./clients/gen/go.sh ./airflow/api_connexion/openapi/v1.yaml
./clients/go/airflow
+# generate client for target patch
mkdir -p ./clients/go_target_branch/airflow
-git checkout "${CI_TARGET_BRANCH}" ./airflow/api_connexion/openapi/v1.yaml
+git reset --hard "${CI_TARGET_BRANCH}"
./clients/gen/go.sh ./airflow/api_connexion/openapi/v1.yaml
./clients/go_target_branch/airflow
+
diff ./clients/go_target_branch/airflow ./clients/go/airflow || true