Add smart prune support to GitDestination#112
Open
armooo wants to merge 1 commit intogoogle:masterfrom
Open
Conversation
Smart prune support works by only adding files from TransformResult.getAffectedFilesForSmartPrune to the git index. This causes files that only changed due to non-reversible transforms to be excluded from the commit. Smart prune is also a large performance improvement when the workflow's destination_files are a small subset of a large monorepo. The behavior without smart prune is to remove most of the SoT repo from the index only to then add it back in AddExcludedFilesToIndex. I am not sure if the git smart prune behavior matches that of other destinations because getAffectedFilesForSmartPrune was only used in a few tests in the OSS codebase. But given the API of TransformResult I am assuming the piper destination must be doing something similar.
Collaborator
|
Hi, Sorry for the delay. I'll try to review this soon. |
Collaborator
|
thanks for the change :) |
Collaborator
|
Some update on this, we are working on a better smart prune. We think it git.destination could also benefit from it. But the tests added here are interesting to have once the implementation is done. |
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.
Smart prune support works by only adding files from
TransformResult.getAffectedFilesForSmartPrune to the git index. This
causes files that only changed due to non-reversible transforms to be
excluded from the commit.
Smart prune is also a large performance improvement when the workflow's
destination_files are a small subset of a large monorepo. The behavior
without smart prune is to remove most of the SoT repo from the index
only to then add it back in AddExcludedFilesToIndex.
I am not sure if the git smart prune behavior matches that of other
destinations because getAffectedFilesForSmartPrune was only used in a
few tests in the OSS codebase. But given the API of TransformResult I
am assuming the piper destination must be doing something similar.