potiuk commented on a change in pull request #9502:
URL: https://github.com/apache/airflow/pull/9502#discussion_r449436047
##########
File path: .github/workflows/ci.yml
##########
@@ -170,6 +170,33 @@ jobs:
'\.py$|.github/workflows/|^Dockerfile|^scripts'
echo "::set-output name=count::$?"
id: pyfiles
+
+ test-openapi-client-generation:
+ name: "Test OpenAPI client generation"
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@master
+ with:
+ fetch-depth: 0
+ - name: "Check spec file change"
+ run: |
+
URL="https://raw.githubusercontent.com/apache/airflow/master/airflow/api_connexion/openapi/v1.yaml"
+ curl -sL -o /tmp/current_v1.yaml "${URL}"
+ if diff /tmp/current_v1.yaml
./airflow/api_connexion/openapi/v1.yaml; then
+ echo "no openapi spec change detected, going to skip client code
gen validation."
+ else
+ echo "openapi spec change detected."
+ echo "::set-env name=API_SPEC_CHANGED::true"
+ fi
+ - name: "Generate new clients"
+ if: success() && env.API_SPEC_CHANGED == 'true'
+ run: |
+ mkdir -p ./clients/go/airflow
Review comment:
Same here. Spliiting it to separate bash file is better.
##########
File path: .github/workflows/ci.yml
##########
@@ -170,6 +170,33 @@ jobs:
'\.py$|.github/workflows/|^Dockerfile|^scripts'
echo "::set-output name=count::$?"
id: pyfiles
+
+ test-openapi-client-generation:
+ name: "Test OpenAPI client generation"
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@master
+ with:
+ fetch-depth: 0
+ - name: "Check spec file change"
+ run: |
+
URL="https://raw.githubusercontent.com/apache/airflow/master/airflow/api_connexion/openapi/v1.yaml"
Review comment:
I think comparing to master is not a good idea. It's better to get list
of changed files from the current commit. See `pyfiles` above. There is a ready
to use script that you can use for that. Something like this should work:
```
./scripts/ci/ci_count_changed_files.sh ${GITHUB_SHA}
'airflow/api_connexion/openapi/v1\.yaml'
echo "::set-output name=count::$?"
```
##########
File path: .github/workflows/ci.yml
##########
@@ -170,6 +170,33 @@ jobs:
'\.py$|.github/workflows/|^Dockerfile|^scripts'
echo "::set-output name=count::$?"
id: pyfiles
+
Review comment:
I think we are going to split the ci.yml into separate workflows soon.
So maybe a good idea will be to split out open-apis already to a separate
openapi.yml file ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]