Improve GitGuardian API calls
What does this MR do and why?
There are two commits here. Since they are changing the same code base
Limit file name sizes
In Gitlab::GitGuardian::Client
- Makes a class constant
FILENAME_LIMIT
- Makes a private method
limit_filename
to shorten the string from the start of the string because we need the file extension for policies.
Thread
class
Parellelize batched requests using the In GitGuardian we can only send requests in batches of 20 blobs at the time.
Sending them synchronously increases the chances that /internal/allowed
endpoint times out. That is why we decided to send them in threads.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
For more context: &11494 (comment 1772665324)
Closes #442188 (closed) #442200 (closed)
Edited by Patrick Cyiza