docbrown/app/services
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
..
admin Display analytics up to yesterday instead of today (#17064) 2022-04-04 15:17:32 -04:00
articles Introducing the Articles::Feeds configurations (#17314) 2022-04-19 16:51:18 -04:00
audit Adding :internal auditing for admin/spaces#update (#17010) 2022-03-25 14:25:13 -04:00
authentication Removing yard doc generation warnings (#17090) 2022-04-04 15:03:22 -04:00
badges Add Oauth check to AwardContributorFromGithub (#17155) 2022-04-06 15:41:20 -04:00
broadcasts/welcome_notification app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
color Color tokens (#16107) 2022-01-21 07:41:03 +01:00
credits More ListingsToolkit refactoring (#16221) 2022-01-27 09:47:41 +07:00
discover Add Forem Discover registration worker and service (#14865) 2021-10-01 10:27:31 -04:00
edge_cache Favoring explicit class declaration (#17042) 2022-03-29 13:52:11 -04:00
error_messages Add a contact email address to the /admin/customization/config (#16497) 2022-02-15 17:37:08 +02:00
exporter Fix app/services' ruby 2.7 kwargs warnings (#13177) 2021-04-01 18:40:50 -04:00
fastly_config Abstract DatadogStatsClient to ForemStatsClient (#12304) 2021-01-27 11:25:44 -05:00
feeds Removing yard doc generation warnings (#17090) 2022-04-04 15:03:22 -04:00
follows Fix UI showing "Following" after unfollowing a user (#13757) 2021-05-19 17:40:38 +01:00
giphy
github Spelling (#15702) 2021-12-07 06:59:10 -07:00
homepage Extracting duplicate logic (#16035) 2022-01-10 15:19:04 -05:00
html Refactor FastImage usage (#16304) 2022-01-26 09:48:03 -05:00
images Addressing rubocop violations (#16156) 2022-01-17 17:21:06 -05:00
listings More listings refactoring (#16343) 2022-02-23 13:44:30 +07:00
loggers Rubocop fixes (#15892) 2021-12-28 09:11:41 -06:00
mailchimp app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
markdown_processor Allowing dependency injection for LiquidTag policy (#16511) 2022-02-10 07:47:16 -05:00
mentions Issue #9077 has already been resolved, added specs (#15342) 2021-11-17 11:27:50 +02:00
moderator app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
notification_subscriptions Add Article post_commit when user_id changes with specs (#15132) 2021-10-25 10:53:21 +07:00
notifications Context Notifications (#17243) 2022-04-18 10:30:30 +03:00
organizations Organizations delete optimizations and refactoring (#13610) 2021-05-11 12:14:55 +03:00
payments app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
podcasts Produce a meaningful slug from podcast episode title (#17184) 2022-04-08 16:30:16 -05:00
profile_fields Refactor profile refreshing (#14643) 2021-09-13 12:15:04 -04:00
push_notifications Have specs run without Redis and refactor ConsumerApp and Device (#13647) 2021-05-07 08:03:16 +02:00
re_captcha Spelling fixes to live code (#15670) 2021-12-06 12:11:25 +02:00
search Remove unused methods from User (#16616) 2022-02-18 09:02:17 +07:00
settings Addressing rubocop violations (#16156) 2022-01-17 17:21:06 -05:00
slack Ensure arguments to perform_async are json safe (#16285) 2022-01-25 18:07:40 -06:00
spam app/models i18n (#16124) 2022-02-03 13:41:42 -05:00
tag_moderators Refactoring questions asked of user (#15762) 2021-12-21 12:45:12 -05:00
twitter_client Match error class using case instead of if/elsif/else (#16952) 2022-03-21 15:34:49 -05:00
user_subscriptions app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
users Don't suggest author follows for anonymous visitors (#16825) 2022-03-08 11:15:06 -06:00
analytics_service.rb app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
application_service.rb [deploy] Refactor 🚀 : Replaced Chat Channel Setting page with Preact component. (#8271) 2020-06-10 16:58:37 -04:00
article_api_index_service.rb Factoring code to define Article.approved (#15600) 2021-12-01 22:45:32 -05:00
article_with_video_creation_service.rb app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
bulk_sql_delete.rb Remove txn from with_statement_timeout block (#15088) 2021-10-15 14:53:35 -04:00
email_digest.rb Use new UserSetting and UserNotificationSettings and Ignore Related User Table Fields (#14121) 2021-07-08 09:31:34 -05:00
email_digest_article_collector.rb Extracting a not_authored_by scope (#16123) 2022-01-17 15:20:49 -05:00
feature_flag.rb Add FeatureFlag.all (#16496) 2022-02-11 13:38:17 +07:00
flare_tag.rb [Search 2.0] Homepage query (#13339) 2021-04-21 12:41:24 +02:00
instrumentation.rb Instrument EmailDigestArticleCollector (#13153) 2021-03-29 09:33:32 -04:00
markdown_processor.rb Extracting container for allowed tags & attrs (#15338) 2021-12-16 12:24:45 -05:00
medium_article_retrieval_service.rb app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
notifications.rb
open_graph.rb cache open graph response (#17157) 2022-04-07 13:53:20 -04:00
rate_limit_checker.rb app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
tag_adjustment_creation_service.rb [deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
tag_adjustment_update_service.rb