@@ -2865,7 +2865,39 @@ jobs:
28652865 TAG_PREFIX : hotfix-staging-github
28662866 run : ./ci/deploy/dockerhub-deploy.bash -n
28672867
2868- api-server-api-spec-backwards-compatible :
2868+ check-api-specs-updated :
2869+ needs : [changes]
2870+ if : ${{ needs.changes.outputs.anything == 'true' || github.event_name == 'push' }}
2871+ timeout-minutes : 10
2872+ name : Check api-specs are up to date
2873+ runs-on : ubuntu-latest
2874+ steps :
2875+ - name : setup python environment
2876+ uses : actions/setup-python@v5
2877+ with :
2878+ python-version : " 3.11"
2879+ - name : install uv
2880+ uses : astral-sh/setup-uv@v4
2881+ with :
2882+ version : " 0.4.x"
2883+ enable-cache : false
2884+ cache-dependency-glob : " **/service-library/requirements/ci*.txt"
2885+ - name : checkout source branch
2886+ uses : actions/checkout@v4
2887+ with :
2888+ path : source
2889+ - name : Regenerate specs and check
2890+ run : |
2891+ uv venv .venv && source .venv/bin/activate
2892+ make openapi-specs
2893+ changed_files=$(git diff --name-only)
2894+ if echo ${changed_files} | grep -qE '^(openapi\.json|openapi\.yaml)$'; then
2895+ echo "${changed_files}" && echo "Run make openapi-specs and commit changes"
2896+ exit 1
2897+ fi
2898+
2899+
2900+ api-spec-backwards-compatible :
28692901 needs : [changes]
28702902 if : ${{ needs.changes.outputs.anything == 'true' || github.event_name == 'push' }}
28712903 timeout-minutes : 10
@@ -2892,13 +2924,13 @@ jobs:
28922924 path : target
28932925 repository : ${{ github.event.pull_request.base.repo.full_name }}
28942926 ref : ${{ github.event.pull_request.base.ref }}
2895- - name : Generate target openapi specs
2927+ - name : Generate source openapi- specs
28962928 run : |
2897- cd target
2929+ cd source
28982930 uv venv .venv && source .venv/bin/activate
28992931 make openapi-specs
2900- - name : Generate source openapi-specs and compare
2932+ - name : Generate target openapi specs
29012933 run : |
2902- cd source
2934+ cd target
29032935 uv venv .venv && source .venv/bin/activate
29042936 make openapi-specs
0 commit comments