[wip] Fix issues of GitFS providers with GitCLI#68926
Open
dwoz wants to merge 5 commits intosaltstack:masterfrom
Open
[wip] Fix issues of GitFS providers with GitCLI#68926dwoz wants to merge 5 commits intosaltstack:masterfrom
dwoz wants to merge 5 commits intosaltstack:masterfrom
Conversation
Add a high-performance GitFS provider that interacts directly with the system's Git binary. This provider supports shallow clones (depth=1) and optimized tree traversal via ls-tree, significantly reducing latency and memory footprint at scale. Includes: - Minimum Git version check (2.3.0+) for GIT_SSH_COMMAND support. - Comprehensive unit tests for the new provider. - Integration into the existing GitFS parametrized test suite.
Ensure that mocked or third-party providers used in tests (like 'gitfoo') are not skipped if they haven't initialized their .repo attribute yet. This fixes test_update in tests/pytests/unit/runners/test_git_pillar.py.
Ensures that attributes like 'privkey' are available when verify_auth() is called during initialization via verify_provider(). This fixes the AttributeError in GitCLI unit tests.
twangboy
approved these changes
Apr 13, 2026
Contributor
|
@dwoz pygit2 appears to now supports passing depth to clone https://www.pygit2.org/repository.html#pygit2.clone_repository, but according to a comment on the still open issue may not actually work correctly (libgit2/pygit2#630 (comment)) |
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.
Salt's gitfs providers (esspecially pygit2) are prone to memory leaks and uses a lot of memory in general. Both GitPython and pygit2 lack support for fetch depth parameter which means they fetch the entire git history of the repositories being used. This can get very slow when a repository's history grows.
The GitFS provider interacts directly with the system's Git binary. This provider supports shallow clones (depth=1) and optimized tree traversal via ls-tree, significantly reducing latency and memory footprint at scale.
Includes:
git for-each-refquickly determine salt environments.