perf: avoid redundant keyring lookups for repositories without credentials#10959
Open
radoering wants to merge 1 commit into
Open
perf: avoid redundant keyring lookups for repositories without credentials#10959radoering wants to merge 1 commit into
radoering wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- This change removes the fallback password-manager lookup when a repository config exists but returns credentials without a password; if there are scenarios where a repo is configured with only a username and relies on URL-based keyring entries, you may want to confirm that this behavior change is intentional or document that such setups are no longer supported.
- The detailed inline comment about AuthenticatorRepositoryConfig.get_http_credentials()’s behavior tightly couples this method to that implementation; consider moving some of this explanation to a shared docstring or helper so it stays accurate if the credential lookup strategy evolves.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- This change removes the fallback password-manager lookup when a repository config exists but returns credentials without a password; if there are scenarios where a repo is configured with only a username and relies on URL-based keyring entries, you may want to confirm that this behavior change is intentional or document that such setups are no longer supported.
- The detailed inline comment about AuthenticatorRepositoryConfig.get_http_credentials()’s behavior tightly couples this method to that implementation; consider moving some of this explanation to a shared docstring or helper so it stays accurate if the credential lookup strategy evolves.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- This refactor changes behavior for repositories whose configured credentials have a
Nonepassword (no longer falling back to a URL-based password manager lookup); if that case is expected in the wild, consider adding an explicit test or comment confirming that dropping the fallback is intentional. - The new explanatory comment above
_get_credentials_for_repositoryis quite dense; consider tightening it (e.g., focusing on the key point that_get_credentials_for_repositoryalready covers all meaningful keyring lookups) to make the rationale easier to scan.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- This refactor changes behavior for repositories whose configured credentials have a `None` password (no longer falling back to a URL-based password manager lookup); if that case is expected in the wild, consider adding an explicit test or comment confirming that dropping the fallback is intentional.
- The new explanatory comment above `_get_credentials_for_repository` is quite dense; consider tightening it (e.g., focusing on the key point that `_get_credentials_for_repository` already covers all meaningful keyring lookups) to make the rationale easier to scan.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
_get_credentials_for_repositoryqueries keyring so that it does not make sense to query keyring again if password is None.