fix: Google Drive sign-in fails a form run when Google is unreachable

Merged
EV
1d ago
+130-5

Description

Google Drive sign-in now follows the shared sign-in rule: on a form run (a draft run or a pair dry run), it fails when Google is unreachable or times out. Stored and scheduled runs keep it Incomplete, so a slow Google never holds indexing.

  • _GoogleDriveCheck accepts fails_when_unreachable, and google_drive_auth sets it.
  • New GOOGLE_CONNECTION_ERRORS and is_google_timeout() in source_operations.py. They cover google-auth TransportError, httplib2.ServerNotFoundError, requests connection and timeout errors, and the built-in ConnectionError and TimeoutError.
  • _google_errors maps these errors to TimedOutValidationError or UnreachableValidationError with the design's rows: "Cannot reach Google Drive" and "Sign-in timed out" for sign-in, "Timed out" for other checks.
  • The gateway still raises the raw errors, because indexing's retries (is_transient_google_error) expect them.

Known gap: an OAuth account's token refresh (get_google_oauth_creds) swallows network errors, so an unreachable Google still reads "Google no longer accepts the account" for OAuth. The fix also touches Gmail and two server endpoints, so it belongs in its own PR.

How Has This Been Tested?

  • Unit tests:
    • An unreachable Google (three error types) gives FAILED on a form run and INCOMPLETE on a stored run, with kind unreachable.
    • A sign-in timeout gives FAILED on a form run and "Sign-in timed out".
    • A timeout in a later check stays INCOMPLETE.
  • Connector, server and EE unit suites pass at this tip.

Additional Options

  • [Optional] Please cherry-pick this PR to the latest release version.
  • [Optional] Override Linear Check

🤖 Generated with Claude Code


Summary by cubic

Google Drive sign-in now fails a form run when Google is unreachable or times out, matching the other sign-in checks. Stored and scheduled runs keep the check Incomplete, so a slow Google never holds indexing.

  • source_operations.py gains GOOGLE_CONNECTION_ERRORS and is_google_timeout() to classify google-auth TransportError, httplib2.ServerNotFoundError, requests connection and timeout errors, and built-in ConnectionError/TimeoutError, including wrapped causes.
  • _google_errors maps them to UnreachableValidationError or TimedOutValidationError; a timeout in a later check stays Incomplete, and google_drive_auth sets fails_when_unreachable.
  • The gateway still raises the raw errors because indexing's retries expect them. Known gap: OAuth token refresh swallows network errors, so an unreachable Google still reads "Google no longer accepts the account"; that fix touches Gmail and server endpoints and belongs in its own PR.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Google Drive connection validation by distinguishing unreachable services from request timeouts.
    • Google Drive authentication and file-listing checks now show clearer error statuses and messages.
    • Form-based checks report connection failures as failed when appropriate, while saved connection checks preserve incomplete status for retryable issues.
    • Shared-drive request timeouts remain marked incomplete during form validation, helping users retry without treating the configuration as permanently invalid.