chore: one row-text model for every capability check

Merged
EV
11h ago
+673-705

Description

One row-text model and one summary-cut helper for every capability check. No behavior changes.

  • CheckRowText moves from capability_checks/models.py to onyx/connectors/models.py, next to the summary and description that ValidationError carries in connectors/exceptions.py. Every caller imports it from there.
  • MicrosoftRowText is deleted. It duplicated CheckRowText. microsoft_utils could not import the checks package (test_microsoft_utils_import_direction.py, unchanged). Now both share the lower-level model.
  • Microsoft check text moves out of microsoft_utils. Text that only checks use moves to the new capability_checks/microsoft_check_text.py: sign_in, sign_in_text, grant_line, raise_for_sign_in_error, the sign-in rows and ENTRA_GROUPS_DENIED_ROW. MicrosoftSignIn moves to capability_checks/models.py. Everything graph_errors.py maps for the Outlook connector's own validation stays in microsoft_utils.
  • One summary-cut helper. fit_summary and MAX_ROW_SUMMARY_LENGTH, next to CheckRowText, replace the copies in fit_line, SharePoint, OneDrive and Outlook (_line), and Linear (_MAX_SUMMARY_CHARS). A generic shorten(text, limit) in onyx/utils/text_processing.py replaces the findings and advisory cuts.
  • Two helpers become public: raise_with_row and is_transport_failure, which the moved sign-in mapper reuses instead of copying.

How Has This Been Tested?

  • Connector, server, EE and background unit suites: 5075 passed.
  • ty is clean.
  • The import-direction test and the 40-character row test pass. The row test now also covers microsoft_check_text.

Additional Options

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

🤖 Generated with Claude Code


Summary by cubic

Consolidates the shared capability-check pieces into one home each: a single row-text model, one summary-cut helper, and capability_checks/models.py as the home of the check's Pydantic models. No behavior changes.

  • CheckRowText and MAX_ROW_SUMMARY_LENGTH move to onyx/connectors/models.py; MicrosoftRowText is deleted, and microsoft_check_text.py holds the check-only Microsoft text so microsoft_utils still never imports check code.
  • The draft-run, runner, and stored-run-progress models (state, plan, cached result, readiness, outcome, progress) move into capability_checks/models.py.
  • A shared shorten in text_processing.py replaces the per-module row and advisory truncation helpers.

Summary by CodeRabbit

  • New Features

    • Added clearer Microsoft connector sign-in results, permission guidance, and certificate-expiration warnings.
    • Added consistent capability-check statuses and result details for readiness, errors, dependencies, and partial results.
  • Bug Fixes

    • Improved Microsoft authentication and Graph error messages.
    • Standardized capability-check summaries and descriptions across connectors.
    • Improved truncation of long names and advisory messages for clearer, more readable results.