-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Outlook] Feature: Office365 multi-user support #2844
base: main
Are you sure you want to change the base?
[Outlook] Feature: Office365 multi-user support #2844
Conversation
💚 CLA has been signed |
Introduced BaseOffice365User abstract base class to standardize Office 365 user handling. Added MultiOffice365Users to manage multiple emails from config. Added client_emails (comma-separated) in OutlookDataSource config. Resolved issue with fetching too many users causing SMTP server not found error.
37f7483
to
897fed8
Compare
buildkite test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Thanks for submitting a patch! I've left a few comments, but overall I think this is a pretty clean approach and solves a clear ask.
Outside of the below comments, I'd also request that you change the
Closes #2843
in your PR description to use "Relates to" or "Part of", since another part of the issue you filed is that the current solution is limited to 999 users. I expect that's something we can better control with the graph API and another separate configuration, for folks who want "all users", and have more than 999.
): | ||
async for response in source.client._get_user_instance.get_users(): | ||
user_mails = [user["mail"] for user in response["value"]] | ||
users.extend(user_mails) | ||
assert users == ["[email protected]", "[email protected]"] | ||
|
||
client_emails = "[email protected]" | ||
async with create_outlook_source(client_emails=client_emails) as source: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest making these their own test functions. That way, any failures are more easily identifyable, and they can have more focused test names to help the reader understand what's being tested.
@seanstory After rechecking the code, I realized I was mistaken in my initial description. The code isn't limited to fetching the top 999 users—it handles pagination using the @odata.nextLink property from the Microsoft Graph API, which retrieves all users. I missed that detail. I'll update my issue description to reflect the correct behavior. connectors/connectors/sources/outlook.py Lines 411 to 429 in 6e74c3a
|
…Cloud connector - Refactored the method to utilize Microsoft Graph's JSON batching feature. - The method now processes client emails in batches of up to 20 to optimize API requests. - Added error handling for individual user fetch errors within the batch response. - If any batch request fails, the method collects the errors and raises an exception with details.
buildkite test this |
Lint still fails due to async-related issues. Autoformat doesn't solve the lint errors. I'll investigate further after completing test functions. If unable to resolve, I'll seek assistance |
Introduced BaseOffice365User abstract base class to standardize Office 365 user handling. Added MultiOffice365Users to manage multiple emails from config. Added client_emails (comma-separated) in OutlookDataSource config. Resolved issue with fetching too many users causing SMTP server not found error.
Closes #2843
Checklists
Pre-Review Checklist
config.yml.example
)