name: Protos on: pull_request: types: - opened - synchronize - reopened paths: - .github/workflows/protos.yml - dev/gen_rest_api.py - dev/generate_protos.py - dev/generate-protos.sh - dev/test-generate-protos.sh - mlflow/protos/** - mlflow/java/client/src/main/java/com/databricks/api/proto/** # graphql related code changes could trigger changes in the autogenerated schema - mlflow/server/graphql/** - mlflow/server/js/src/graphql/** - requirements/skinny-requirements.yaml - requirements/core-requirements.yaml env: MLFLOW_HOME: ${{ github.workspace }} concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true defaults: run: shell: bash permissions: {} jobs: protos: if: github.event_name != 'pull_request' || (github.event.pull_request.draft == false || github.event.pull_request.user.login == 'Copilot' && github.event.pull_request.user.type == 'Bot') runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false repository: ${{ github.event.inputs.repository }} ref: ${{ github.event.inputs.ref }} - uses: ./.github/actions/setup-python - name: Check OpenTelemetry protos are up-to-date run: | ./mlflow/protos/opentelemetry/update.sh GIT_STATUS="$(git status --porcelain mlflow/protos/opentelemetry/)" if [ "$GIT_STATUS" ]; then echo "OpenTelemetry proto files are outdated. Please run './mlflow/protos/opentelemetry/update.sh'" echo "Git status:" echo "$GIT_STATUS" exit 1 fi - name: Run tests run: | ./dev/test-generate-protos.sh - name: Test run: | uv run python -c "from google.protobuf.internal import api_implementation; assert api_implementation.Type() != 'python'" uv run python -c "import mlflow" # Ensure mlflow works fine with the python backend. See the following link for more details: # https://github.com/protocolbuffers/protobuf/tree/main/python#implementation-backends export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python uv run python -c "from google.protobuf.internal import api_implementation; assert api_implementation.Type() == 'python'" uv run python -c "import mlflow"