DEV-15815 Added dedupe function to spending_level_to_process validation - #4729
Merged
Conversation
…nyShield before earlier code change. This fixes the original input.
…el list to allow deduplication to succeed and maintain deduped order
…emoving now-unreachable code
sethstoudenmier
approved these changes
Aug 17, 2026
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.
Description:
DEV-15815: Raw spending_level bypasses TinyShield, amplifies download work [f-7a786b75]
The
/api/v2/download/search/endpoint should handle duplicate values provided to thespending_levelfilter without generating multiple download files.Technical Details:
The
/download/v2/request_validations.py'sSearchDownloadValidatorclass allows a user to pass a list of spending_level values in their request for files to download, but the list is never deduplicated. A single request could therefore result in the same download file being generated multiple times, unnecessarily increasing the load on the system's resources. The solution is to update the spending_level list prior to TinyShield validation so that the original values passed through the entire class are deduplicated from the start.NOTE: A good amount of code was updated with
uv run ruff formatin the updated files.Requirements for PR Merge:
Explain N/A in above checklist: