Merged
Conversation
Contributor
Author
|
I've change the seeds to generate much more attachments and seed attachments for all uploaders defined with CW. This modified seed process creates 13322 attachments with a total size of 584M.
In both cases all the files were migrated with the same checksum. I've used the files used by seeds usually and added another one for some new attachments. These are the files:
It would be nice to test the task in a more realistic environment |
5f6b12d to
20a2059
Compare
4544f40 to
7346e1b
Compare
Contributor
Author
|
Rebased on top of |
7346e1b to
c65d370
Compare
d6b1a29 to
6bda58d
Compare
…chment! CarrierWaveMigratorService method
When attachment is remote and large enough the file is stored in a Tempfile, but if it's small URI.open returns a StringIO. This methods calculates the checksum correctly both when original attachment is local or stored remotely
9405466 to
088c28c
Compare
entantoencuanto
added a commit
that referenced
this pull request
Jul 26, 2021
* develop: (32 commits) Remove obsolete rake webpack task (#8237) Active storage migrations service (#7902) Fix content type delegation to blank attachments (#8230) Evote bug fixing (#8220) Fix the proposal data migration for proposals without authors or organization (#8015) Bump addressable version because security issues (#8229) Online meetings iframe visibility with time (#8097) Meetings iframe and iframe URL (#8096) Remove flaky test on meetings (#8226) Fix broken tests after problematic PRs (#8224) Apply permissions system to comments (#8035) Set current_component as commentable when commentable is a participatory space (#8189) Fix don't require inactive authorization handlers (#8122) Improve metrics calculations performance (#8215) Fix performance issue in notification settings page (#8155) Active storage migration (#7598) Update manual installation guide in documentation (#8217) Load JS configuration in elections focus mode layout (#8213) Fix user activity pagination when there are hidden items (#8202) Make it possible to define SCSS settings overrides from modules (#8198) ...
roxanaopr
pushed a commit
to i-need-another-coffee/decidim
that referenced
this pull request
Jul 29, 2021
* Add service to migrate CarrierWave attachments to ActiveStorage * WIP * Change migration to add checks, migrate content blocks and use CW uploaders * Include check info in migration tasks * Remove duplication * Prepare migration service to work with CarrierWave::Storage::Fog attachments * Disable rubocop offense to allow excess of parameters in migrate_attachment! CarrierWaveMigratorService method * Change checksum calculation of file depending of its type When attachment is remote and large enough the file is stored in a Tempfile, but if it's small URI.open returns a StringIO. This methods calculates the checksum correctly both when original attachment is local or stored remotely * Fix rubocop offense * Remove unused method * fix: don't migrate models from modules not loaded * Fix file cw_file method when cw attachments are stored in local filesystem * Fix lint issues * Force the loading of the models in MIGRATION_ATTRIBUTES constant * Skip allowlists in CW uploaders * Use relative path in favicon_link_tag * Update CHANGELOG.md * Use protocol if required in urls generated by application_uploader * Revert "Use relative path in favicon_link_tag" This reverts commit 09542dd. Co-authored-by: Fernando Blat <fernando@blat.es> Co-authored-by: Leonardo Diez <leiodd@gmail.com>
roxanaopr
pushed a commit
to i-need-another-coffee/decidim
that referenced
this pull request
Aug 10, 2021
* Add service to migrate CarrierWave attachments to ActiveStorage * WIP * Change migration to add checks, migrate content blocks and use CW uploaders * Include check info in migration tasks * Remove duplication * Prepare migration service to work with CarrierWave::Storage::Fog attachments * Disable rubocop offense to allow excess of parameters in migrate_attachment! CarrierWaveMigratorService method * Change checksum calculation of file depending of its type When attachment is remote and large enough the file is stored in a Tempfile, but if it's small URI.open returns a StringIO. This methods calculates the checksum correctly both when original attachment is local or stored remotely * Fix rubocop offense * Remove unused method * fix: don't migrate models from modules not loaded * Fix file cw_file method when cw attachments are stored in local filesystem * Fix lint issues * Force the loading of the models in MIGRATION_ATTRIBUTES constant * Skip allowlists in CW uploaders * Use relative path in favicon_link_tag * Update CHANGELOG.md * Use protocol if required in urls generated by application_uploader * Revert "Use relative path in favicon_link_tag" This reverts commit 09542dd. Co-authored-by: Fernando Blat <fernando@blat.es> Co-authored-by: Leonardo Diez <leiodd@gmail.com>
takahashim
added a commit
to takahashim/decidim-cfj
that referenced
this pull request
Jun 13, 2022
…ploader and add `url` method that was originally added in Decidim::ApplicationUploader see also: decidim/decidim#7902
6 tasks
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.
🎩 What? Why?
This PR add the tasks required to migrate files in CarrierWave to ActiveStorage attachments:
tmp/attachment_mappings.csv. If the task detects that there already exists an attached file with ActiveStorage the export is skipped and no checks are made. To run this task execute:Both tasks generate a log file in
log/with the result of the migration of each file and/or the checksum verification result.📌 Related Issues
Link your PR to an issue
Testing
Describe the best way to test or validate your PR.
📋 Checklist
🚨 Please review the guidelines for contributing to this repository.
docs/.📷 Screenshots
Please add screenshots of the changes you're proposing
