docbrown/spec
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
..
controllers/concerns 15 minute fix: Add default argument to JsonApiSortParam (#13369) 2021-04-14 10:32:07 +07:00
decorators Routine Rubocop fixes (#16838) 2022-03-09 09:32:50 -05:00
factories Context Notifications (#17243) 2022-04-18 10:30:30 +03:00
fixtures Remove duplicated work display from header / profile work (#14210) 2021-07-30 12:28:40 +02:00
forms Routine Rubocop fixes (#16838) 2022-03-09 09:32:50 -05:00
generator Add service generator (#11265) 2020-11-10 09:09:35 +07:00
helpers First version of exporting the Users to a CSV (#17217) 2022-04-12 15:24:32 +02:00
initializers A suspended user returns 403 instead of 500 (#16408) 2022-02-04 09:42:23 -05:00
lib Remove references to article.spaminess_rating (#17235) 2022-04-15 11:43:48 -04:00
liquid_tags Conditionally disabling Listings (Waiting on Product but technically Good to Go) (#16437) 2022-04-11 20:23:56 -04:00
mailers "Reply to" and "From" Email addresses for SMTP Configurations (#16499) 2022-02-16 16:14:54 +02:00
models Introducing the Articles::Feeds configurations (#17314) 2022-04-19 16:51:18 -04:00
policies Encapsulating the "why we hide/show" something (#17166) 2022-04-11 13:40:16 -04:00
queries Fixes a name conflict in Rpush models (#15978) 2022-01-07 09:38:16 -06:00
refinements Update data exporter to handle admin send (#10274) 2020-10-26 18:00:56 -04:00
requests Ensuring /new remains a call to action end point for DEV (#17294) 2022-04-14 14:50:40 -04:00
routing Remove profile admin feature flag (#17194) 2022-04-11 09:27:35 -05:00
sanitizers Don't sanitize anchor elements with no href (#16667) 2022-02-22 11:27:38 -06:00
serializers Refactoring to add helper method (#16064) 2022-01-12 11:21:44 -05:00
services Context Notifications (#17243) 2022-04-18 10:30:30 +03:00
support Produce a meaningful slug from podcast episode title (#17184) 2022-04-08 16:30:16 -05:00
system Fix duplicate IDs on homepage (#17092) 2022-04-14 10:48:55 +01:00
tasks Make home link an admin-customisable navigation link (#16268) 2022-02-01 09:27:09 +00:00
uploaders Remove Remaining logo_svg Code (#16291) 2022-02-22 12:05:16 -07:00
validators Don't raise error when empty community emoji setting submitted (#15723) 2021-12-17 09:29:55 -06:00
view_objects Avoid using robohash for factory generated article cover images (#17024) 2022-03-28 14:01:29 -05:00
views Adding logic to hide Create Post on empty dashboard (#17149) 2022-04-11 13:52:35 -04:00
workers Remove references to article.spaminess_rating (#17235) 2022-04-15 11:43:48 -04:00
i18n_spec.rb Show missing translation keys when test fails (#16637) 2022-02-17 16:21:29 -06:00
rails_helper.rb Conditionally disabling Listings (Waiting on Product but technically Good to Go) (#16437) 2022-04-11 20:23:56 -04:00
spec_helper.rb Bump to Rails 7.0.2.2 MVP (#15908) 2022-03-30 15:00:33 -04:00