Generate smaller image sizes for Designs
What does this MR do?
This MR adds a new DesignV432x230Uploader
to generate and serve smaller
versions of design files.
The original (full-sized) design files are stored in Git LFS, and so
have a different uploader, LfsObjectUploader
.
The decision to make a separate uploader to handle just the smaller
image versions came out of a discussion in
!20511 (closed). Initially,
the direction taken was to make LfsObjectUploader
conditionally generate
smaller images for LfsObject
files. The feedback was that this was
adding logic that was too specific to design management into an uploader
that is very general, and that we should use a separate uploader to
handle just the smaller image versions.
A service now runs after a new DesignManagement::Version
has been created, which
downloads the original design files from their Git LFS storage and generates
smaller versions, storing them in the regular uploads storage.
Feature Flag
This change is behind the :design_management_resize_images
feature flag.
Database Changes
Migration output
== 20191206014412 AddImageToDesignManagementDesignsVersions: migrating ========
-- add_column(:design_management_designs_versions, :image_v432x230, :string, {:limit=>255})
-> 0.0043s
== 20191206014412 AddImageToDesignManagementDesignsVersions: migrated (0.0045s)
== 20200203015140 AddIdToDesignManagementDesignsVersions: migrating ===========
-- add_column(:design_management_designs_versions, :id, :primary_key)
-> 0.0292s
== 20200203015140 AddIdToDesignManagementDesignsVersions: migrated (0.0293s) ==
AddIdToDesignManagementDesignsVersions
database-lab output of exec ALTER TABLE "design_management_designs_versions" ADD "id" bigserial primary key;
The query has been executed. Duration: 273.000 ms (edited)
Migration rollback
From !22860 (comment 272904712):
bundle exec rake db:migrate:down VERSION=20191206014412
bundle exec rake db:migrate:down VERSION=20200203015140
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content