feat: incomplete check status and error kinds

Merged
EV
3d ago
+625-227

Description

First backend PR for the connector checks redesign. It splits today's "indeterminate" status into a clear status and a reason.

  • incomplete status. A check that did not finish, or could not decide, is now incomplete. indeterminate stays as a legacy value. Stored reports, run history and in-flight draft runs still hold it, and every gate treats it the same as incomplete: the verdict, the indexing hold, the pairing block and perm_sync_valid.
  • error_kind on each FAILED or INCOMPLETE result: rejected, permission, invalid, rate_limited, timeout, unreachable, unexpected. The form can then tell the cases apart without reading the message. It comes from the exception class (models.py:check_error_kind).
  • Sign-in policy. A check with fails_when_unreachable FAILS on a timeout or an unreachable source, but only on a form run (a draft run or a pair dry run). Stored, scheduled and indexing-time runs keep it INCOMPLETE, so a slow source never holds indexing or blocks a pairing. A rate limit or a server error stays INCOMPLETE: the source answered. A draft run does not cache a FAILED result of a transient kind.
  • Typed errors. RateLimitedValidationError and UnreachableValidationError subclass UnexpectedValidationError, so existing handlers keep working. Confluence and Jira raise them and mark their sign-in checks. The other connectors convert in their own PRs.
  • Frontend. A small compatibility change only: the checks card, its progress ring and the run-history popover show incomplete exactly as they show indeterminate, so nothing on screen changes. The redesigned card is the frontend owner's work.

How Has This Been Tested?

  • New unit tests (test_check_error_kinds.py):
    • each exception's status and kind;
    • the sign-in policy on form runs and other runs;
    • a legacy indeterminate result aggregates the same;
    • a transient FAILED is not cached.
  • The existing check tests now assert incomplete. The first-indexing-hold test covers both values.
  • Runs:
    • connector and EE unit tests (the only failures are the license tests that also fail on main);
    • the 93 capability-check external dependency tests, on a scratch DB;
    • Jest for the connector views, with a new progress test;
    • the web type check.

Additional Options

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

🤖 Generated with Claude Code


Summary by cubic

Splits the indeterminate connector check status into a distinct incomplete status plus an error_kind on every FAILED or INCOMPLETE result, so a check that did not finish or could not decide is no longer conflated with a clear failure. indeterminate stays as a legacy value on stored reports and in-flight runs, and reads the same as incomplete.

Sign-in policy

  • A check with fails_when_unreachable FAILS on a form run (draft run or pair dry run) when the source times out or is unreachable; other runs keep it INCOMPLETE, so a slow source never holds indexing or blocks a pairing.
  • Rate limits and server errors stay INCOMPLETE: the source answered.
  • Draft runs do not cache a FAILED result of a transient kind (rate limited, timeout, unreachable, unexpected).
  • A check left unfinished when a refused pairing stores the report is stored as INCOMPLETE with the timeout kind.
  • error_kind values: rejected, permission, invalid, rate_limited, timeout, unreachable, unexpected; check_error_kind maps the exception class.
  • New RateLimitedValidationError and UnreachableValidationError subclass UnexpectedValidationError; Confluence and Jira raise them and mark their sign-in checks, with other connectors converting in their own PRs.

Frontend

  • The checks card, progress ring, and run-history popover show incomplete exactly as they show indeterminate, so nothing on screen changes there.
  • The edit plan now counts an incomplete check as a warning and shows "Validation passed with warnings"; before, it claimed all checks passed.

Summary by CodeRabbit

  • Bug Fixes
    • Connector checks now distinguish incomplete results, such as timeouts or temporary service issues, from confirmed failures. Incomplete results appear as unverified warnings, and older reports remain supported.
    • Sign-in checks that cannot reach a source are marked as failed during draft and pair dry runs.
    • Incomplete checks no longer hold indexing; confirmed failures still do.
    • Check summaries group incomplete and legacy indeterminate results as unverified.