Skip to content

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

  1. Run dev env from this branch.
  2. In GL Rails console, do: Feature.enable(:dynamic_image_resizing_requester); Feature.enable(:dynamic_image_resizing_owner)
  3. Log into GL. Make sure your avatar is the uploaded image. If not, upload the avatar for your profile.
  4. Check that resizing works: open your avatar image with ?width=15 suffix. You should see a small picture - please mind the browser cache.
  5. Update dev/workhorse-config/workhorse-config.toml: set max_filesize = 1.
  6. 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.
  7. 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)
  8. In WH logs, you will see something like: ImageResizer: 93700b exceeds maximum file size of 1b
  9. 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

Merge request reports