Add Image Resizer config defaults
What does this MR do?
Add default Image Resizer config values.
They were added in gitlab-org/gitlab-workhorse!615 (merged).
If (while) they are missing, we are falling back to the same defaults, but in the Workhorse code.
Omnibus MR: gitlab-org/omnibus-gitlab!4639 (merged)
Related issues
gitlab-org/gitlab-workhorse#298 (closed)
How to test manually
- Run dev env from this branch.
- In GL Rails console, do:
Feature.enable(:dynamic_image_resizing_requester); Feature.enable(:dynamic_image_resizing_owner)
- Log into GL. Make sure your avatar is the uploaded image. If not, upload the avatar for your profile.
- Check that resizing works: open your avatar image with
?width=15
suffix. You should see a small picture - please mind the browser cache. - Update
dev/workhorse-config/workhorse-config.toml
: setmax_filesize = 1
. - Restart everything to pick up the updated config. I needed to set up my avatar again, seems like the state wasn't saved, even though FFs in the DB were not flushed.
- Now, every image > 1kb will fail to match the criteria, so when we do
?width=15
on our avatar, it will return the original, full-sized image (it is the fallback mechanism) - In WH logs, you will see something like:
ImageResizer: 93700b exceeds maximum file size of 1b
- Now we know that the config is working.
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion
Required
-
Merge Request Title, and Description are up to date, accurate, and descriptive -
MR targeting the appropriate branch -
MR has a green pipeline on GitLab.com
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes -- I am not sure how this may look like - [-] Documentation created/updated -- Which docs should I update?
- [-] Integration tests added to GitLab QA -- If something is wrong with configs, we fall back to defaults, not sure if needed
- [-] The impact any change in container size has should be evaluated -- Don't expect any impact
Edited by Aleksei Lipniagov