-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Added permissions syncing for slack #2602
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -38,47 +36,18 @@ | |||
# list of messages in a thread | |||
ThreadType = list[MessageType] | |||
|
|||
basic_retry_wrapper = retry_builder() | |||
|
|||
|
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.
moved this stuff to the utils file
@@ -88,19 +57,38 @@ def _get_channels( | |||
def get_channels( | |||
client: WebClient, | |||
exclude_archived: bool = True, |
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.
changed this function to be able to request public or private channels separately
added defaults to keep behavior identical
@@ -328,7 +316,44 @@ def get_all_docs( | |||
) | |||
|
|||
|
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.
Added this to make it an order of magnitude faster than running the whole connector each time
@@ -349,14 +374,24 @@ def load_credentials(self, credentials: dict[str, Any]) -> dict[str, Any] | None | |||
self.client = WebClient(token=bot_token) | |||
return None | |||
|
|||
def retrieve_all_source_ids(self) -> set[str]: |
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 means pruning will run an order of magnitude faster now as well
@@ -0,0 +1,89 @@ | |||
""" |
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 comment is correct. Just keeping this here in casse we add support for group based stuff in the future. It's tested to work
|
||
from danswer.connectors.slack.connector import make_paginated_slack_api_call_w_retries | ||
|
||
|
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 exists to create a map of all slack user ids to emails because the other calls return the slack user ids but we need the emails
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.
didn't read too carefully, be sure to test!
* Added permissions syncing for slack * add no email case handling * mypy fixes
No description provided.