Skip to content

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
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Weves
Copy link
Contributor

@Weves Weves commented Apr 22, 2025

…ions are removed from the access token.

Also has:

  • Ability to fetch items one-by-one in the case of a 500 for confluence server.
  • Small teams fix

Fixes https://linear.app/danswer/issue/DAN-1932/permission-sync-500

Description

[Provide a brief description of the changes in this PR]

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@Weves Weves requested a review from a team as a code owner April 22, 2025 20:06
Copy link

vercel bot commented Apr 22, 2025

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 May 1, 2025 4:26pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR enhances logging and error handling in Confluence permission synchronization, focusing on better visibility and secure defaults when permissions cannot be determined.

  • Added detailed logging in doc_sync.py for space permissions and document restrictions with elevated log levels for better visibility
  • Implemented secure fallback in doc_sync.py to make documents inaccessible when permissions cannot be determined
  • Added handling in doc_sync.py for documents that exist in DB but are no longer accessible in Confluence
  • Enhanced error messages in doc_sync.py with specific details about permission-related issues
  • Elevated log levels in group_sync.py from debug to info for user processing and group assignment visibility

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -17,7 +17,7 @@ def _build_group_member_email_map(
) -> dict[str, set[str]]:
group_member_emails: dict[str, set[str]] = {}
for user in confluence_client.paginated_cql_user_retrieval():
logger.debug(f"Processing groups for user: {user}")
logger.info(f"Processing groups for user: {user}")
Copy link
Contributor

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

.get("user", {})
.get("displayName", "Unknown User")
)
# NOTE: needs to be done this weird way because sometime we get back `None` for
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small teams fix

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.

1 participant