Skip to content
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

[#161102] Adds active_storage_for_images_only feature flag #3348

Merged
merged 7 commits into from
Jan 30, 2023

Conversation

jossim
Copy link
Contributor

@jossim jossim commented Jan 24, 2023

Release Notes

This adds the active_storage_for_images_only feature flag to allow for the use of ActiveStorage just for DownloadableFiles::Image.

Since UMass would like to use images but is using Paperclip otherwise, this will allow them to add images via ActiveStorage so there's less to migrate over to ActiveStorage when the time comes.

This turns on ActiveStroage, just for the Image module.

This PR also sets an enviroment variable for `facility_tile_list`
@jossim jossim changed the title [#161102] Adds active_storage_for_images feature flag [#161102] Adds active_storage_for_images_only feature flag Jan 26, 2023
@jossim jossim marked this pull request as ready for review January 26, 2023 23:13
@jossim jossim requested a review from a team as a code owner January 26, 2023 23:13
@jossim jossim requested a review from giladshanan January 26, 2023 23:13
@@ -9,7 +9,7 @@ module ActiveStorageFile
has_one_attached :file

def assign_attributes(new_attributes)
if SettingsHelper.feature_on?(:active_storage)
if SettingsHelper.active_storage_enabled?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this feature flag here? I can't recall if we need it for some reason or perhaps it was left over from a previous iteration of the code, before we separated things into modules

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also can't recall. It passes CI with it removed though, so I suppose it's fine to leave it out. I recall this method causing a lot of problems, so likely extra stuff was left in it while working up to a solution.

@@ -29,6 +29,10 @@ def self.relays_enabled_for_reservation?
setting "relays.#{Rails.env}.reservation_enabled"
end

def self.active_storage_enabled?
feature_on?(:active_storage) || feature_on?(:active_storage_for_images_only)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm leaning towards letting each feature flag do its own thing - what's your thinking about intertwining here?

If we keep this logic I'd vote for renaming to active_storage_for_images_enabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of how the flags are named, it seemed like active_storage could/would be a superset of active_storage_for_images_only. Also doing it this way would mean no change in OSU's settings.yml. Neither of these may be interesting enough reasons, don't have a strong opinion.

@jossim jossim requested a review from giladshanan January 27, 2023 21:39
Copy link
Collaborator

@giladshanan giladshanan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@jossim jossim merged commit b4fdc1d into master Jan 30, 2023
@jossim jossim deleted the 161102-active-storage-for-images-flag branch January 30, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants