feat(connectors): Outlook checks follow the design's rows, copy and states
Description
Thirteenth backend PR for the connector checks redesign, stacked on #16203. Outlook follows the design's rows, copy and states. It uses the shared Microsoft sign-in and Graph error rows from the Microsoft helpers PR.
Outlook
- Rows:
- The 7 checks are the design's 6 rows, with its names: "Sign in to Microsoft", "List mailboxes", "Find selected mailboxes", "Find selected groups", "Sample mail", "Sample calendars".
- The mailbox count (a discovery check) shares the "List mailboxes" row (
row_id). "List mailboxes" setsvalidates_binding, as the design's form unlock says. - Dependencies follow the design's run order: every row after "List mailboxes" runs after it.
- Copy:
- Every failure gives the design's line and description, with the grant the app needs ("Grant
Mail.Read(Microsoft Graph, application) and admin-consent it."). - Passing checks give what they found: "Tenant user list is readable", "Up to {n} mailboxes", "All {n} selected mailboxes open", "All {n} selected groups found", "Read mail in {mailbox}", "Read an event in {mailbox}".
- A mailbox the admin did not name stays unnamed: the lines say "a sampled mailbox".
- Every failure gives the design's line and description, with the grant the app needs ("Grant
- Partial finds: "Find selected mailboxes" and "Find selected groups".
- Some unreachable: Incomplete, for example "Mailbox not found: ghost@contoso.com" or "2 of 3 groups not found".
- None found: Failed ("No selected mailbox found", "No selected group found").
- The samples open the first selected mailbox that answers, and walk the groups that resolve. Before, they failed on the first missing one.
- Honest passes. These checks passed while testing nothing:
- An empty mailbox: now Incomplete ("No mail found in {mailbox}").
- A calendar with no events: now Incomplete ("No events found to test").
- "Sample calendars" when calendars are off: now does not apply (no row). Before, it passed with no call.
- "Find selected mailboxes" and "Find selected groups" with nothing selected: now do not apply. Before, they passed with no call.
- A sample message without attachments still passes, with a caveat.
- Other states. Empty pages from Graph ("EmptyPages") are Incomplete ("Message listing did not finish", "Event listing did not finish", "Mailbox lookup did not finish"), not unexpected errors. A group lookup that never ends is "Group lookup did not end".
Shared code. describe_unavailable_mailboxes and describe_unavailable_groups (outlook/mailboxes.py) return typed problems, so the checks and the connector's validation read one list. The connector's validation message is unchanged.
Not in this PR: the design's two-step "List mailboxes" row ("counting…", and the caveat "Could not count every mailbox"). That needs the planned two-step framework PR (A4). Until then, the two checks share one row through row_id.
How Has This Been Tested?
- New unit tests (
test_outlook_check_row_text.py): the names and the shared row, the pass lines (named and sampled mailboxes), the attachment caveat, the user denial and the stopped samples, the partial mailbox find (and that the sample opens the found mailbox), none found, the group rows, the empty mailbox, the body and event-body denials, empty pages, no events, and the rate limit. - Existing Outlook tests updated to the new states.
- Connector, server and EE unit tests (top of the Microsoft stack): 5599 passed, 1 failed (
web/test_browser_lifecycle.py, a web connector test that also fails without this change), 25 skipped.tyand pre-commit are clean. - Outlook has no live capability-check test.
Additional Options
- [Optional] Please cherry-pick this PR to the latest release version.
- [Optional] Override Linear Check
Generated by Claude Code
Summary by cubic
Reworks Outlook's capability checks to match the design's rows, copy, and states so the checks screen reads consistently with the other Microsoft connectors.
- Maps the 7 checks onto the design's 6 rows: the mailbox count shares the "List mailboxes" row via
row_id, which now validates the credential binding, and every later row runs after it. - Every failure names the grant the app needs, and passing checks report what they found, like "Up to {n} mailboxes" or "Read a sampled mailbox". A capped count says "At least {n} mailboxes".
- "Find selected mailboxes" and "Find selected groups" are partial finds: some unreachable is Incomplete, none found is Failed. The summary names the missing item, cut to fit; the description gives the full address and reason.
- Checks that previously passed without testing anything now report honestly: empty mailboxes and calendars are Incomplete, and samples with nothing selected or calendars off do not apply.
- Graph's empty pages map to Incomplete instead of unexpected errors.
MailboxProblem,GroupProblem, andMailboxSamplelive inoutlook/models.py;describe_unavailable_mailboxesanddescribe_unavailable_groupsreturn typed problems so the checks and connector validation read one list. The Outlook check tests share their gateway and context builders from a helper module.- The design's two-step "List mailboxes" counting row is deferred to the planned two-step framework PR.
Summary by CodeRabbit
- Enhancements
- Improved Outlook connection checks with clearer results for mailbox, group, mail, and calendar access.
- Checks now distinguish permission issues, unavailable resources, empty data, and incomplete validation.
- Partial results are reported when some configured mailboxes or groups cannot be accessed.
- Added targeted guidance for resolving access and content-visibility issues.
- Improved handling of mailbox limits, pagination, attachments, event details, and throttling.