docbrown/app/models
Jeremy Friesen 034ec6e3fe
Introducing the Articles::Feeds configurations (#17314)
**tl;dr** This PR is looking to provide a means to programmatically
assemble, from system configurations, what is currently the
[Articles::Feeds::WeightedQueryStrategy::SCORING_METHOD_CONFIGURATIONS][1].
Once we merge this PR, instead of having that constant, we'll initialize
the Articles::Feeds::WeightedQueryStrategy with the variant
configuration that we've assembled.

**Introduction**

This pull request has quite a bit going on, but as of now the production
code does not use any of it.

*Note: None of this code is bleeding into production code paths.*

Put your Ruby hat on and let's go for a ride.  And apologizes for not
making this a smaller pull request.  As I built this, I made many small
commits, but this became the smallest commit that provided the most
context without integrating into production code.

Before we get started, you may want to familiarize yourself with where
we're going.  The `./app/models/articles/feeds/README.md` provides
further guidance; but fair warning reader, I have not reconciled the
README's language with what emerged as I wrote this pull request.

Those of you who are part of Forem Core team, you can read the
[Refinements to Our Present Feed Configuration][2]
to provide some insight into what's happening.

**Why not reconcile?** *Because I want to have all of the language and
thoughts available for you to help consider how best to name and model
this.*

**On to the Review**

The purpose of this pull request is to provide a mechanism for
engineering to provide a series of variant query levers.  And to allow
us to easily configure those available query levers into a variant
query.

*Why the mix of Ruby configuration and JSON?*

The Ruby levers are meant to indicate that this is code we don't want to
expose in text based configuration because it might create SQL inject
points.  (More on that when we integrate the code of this PR into the
production implementation)

The JSON levers are meant to indicate that "anyone" can pick the
appropriate/available levers and configure how they are set.  In other
words, these values do not create SQL injection issues.

**What I Need from You**

I am putting this forward as a draft so you can read this code ahead of
time.  I'm then going to schedule a synchronous code review where we
record our collective walk through of the implementation.

Closes:

- forem/forem#17268
- forem/forem#17269
- forem/forem#17270
- forem/forem#17271
- forem/forem#17273

Relates to:

- forem/forem#17308
- forem/forem#17245

[1]:6818ef3ed0/app/services/articles/feeds/weighted_query_strategy.rb (L84-L231)
[2]:https://forem.team/jeremy/refinements-to-our-present-feed-configuration-1p0c
2022-04-19 16:51:18 -04:00
..
ahoy Favoring delete_all on user relationships (#15443) 2021-11-23 11:50:12 -05:00
articles Introducing the Articles::Feeds configurations (#17314) 2022-04-19 16:51:18 -04:00
concerns Remove CustomProfileField (#14286) 2021-07-22 10:05:39 +07:00
liquid_tags [deploy] Add role and docs for user subscription liquid tag (#9170) 2020-07-08 14:07:53 -04:00
settings Escape user-supplied regex terms (#17305) 2022-04-15 10:18:16 -04:00
users app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
ab_experiment.rb Refactor AB Experiments and exercise all variants in rspec (#16236) 2022-01-24 17:03:58 -05:00
admin_menu.rb Conditionally removing listing from Admin > Consumer Apps menu (#17182) 2022-04-08 21:55:45 -04:00
announcement.rb Add Polymorphism to Broadcasts (Part 1) (#9231) [deploy] 2020-07-13 09:36:19 -06:00
api_secret.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
application_record.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
article.rb Context Notifications (#17243) 2022-04-18 10:30:30 +03:00
async_info.rb Encapsulating the "why we hide/show" something (#17166) 2022-04-11 13:40:16 -04:00
audit_log.rb Favoring constant over magic string (#15852) 2021-12-27 11:31:29 -05:00
badge.rb Refactor cache purging (#12811) 2021-03-02 10:09:05 -05:00
badge_achievement.rb Extracting container for allowed tags & attrs (#15338) 2021-12-16 12:24:45 -05:00
banished_user.rb Introduce BanishedUser table (#5589) [deploy] 2020-01-21 17:15:58 -05:00
broadcast.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
campaign.rb [Small win] Add display name to campaign settings (#16653) 2022-02-22 10:01:52 -05:00
collection.rb Series count to only include non empty series (#16130) 2022-01-18 10:22:34 +07:00
comment.rb Revert "Added a way to sort comments on an article (#16686)" (#17093) 2022-04-04 08:36:34 -04:00
config.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
consumer_app.rb Fixes a name conflict in Rpush models (#15978) 2022-01-07 09:38:16 -06:00
context_notification.rb Context Notifications (#17243) 2022-04-18 10:30:30 +03:00
creator_setting.rb Creator Onboarding: Creator Setup View (#14728) 2021-11-01 15:50:08 -04:00
credit.rb Favor repurposing existing scope (#15914) 2022-01-03 09:30:34 -05:00
data_update_script.rb Navigation Items and Role access for Data Update Scripts (#12292) 2021-02-09 17:41:14 +02:00
device.rb Spelling (#15702) 2021-12-07 06:59:10 -07:00
discussion_lock.rb Renaming method for clarity (#16791) 2022-03-07 12:55:56 -05:00
display_ad.rb Extracting container for allowed tags & attrs (#15338) 2021-12-16 12:24:45 -05:00
display_ad_event.rb Extracting constants and tidying tests (#15946) 2022-01-05 09:19:39 -05:00
email_authorization.rb Refactor Admin Member Detail view - Tools section (#14283) 2021-08-17 18:55:53 +02:00
email_message.rb Delete old retained emails after certain period (#14949) 2021-10-12 16:27:13 -04:00
extension.rb Introduce "extensions" (#16840) 2022-03-18 11:22:17 +02:00
feedback_message.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
follow.rb Refactoring cached_followed_tags (#16175) 2022-01-24 19:53:48 -05:00
forem_instance.rb "Reply to" and "From" Email addresses for SMTP Configurations (#16499) 2022-02-16 16:14:54 +02:00
github_issue.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
github_repo.rb POC: use Sidekiq.perform_bulk for Github repos (#16293) 2022-01-26 09:11:07 +07:00
html_variant.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
html_variant_success.rb Appeasing Rubocop as it sneaks some changes in (#16085) 2022-01-13 07:48:01 -05:00
html_variant_trial.rb Appeasing Rubocop as it sneaks some changes in (#16085) 2022-01-13 07:48:01 -05:00
identity.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
invitation.rb [deploy] Invite users to join and create password (#9294) 2020-07-15 11:37:19 -04:00
listing.rb Conditionally disabling Listings (Waiting on Product but technically Good to Go) (#16437) 2022-04-11 20:23:56 -04:00
listing_category.rb [deploy] Manage listing categories in dashboard (#10506) 2020-10-02 11:05:09 -04:00
mention.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
mod.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
moderator_action.rb [deploy] Moderator and admin actions log (#6797) 2020-03-26 16:59:24 -05:00
navigation_link.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
note.rb Favoring delete_all on user relationships (#15443) 2021-11-23 11:50:12 -05:00
notification.rb Ensure arguments to perform_async are json safe (#16285) 2022-01-25 18:07:40 -06:00
notification_subscription.rb Appeasing Rubocop as it sneaks some changes in (#16085) 2022-01-13 07:48:01 -05:00
organization.rb Ensuring article's cache updates on org image update (#17052) 2022-04-01 10:54:55 -04:00
organization_membership.rb Appeasing Rubocop as it sneaks some changes in (#16085) 2022-01-13 07:48:01 -05:00
overview.rb Add admin overview page (#12726) 2021-03-01 18:59:05 -06:00
page.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
page_view.rb Favoring dependent: :delete_all over :destroy (#15442) 2021-11-24 13:56:16 -05:00
permission.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
pinned_article.rb Pin posts to feed (#13807) 2021-06-04 10:54:53 +02:00
podcast.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
podcast_episode.rb Various cleanups (#14616) 2021-08-31 09:17:24 +07:00
podcast_episode_appearance.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
podcast_ownership.rb Appeasing Rubocop as it sneaks some changes in (#16085) 2022-01-13 07:48:01 -05:00
poll.rb Refactoring poll/vote/skip logic (#15441) 2021-11-29 10:52:32 -05:00
poll_option.rb Favoring dependent: :delete_all over :destroy (#15442) 2021-11-24 13:56:16 -05:00
poll_skip.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
poll_vote.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
privileged_reaction.rb [deploy] New Feature: Mod Actions Panel (#7777) 2020-06-08 13:24:18 -04:00
profile.rb Profile attribute names should be unique and non-empty (#16396) 2022-04-04 12:14:02 -05:00
profile_field.rb Profile attribute names should be unique and non-empty (#16396) 2022-04-04 12:14:02 -05:00
profile_field_group.rb [deploy] /profile/settings page rendering (Ridhwana/Michael) (#10733) 2020-10-20 09:18:13 -04:00
profile_pin.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
rating_vote.rb Removing deprecated User methods (#16435) 2022-02-07 10:32:58 -05:00
reaction.rb Don't send notification for invalid reactions (#16721) 2022-02-28 12:36:44 -06:00
response_template.rb Removing deprecated User methods (#16435) 2022-02-07 10:32:58 -05:00
role.rb ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
secret.rb [deploy] Feature: Setup Admin Area to Update Vault Secrets (#8935) 2020-06-29 15:08:09 -05:00
space.rb Penciling in a Default Spaces section (#16897) 2022-03-21 09:56:12 -04:00
sponsorship.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
tag.rb Renaming method for clarity (#16791) 2022-03-07 12:55:56 -05:00
tag_adjustment.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
timeframe.rb Remove timeframer from app/labor (#11782) 2020-12-08 12:52:33 +07:00
tool.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
tweet.rb Better error upon Tweet embed when Twitter keys missing (#16916) 2022-03-21 16:21:37 -04:00
user.rb Member index (phase 2) - Search invitations (#17210) 2022-04-12 10:40:44 +01:00
user_block.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
user_role.rb [Search 2.0] Users (#13453) 2021-04-24 19:06:06 +02:00
user_subscription.rb app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
welcome.rb Add single resource admin concept (#5069) [deploy] 2019-12-11 13:17:55 -05:00
welcome_notification.rb Add Polymorphism to Broadcasts (Part 1) (#9231) [deploy] 2020-07-13 09:36:19 -06:00