Skip to content

Conversation

@zas
Copy link
Collaborator

@zas zas commented Dec 10, 2025

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

  • JIRA ticket (optional): PICARD-XXX

Solution

Action

Additional actions required:

  • Update Picard documentation (please include a reference to this PR)
  • Other (please specify below)

@zas zas requested a review from phw December 10, 2025 13:14
Copy link
Member

@phw phw left a comment

Choose a reason for hiding this comment

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

Mostly straight forward conversion of the API to the abstraction. Looks good to me, even if it is a lot of code and github has trouble showing everything.

I just wonder whether we should remove the code that tries to handle the case that no git backend is available. I don't think this is currently working as expected.

Git is used at so many places both in plugin.py and manager.py that it is unclear how and what should even work without the git code. The factory provides has_git_backend, but the implementation contradicts the pygit2 implementation.

In plugin.py there is a comment "Git backend will handle availability check", but I'm unsure what actually would happen if it is not available.

@zas zas force-pushed the wrap_pygit2 branch 3 times, most recently from 067e596 to 5586368 Compare December 10, 2025 14:15
@zas
Copy link
Collaborator Author

zas commented Dec 10, 2025

I just wonder whether we should remove the code that tries to handle the case that no git backend is available. I don't think this is currently working as expected.

If we have no git backend, I guess we should totally disable plugins since they depend on it.
It should be addressed by 7c89da2

Since previous commit:
- Implement complete git backend abstraction layer (GitBackend, Pygit2Backend)
- Replace all direct pygit2 usage with backend interface throughout codebase
- Optimize remote fetching to target 'origin' remote specifically instead of all remotes
- Migrate all tests to use git backend helper functions for consistency
- Fix commit.oid -> commit.id for pygit2 API compatibility
- Add proper error handling with GitBackendError hierarchy
- Simplify remote fetching logic by removing unnecessary fallbacks
- Add git backend singleton reset between tests for proper isolation

New debug option:
- Add GIT_BACKEND debug flag to log git backend method calls for troubleshooting
@zas zas merged commit f56dd11 into metabrainz:master Dec 10, 2025
48 checks passed
@zas zas deleted the wrap_pygit2 branch December 10, 2025 15:24
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