-
Notifications
You must be signed in to change notification settings - Fork 14
fix: fix part count limit exceeded by enabling multi-file batching [PS-87] #497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
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
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
alina-d-m
reviewed
Dec 4, 2025
alina-d-m
reviewed
Dec 4, 2025
alina-d-m
reviewed
Dec 4, 2025
alina-d-m
reviewed
Dec 4, 2025
alina-d-m
reviewed
Dec 4, 2025
alina-d-m
reviewed
Dec 5, 2025
alina-d-m
reviewed
Dec 5, 2025
89f08c3 to
6b58174
Compare
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.
https://snyksec.atlassian.net/browse/PS-87
Summary
This PR optimizes the
fileupload.Clientto support effective batching when receiving pre-filtered lists of files (from the Secrets CLI extension). This ensures uploads respect thescm-bundle-storelimits.Problem
The core issue lay in the file batching logic, which failed to group files effectively when provided with a list of pre-filtered files (rather than a directory walk), resulting in batches containing only a single file. This rapid sequence of small uploads quickly exhausted the
partCountPerRevisionlimit (50) inscm-bundle-storeservice.Furthermore, the per-file root calculation caused relative file locations to be flattened, resulting in the loss of the original directory hierarchy once uploaded.
Solution
We now aggregate the input files into a channel and dynamically calculate a Common Root (lowest common ancestor) for the group. This allows the
fileupload.Clientto effectively group multiple files into a single batch while respecting theaddPathsToRevisionsignature, which enforces a singlerootargument per batch.Behavior Change (before vs. after)
The logic change affects how the relative path is determined. Previously, using a per-file root effectively flattened the path (ignoring directory structure). Now, the directory structure is preserved relative to the calculated common root.
Example File:
/Users/user/snyk-code/fake-leaks-small/data/static/web3-snippets/JuiceShopSBT.solBefore:
.../fake-leaks-small/JuiceShopSBT.sol(Flattened - effectivelyBase(file))After:
Test ran from:
.../fake-leaks-small/Uploaded as:
data/static/web3-snippets/JuiceShopSBT.sol(Tree Preserved relative to common root)Test ran from:
.../fake-leaks-small/dataUploaded as:
static/web3-snippets/JuiceShopSBT.sol(Tree Preserved relative to data)