From b03634ecaaa9dba3ca73108bf7dde7e22e351ef7 Mon Sep 17 00:00:00 2001 From: Jamison Lahman Date: Tue, 27 Jan 2026 15:29:51 -0800 Subject: [PATCH] chore(mypy): fix mypy cache issues switching between HEAD and release (#7732) --- .github/workflows/pr-python-checks.yml | 3 ++- backend/onyx/auth/users.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-python-checks.yml b/.github/workflows/pr-python-checks.yml index bb7fdb6435..86ba58910f 100644 --- a/.github/workflows/pr-python-checks.yml +++ b/.github/workflows/pr-python-checks.yml @@ -50,8 +50,9 @@ jobs: uses: runs-on/cache@50350ad4242587b6c8c2baa2e740b1bc11285ff4 # ratchet:runs-on/cache@v4 with: path: backend/.mypy_cache - key: mypy-${{ runner.os }}-${{ hashFiles('**/*.py', '**/*.pyi', 'backend/pyproject.toml') }} + key: mypy-${{ runner.os }}-${{ github.base_ref || github.event.merge_group.base_ref || 'main' }}-${{ hashFiles('**/*.py', '**/*.pyi', 'backend/pyproject.toml') }} restore-keys: | + mypy-${{ runner.os }}-${{ github.base_ref || github.event.merge_group.base_ref || 'main' }}- mypy-${{ runner.os }}- - name: Run MyPy diff --git a/backend/onyx/auth/users.py b/backend/onyx/auth/users.py index 2c46a3911b..5a9aedd672 100644 --- a/backend/onyx/auth/users.py +++ b/backend/onyx/auth/users.py @@ -1468,7 +1468,7 @@ class OAuth2AuthorizeResponse(BaseModel): def generate_state_token( data: Dict[str, str], - secret: SecretType, # type: ignore[valid-type] + secret: SecretType, lifetime_seconds: int = STATE_TOKEN_LIFETIME_SECONDS, ) -> str: data["aud"] = STATE_TOKEN_AUDIENCE @@ -1484,7 +1484,7 @@ def generate_csrf_token() -> str: def create_onyx_oauth_router( oauth_client: BaseOAuth2, backend: AuthenticationBackend, - state_secret: SecretType, # type: ignore[valid-type] + state_secret: SecretType, redirect_url: Optional[str] = None, associate_by_email: bool = False, is_verified_by_default: bool = False, @@ -1504,7 +1504,7 @@ def get_oauth_router( oauth_client: BaseOAuth2, backend: AuthenticationBackend, get_user_manager: UserManagerDependency[models.UP, models.ID], - state_secret: SecretType, # type: ignore[valid-type] + state_secret: SecretType, redirect_url: Optional[str] = None, associate_by_email: bool = False, is_verified_by_default: bool = False,