-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add more logging for confluence perm-sync + handle case where permiss… #4586
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
Open
Weves
wants to merge
14
commits into
main
Choose a base branch
from
confluence-perm-sync
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,007
−71
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c0aef4c
Add more logging for confluence perm-sync + handle case where permiss…
Weves 3a10ec0
Make required permissions are explicit
Weves 8d3db68
more
Weves 463c1d6
Add slim fetch limit + mark all cc pairs of source type as successful…
Weves 6f11d3a
Add to dev compose
Weves be4ca24
Small teams fix
Weves 752339d
Add file
Weves 3634b61
Add single limit pagination for confluence
Weves ae7ac7a
Restrict to server only
Weves c76a9fe
more logging
Weves d05159b
cleanup
Weves 13fa2dc
Cleanup
Weves ee716be
Remove CONFLUENCE_CONNECTOR_SLIM_FETCH_LIMIT
Weves 0f33143
Handle teams error
Weves File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
backend/onyx/background/celery/tasks/external_group_syncing/group_sync_utils.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from sqlalchemy.orm import Session | ||
|
||
from ee.onyx.external_permissions.sync_params import ( | ||
source_group_sync_is_cc_pair_agnostic, | ||
) | ||
from onyx.db.connector import mark_cc_pair_as_external_group_synced | ||
from onyx.db.connector_credential_pair import get_connector_credential_pairs_for_source | ||
from onyx.db.models import ConnectorCredentialPair | ||
|
||
|
||
def _get_all_cc_pair_ids_to_mark_as_group_synced( | ||
db_session: Session, cc_pair: ConnectorCredentialPair | ||
) -> list[int]: | ||
if not source_group_sync_is_cc_pair_agnostic(cc_pair.connector.source): | ||
return [cc_pair.id] | ||
|
||
cc_pairs = get_connector_credential_pairs_for_source( | ||
db_session, cc_pair.connector.source | ||
) | ||
return [cc_pair.id for cc_pair in cc_pairs] | ||
|
||
|
||
def mark_all_relevant_cc_pairs_as_external_group_synced( | ||
db_session: Session, cc_pair: ConnectorCredentialPair | ||
) -> None: | ||
"""For some source types, one successful group sync run should count for all | ||
cc pairs of that type. This function handles that case.""" | ||
cc_pair_ids = _get_all_cc_pair_ids_to_mark_as_group_synced(db_session, cc_pair) | ||
for cc_pair_id in cc_pair_ids: | ||
mark_cc_pair_as_external_group_synced(db_session, cc_pair_id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
style: Consider keeping this as debug level since it could be very noisy in production with many users