-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Added confluence permission syncing #2537
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
logger.debug("Page is empty, skipping: %s", page_url) | ||
continue | ||
page_text = parse_html_page(page_html, self.confluence_client) | ||
|
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.
removed unused argument from function and function calls
user.replaceWith("@" + _get_user(user_id, confluence_client)) | ||
return format_document_soup(soup) | ||
|
||
|
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 to utils file
index_name=primary_index_name, secondary_index_name=secondary_index_name | ||
) | ||
|
||
|
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.
they may be able to be used elsewhere
documents.append(document) | ||
|
||
document_ids = [document.id for document in documents] | ||
db_docs: list[DBDocument] = get_documents_by_ids( |
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.
fixing the calling order wherever i can to make the codebase uniform :p
from danswer.db.chat import delete_chat_sessions_older_than | ||
from danswer.db.engine import get_sqlalchemy_engine | ||
from danswer.server.settings.store import load_settings | ||
from danswer.utils.logger import setup_logger |
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.
Everything in this module is just refactoring the group and doc permission syncing to be seperate
|
||
logger = setup_logger() | ||
|
||
|
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.
just read the function names/comments
], | ||
None, | ||
] | ||
|
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.
we made the source based sync functions only require the cc_pair and the session to make them more generic.
if the endpoints for a source need to run the connector to get the DocsWithAdditionalInfo, that code will be located in that endpoint
subtext: JSX.Element; | ||
} | ||
> | ||
> = { |
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.
no extra setup required to enable this one
|
||
|
||
def upgrade() -> None: | ||
# Drop the existing primary key |
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.
last pr, I indicated that the user_id and the external_user_group_id were both primary in the models.py, but not in the alembic file. so this fixes that
@@ -0,0 +1,22 @@ | |||
import bs4 | |||
|
|||
|
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 exported this function into a utils file so when I generate the id in the permission sync and when i generate the id in the connector, they match.
Maybe even more of the logic can be exported to here to make sure they match but this is it for now
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.
Hard to think about the logic while review this code but seems ok. Potentially issue with an if/elif of users and groups (commented)
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.
Approving by proxy for Yuhong
No description provided.