feat: add support for session TTL and expiration in Vertex AI session service #5728
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2026 Google LLC | |
| # | |
| # Licensed 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. | |
| name: Mypy New Error Check | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| mypy-diff: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13',] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Generate Baseline (Main) | |
| run: | | |
| # Switch to main branch to generate baseline | |
| git checkout origin/main | |
| git checkout ${{ github.sha }} -- pyproject.toml | |
| # Install dependencies for main | |
| uv venv .venv | |
| source .venv/bin/activate | |
| uv sync --all-extras | |
| # Run mypy, filter for errors only, remove line numbers (file:123: -> file::), and sort | |
| # We ignore exit code (|| true) because we expect errors on main | |
| uv run mypy . | grep "error:" | sed 's/:\([0-9]\+\):/::/g' | sort > main_errors.txt || true | |
| echo "Found $(wc -l < main_errors.txt) errors on main." | |
| - name: Check PR Branch | |
| run: | | |
| # Switch back to the PR commit | |
| git checkout ${{ github.sha }} | |
| # Re-sync dependencies in case the PR changed them | |
| source .venv/bin/activate | |
| uv sync --all-extras | |
| # Run mypy on PR code, apply same processing | |
| uv run mypy . | grep "error:" | sed 's/:\([0-9]\+\):/::/g' | sort > pr_errors.txt || true | |
| echo "Found $(wc -l < pr_errors.txt) errors on PR branch." | |
| - name: Compare and Fail on New Errors | |
| run: | | |
| # 'comm -13' suppresses unique lines in file1 (main) and common lines, | |
| # leaving only lines unique to file2 (PR) -> The new errors. | |
| comm -13 main_errors.txt pr_errors.txt > new_errors.txt | |
| if [ -s new_errors.txt ]; then | |
| echo "::error::The following NEW mypy errors were introduced:" | |
| cat new_errors.txt | |
| exit 1 | |
| else | |
| echo "Great job! No new mypy errors introduced." | |
| fi |