-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AO3-5578 Use ActiveStorage for existing image uploads #4807
base: master
Are you sure you want to change the base?
Conversation
Because ActiveStorage doesn't support prefixes within buckets well, we'll need to update the Ansible local config to separate things out IMO that's better anyways, since we currently co-mingle some production and non-production things... 😬 There's probably a way to do this with less friction, but I think this should be OK since we're copying things over |
Looks like #4738 (AO3-6324' comments) agree with you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look at all the code except for the rake task.
The fixtures in test/fixtures/pseuds.yml
have (empty) lines for icon_file_name
, icon_content_type
, icon_updated_at
and icon_file_size
that should probably be removed.
I think there should be a followup Jira issue to remove the icon_file_name
, icon_content_type
, icon_updated_at
and icon_file_size
columns from the database for the affected classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few final comments. The rake task looks good, as does the rest of the code.
I also tried a few things in local dev, including looking at various icons in various places, uploading a pseud icon and using that to test the validator and resizing. Resizing acts the same as on production.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found how to fix the tests.
At this point, I'm a bit at a loss for how to make mutes/blocks not generate n+1. This should do something, but it ends up doing nothing???
@@ -25,11 +25,23 @@ def load_collection_from_id | |||
|
|||
def index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up deleting the N+1 spec for this method, as it was flagging something unrelated and we want to move collections to Elasticsearch anyways (also I'd like to keep the PR from getting too much out of hand 🙈)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked over everything again and mostly have some comments on the scopes! Thank you for the work on the N+1 query prevention and specs, those were more annoying than I had expected.
This reverts commit 8c89db2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some more nitpicks, then this is finally done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🎉 🎉
Pull Request Checklist
Issue
https://otwarchive.atlassian.net/browse/AO3-5578
Purpose
Migrate existing places that use kt-paperclip to ActiveStorage (pseud, collection, and skin icons)
Credit
Brian Austin (they/he)