refactor: Enhance checkpoint file exclusion system #1363
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.
Comprehensive update to the checkpoints exclusion module:
Context
Comprehensive update to the checkpoints exclusion module: The changes refactor the checkpoint file exclusion system, improving its organization, extensibility, and coverage of files that should be excluded when creating checkpoints. This reduces checkpoint size and improves performance by avoiding unnecessary tracking of irrelevant files.
Implementation
The changes modularize the exclusion logic in
src/services/checkpoints/constants.ts
. Previously, all exclusion patterns were defined in a single large array (GIT_EXCLUDES
). The refactoring introduces several key improvements:getBuildArtifactPatterns()
,getMediaFilePatterns()
,getCacheFilePatterns()
, etc. This improves readability and makes it easier to manage and update specific types of exclusions.CheckpointExclusions
module. This documentation clarifies the file filtering strategy and how the different parts of the module work together.getDefaultExclusions()
,writeExcludesFile()
, andgetLfsPatterns()
, have been added to handle Git LFS pattern integration and writing the combined exclusion patterns to Git's exclude file.getDefaultExclusions()
function: This function now combines all category-specific exclusions and also incorporates Git LFS patterns. The oldGIT_EXCLUDES
is deprecated and now just callsgetDefaultExclusions()
.ExclusionResult
Interface: This interface is added to define the return of an exclusion check.Screenshots