Skip to content
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

Merged
merged 6 commits into from
Sep 30, 2024
Merged

Added permissions syncing for slack #2602

merged 6 commits into from
Sep 30, 2024

Conversation

hagen-danswer
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Sep 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 2:41pm

@@ -38,47 +36,18 @@
# list of messages in a thread
ThreadType = list[MessageType]

basic_retry_wrapper = retry_builder()


Copy link
Contributor Author

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,
Copy link
Contributor Author

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(
)


Copy link
Contributor Author

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]:
Copy link
Contributor Author

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 @@
"""
Copy link
Contributor Author

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


Copy link
Contributor Author

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

Copy link
Contributor

@yuhongsun96 yuhongsun96 left a 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!

@hagen-danswer hagen-danswer added this pull request to the merge queue Sep 30, 2024
github-merge-queue bot pushed a commit that referenced this pull request Sep 30, 2024
* Added permissions syncing for slack

* add no email case handling

* mypy fixes
@hagen-danswer hagen-danswer removed this pull request from the merge queue due to a manual request Sep 30, 2024
@hagen-danswer hagen-danswer added this pull request to the merge queue Sep 30, 2024
Merged via the queue into main with commit b005690 Sep 30, 2024
7 checks passed
@hagen-danswer hagen-danswer deleted the slack-perm-sync branch September 30, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants