Commit graph

36 commits

Author SHA1 Message Date
Anna Buianova
ed1b4045d3
Auto confirm flag reactions when spam role is assigned (#20797)
* Auto confirm flag reactions when spam role is assigned

* Renamed method according to its point

---------

Co-authored-by: Mac Siri <mac@forem.com>
2024-03-27 13:03:41 +00:00
Anna Buianova
1008f0af7d
Automatically resolve spam reports when the offending user is marked as spam (#20781)
* Start resolving spam reports automatically after assigning spam role

* Specs for resolving spam reports + async resolving
2024-03-21 17:31:43 +00:00
Ridhwana
e72957a913
feat: add an inflection and change instances of gdpr to GDPR (#17567) 2022-05-04 16:20:46 +02:00
Jeremy Friesen
fe2e53cc50
Moving Experiments into AbExperiment namespace (#17532)
* Moving Experiments into AbExperiment namespace

This commit entails two major concepts:

1. Extracting logic out of a worker.
2. Cleaning the conditions in which we convert experiments.

In addition, I revisited some spec names to tidy them up for
clarification and structure.

**Extracting Logic...**

For workers, my preference is that they be a simple router to another
object.  A non-worker object, with it's initialize method, can both
better manage instance variables.  Further, workers are somewhat "flat"
in hierarchy,

In this case, having the AbExperiment be knowledgeable both in setting
the experiment and handling conversions makes (to me) organizational
sense.  For example, the AbExperiment is constructed as a wrapper to the
FieldTest gem.  But the RecordFieldTestEventWorker had knowledge of
FieldTest.

With this refactor, it does not have that knowledge.  This also provided
an opportunity to replace magic strings with constants.

**Cleaning the conditions...**

This relates directly to and closes forem/forem#17530.  I was looking at
the experiments after 2 days, and realized that there shouldn't be
results for
`user_views_pages_on_at_least_nine_different_days_within_two_weeks`;
after all the experiment started 2 days ago, how can we have results
that look at 2 weeks.

By adding the "max" function calls, we ensure a clear boundary of
"before the experiment began" versus "while the experiment is running".

Closes forem/forem#17530

* Update spec/models/ab_experiment_spec.rb

Co-authored-by: Mac Siri <krairit.siri@gmail.com>

* Apply suggestions from code review

Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
2022-05-03 21:34:12 -04:00
Ridhwana
3fc6108651
Remove GDPR from the "users" namespace (#17536)
* feat: update all the paths as a first order of business

* feat: update all the folders to no longer appear under users

* feat: update specs

* feat: update specs

* feat: remove User namespace

* feat: remove route namespace

* feat: path change

* feat: update url
2022-05-03 19:42:20 +02:00
Ben Halpern
4960f8913f
Refactor AB Experiments and exercise all variants in rspec (#16236)
* Refactor AB Experiments and exercise all variants in rspec

* Fix test that still uses wut
2022-01-24 17:03:58 -05:00
Ben Halpern
723f9f22c0
Fix goal conversion field test typo (#15985)
* Fix goal conversion field test typo

* Fix typo in test too

* Undo testing word change
2022-01-06 16:34:36 -05:00
Jeremy Friesen
6269aa4108
Proposing a new feed experiment (#15789)
* Proposing a new feed experiment

This commit involves tweaking a few subtle aspects of the challenger:

1) Remove the sort by published date on the relevance score.  The
   articles will now be listed in the order of perceived relevance.
2) Disable a few levers that did little.  There really aren't any
   `articles.featured = true` articles in the database.
3) Gently increase the weight of each comment in a linear manner.
4) Give a little more weight to posts that don't have followed tags.

In addition, it involves renaming the conversions to better convey their
implementation.  This renaming helps create more descriptive labels for
the test results at `/admin/abtests`.

This commit also adds logic to repurpose the AbExperiment feed_strategy
logic; I envision adjusting the weighted feed strategy levers with some
frequency.

Per discussions, I'm also disabling the "not logged in" feed testing.
We'll use the LargeForemExperimental for this.

* Flipping attribute name to positive

Mentally "not disabled" is harder to parse than "enabled".  This change
helps with setting an optimistic attribute.

* Bump for travis

* Bump for travis

* Removing file committed by mistake

* Extracting method
2022-01-03 14:38:14 -05:00
Michael Kohl
5da625cadb
Rubocop fixes (#15892)
* Add missing spaces

* Use filter_map over map + reject/compact

* Simplify FactoryBot calls

* Use to_h with block instead of map + to_h

* Use guard clause
2021-12-28 09:11:41 -06:00
Jeremy Friesen
93c40a7983
Guarding against missing experiments (#15440)
* Guarding against missing experiments

This is a short-circuit to ensure we don't throw exceptions in the
worker.  In #15240 we introduce an AbExperiment module that we could use
to insulate against FieldTest implementations.

* Update app/workers/users/record_field_test_event_worker.rb

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* Favoring guard condition over coercion

Co-authored-by: Jamie Gaskins <jamie@forem.com>
2021-11-22 16:06:32 -05:00
Jamie Gaskins
355881f744
Don't try to subscribe users without emails (#14244) 2021-07-15 10:34:23 -04:00
Mac Siri
e38196df6f
Create Settings::SMTP (#13943)
* Fix typo

* Add SMTP configs to Settings::General

* Expand Settings's show page

* Expand Settings::General's constants

* Move smtp_enabled? logic to ApplicationMailer

* Apply suggestions from code review

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

* Add missing descriptions and placeholders

* Remove production guard clause

* Change delivery_method to a callback

* Create Settings::SMTP

* Run migration

* Move constants

* Remove SMTP from Settings::General

* Create SMTPSettingsController

* Add back guard clause

* Change which perform_deliveries configuration to use from

* Update config/environments/production.rb

* Rename migration to singular

* Run migration again

* Fix name

* Alphabetize and add validation for authentication

* Move settings and enabled? logic to Settings::SMTP

* Change after_action to before_action

* Fix broken spec

* Fix broken spec

* Create SMTP specs

* Provide default for port

* Create spec for ApplicationMailer

* Fix broken spec

* Move smtp_enabled?

* Search and replace

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2021-06-14 10:29:43 -04:00
Ben Halpern
e1b1fe3ed7
Declare winner in feed_top_articles_query test (#12308)
* Declare winner in feed_top_articles_query test

* Some WIP modifications to lfe

* Fix up tests and generalize

* Fix style

* Adjust tests to handle different field test scenarios

* Remove socre_randomness tests

* Fix test to fit stub

* Update app/workers/users/record_field_test_event_worker.rb
2021-02-04 13:02:00 -05:00
Michael Kohl
e258e36c92
Remove language settings (#12502)
* Remove language settings

* Remove more language related code

* Remove leftover spec

* Remove language from ES mapping
2021-02-04 08:35:00 +07:00
Alex
dfeccf6c11
Move MailchimpBot to Mailchimp::Bot service (#12205)
* Move MailchimpBot to Mailchimp::Bot service

* Update specs

* Put back old Mailchimp Bot
2021-01-12 10:28:48 -05:00
Ben Halpern
0ec2a40fe0
Test variants for which posts are fetched on initial "hot articles" home feed query. (#11982)
* Declare winner in update points worker

* Remove tests

* Test variants for which posts are fetched on home feed

* Add field test

* Rewrite field tests

* Change user to @user

* Fix tests

* Fix user thing

* Check for existence of user before setting experiment

* Fix experiment -> @experiment

* Change spec

* Fix tests

* Fix tests

* Fix tests

* Fix rubocop issues

* Remove unneeded offset value

* Fix up specs

* Final adjustments

* Add comments

* Update app/services/articles/feeds/large_forem_experimental.rb

Co-authored-by: Molly Struve <mollylbs@gmail.com>

* Update app/services/articles/feeds/large_forem_experimental.rb

Co-authored-by: Molly Struve <mollylbs@gmail.com>

* Update app/services/articles/feeds/large_forem_experimental.rb

Co-authored-by: Fernando Valverde <fdov88@gmail.com>

* Update app/services/articles/feeds/large_forem_experimental.rb

Co-authored-by: Fernando Valverde <fdov88@gmail.com>

* Better initial user query

Co-authored-by: Molly Struve <mollylbs@gmail.com>
Co-authored-by: Fernando Valverde <fdov88@gmail.com>
2021-01-05 12:29:46 -05:00
Alex
17b2ff63f2
Cleanup bust_user (#12066) 2020-12-30 10:07:42 -05:00
Anna Buianova
1079c4e402
Removed slack notification for admins when user is deleted (#11929) 2020-12-17 20:31:22 +03:00
Anna Buianova
5430448305
Confirmations that users GDPR data was deleted (#11039)
* Display gdpr delete requests for deleted users in admin

* Added a test for destroy a gdpr request

* Reorganized gdpr requests menu

* Update schema version

* Added a link to the flash notice after user delete by admin

* Fix namespace for tests

* Aligh schema.rb with master

* Added a missing newline

* Removed unused partial

* Fix typo

Co-authored-by: Michael Kohl <me@citizen428.net>

* Replaced string with symbols for AR

Co-authored-by: Michael Kohl <me@citizen428.net>

* Added an AuditLog record on gdpr delete confirmation

* Make email and user_id required in Users::GdprDeleteRequest

* Checked out package.json from master

* Fix Gdpr => GDPR

* Added missing space

* Remove unneeded freeze

Co-authored-by: Michael Kohl <me@citizen428.net>
2020-12-14 12:49:45 +03:00
Ben Halpern
31b83a4511
Remove concept of "ongoing" field tests and clarify a/b test instructions/expectations. (#11734)
* Remove concept of 'ongoing' field tests

* Fix specs

* Feeds spec

* Fix spec

* Fix style issues

* More details on field tests
2020-12-07 13:52:54 -05:00
Anna Buianova
f6a7a42acc
Slack notification with reminder to delete user gdpr data (#10532) 2020-10-02 10:12:12 -04:00
rhymes
8b60a18735
Account deletion email: serialize only user's details (#9752)
* Account deletion email: serialize only user's details

* Fix specs and mailer preview
2020-08-13 18:31:56 +02:00
Molly Struve
b40af82b66
Flaky Spec Fix:Remove let_it_be Test Prof Helper (#9556)
* Flaky Spec Fix:Remove let_it_be Test Prof Helper

* Spec cleanup and fixes
2020-07-29 11:31:01 +02:00
Molly Struve
e688063bba
Bug Fix: Make FieldTestWorker More Resilient (#8893) 2020-06-24 16:34:55 -04:00
rhymes
40f54e317f
[deploy] Use Action Mailer parameterized syntax (#8853) 2020-06-23 13:48:41 -05:00
Molly Struve
13e8ea1f64
Ensure records are updated properly after a user merge (#7416) 2020-04-21 14:17:11 -04:00
Michael Kohl
4f68e1907e
Try out parallel Travis builds (#6645)
* Try out parallel Travis builds

* Add more Bundler options

* Appease the spec gods

I don't think we actually need Timecop.freeze in this spec

* Try inlining factories

* Make sure the time has actually changed

* Add CodeClimate coverage for parallel build

* Explicitly list jobs, don't rely on matrix expansion

* Merge master and move storybook to after_script

* Add missing environment variable

* Remove old cc-test-reporter config

* Move yarn build-storybook back to script, remove conditional coverage upload

* Actually remove yarn build-storybook from after_script

* Bump Octokit so we can build again

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-04-14 10:25:53 -04:00
Ben Halpern
8b0cfaf48a
Add two new experiments and one new conversion event (#6633) [deploy]
* Add two new experiments and one new conversion event

* change hours in 7 to 24
2020-03-16 18:16:02 -04:00
Ben Halpern
1dc1723709
Add field test gem to establish a/b testing (#6283) [deploy]
* Initial field test spec work

* Clean up specs

* Fix codeclimage

* Cleanups

* Update names

* Rename and remove need to pass logged in status

* Leadup to prod: two experiments

* Move test logic to controller and add tests

Co-authored-by: Josh Puetz <josh@grorichpuetz.com>
2020-03-03 10:21:29 -05:00
Maykon Menezes
58b96f104e
create Users::EstimateDefaultLanguageWorker for Sidekiq (#5697) [deploy] 2020-02-07 13:49:02 -05:00
Michael Kohl
7270d5ab4c
Move user deletion by moderator to worker (#5887) [deploy] 2020-02-05 08:27:07 -05:00
Maykon Menezes
7ad7320add Worker/user self delete (#5698)
* Moving user self delete job to sidekiq

* Refactor/user self delete worker
2020-01-27 08:45:58 -05:00
Maykon Menezes
ef1eb8d412 Refactor/user bust cache job (#5563)
* Refactor/user bust cache job

* Remove bust cache job old spec
2020-01-20 13:46:15 -05:00
Pablo Ifrán
bac4b7fac4 Move Users::ResaveArticlesJob to Sidekiq (#5398)
Change Resave Articles job to worker, and add missing specs on the user
model when changing the trigger attributes
2020-01-10 13:56:39 -06:00
Jenna Pederson
5c9302f5f1 Migrate subscribe to mailchimp newsletter job to sidekiq worker (#5423)
* Start migrating job to sidekiq worker
* Only check for badge jobs queued to sidekiq
2020-01-10 08:43:13 -06:00
Cadu Ribeiro
00a97b2051 Migrate Users/FollowJob to Sidekiq (#5403) 2020-01-08 15:03:18 -05:00