feat(connectors): connectors without named checks get the design's generic row

Merged
EV
1d ago
+872-155

Description

Backend PR for the connector checks redesign (plan item A7), stacked on #16205. A source without named checks shows the design's generic row.

The generic row

  • The fallback check is "Test connection". A pass gives "Connected".

  • A failure of the legacy validate_connector_settings probe gets a line and a description for its kind:

    KindLine
    Rejected sign-in (401)Sign-in rejected
    Denied permission (403)No permission for the connector
    Not found (404)Not found at the source
    Other settings errorSettings not accepted
    Rate limit (429)Rate limited by the source
    Connection error or timeoutCannot reach the source
    Unknown errorUnexpected response from the source
  • A typed error keeps its class. An untyped error (for example a raw requests.HTTPError) gets its class from its HTTP status, as the named checks map them. The description names the status, e.g. "(HTTP 401)".

  • The probe's own text stays the message, so Error Details show it.

  • An error that gives its own row text keeps it.

  • The check is like a sign-in: on a form run, an unreachable source fails it (fails_when_unreachable).

  • The blocking-validation recorder writes the same row, so stored reports and draft runs agree. It keeps the original error class in error_type, for support.

  • The new module capability_checks/generic_row.py holds the row text. The check and the recorder both use it.

Connectors that run nothing

  • 23 connectors keep the no-op validate_connector_settings of BaseConnector (for example GitLab, Gmail, Asana). The fallback check passed for them without a request to the source.
  • These sources now get no INDEXING check (factory.py:source_has_settings_probe). The plan and the runs hold no check, and the recorder writes no row for a pass. A failure (for example at construction) is still recorded.
  • The frontend already hides the card when no check applies. Phase C can show "No checks for this connector yet" from the same empty list. No new API field is necessary.

Not in this PR

  • The EE perm-sync fallback ("Permission sync validation") keeps its name and text. The design has no generic row for it.
  • The generic row does not set validates_binding. It needs the full config, so a create form could not unlock on it.

How Has This Been Tested?

  • New unit tests (test_generic_check_row.py): the pass line, each failure kind (typed and from an HTTP status), the status in the description and in Error Details, an error with its own row, the form-run unreachable policy, and the recorder's rows (with no row for a pass without a probe).
  • Updated test_registry_fallbacks.py (name, pass line, no check without a probe) and the ratchet test (an INDEXING check exists only with named checks or a settings probe).
  • Updated the integration test test_capability_check_run.py: a mock-connector run now holds no check. I did not run integration tests.
  • Connector, server and EE unit tests: 7878 passed, 1 failed. The failure (test_browser_lifecycle.py::test_download_is_not_retried_and_does_not_relaunch_browser) also fails on the stack below. Pre-commit is clean.

Additional Options

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

Generated by Claude Code


Summary by cubic

Sources without named checks now show the design's generic "Test connection" row instead of a pass-through fallback. Sources whose connector keeps the no-op validate_connector_settings probe get no INDEXING check.

  • The fallback maps each failure kind of the legacy settings probe to a line and description; a typed error keeps its class, an untyped one gets its class from its HTTP status (401, 403, 404, 429), and the probe's own text stays the message for Error Details.
  • The blocking-validation recorder writes the same row, so draft runs and stored reports agree, and a later pass on a source without a settings probe replaces an earlier stale failure.
  • Fallback checks keep the original stack trace in Error Details for every error kind, and the EE permission-sync fallback keeps its existing name and text, since the generic row does not apply to it.

Summary by CodeRabbit

  • New Features

    • Added a standardized “Test connection” capability check for connectors with settings validation.
    • Successful checks now display “Connected” with consistent results.
    • Connection failures provide clearer, categorized error messages, including relevant HTTP status details.
  • Bug Fixes

    • Capability-check results now correctly reflect successful validation after an earlier connection failure.
    • Sources without an applicable settings validation no longer display an unnecessary indexing check.
  • Documentation

    • Clarified how connector validation checks appear in capability-check reports.