Commit graph

44 commits

Author SHA1 Message Date
Ben Halpern
0675272d48
Update digest schedule (#20865) 2024-04-22 16:42:46 +00:00
Philip How
55f191a5ec
Automated First Post Badge (#20600)
* award first post logic, schedule, and tests

* award first post logic, schedule, and tests
2024-02-08 10:11:40 -05:00
Philip How
779701d5f6
Automatically reward thumbs-up milestone badges (#20338)
* initial work on #20111

* initial work on #20111

* fix cron

* is this a good test

* add in initial check, fix test data

* Update spec

---------

Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2023-11-14 16:47:24 +00:00
Anna Buianova
e659dbfc00
Renamed display_ad_events variables and associations (#19788)
* Renamed stuff related to display_ad_events (except the model)

* Updated user billboard_events association spec

* Fixed display_ad_event factory
2023-07-21 14:59:28 +03:00
Joshua Wehner
dc1ab81401
Allow DisplayAd to target users via audience segmentation (#19284)
* Trying some models for audience segmentation

* AudienceSegment basics

* Attach AudienceSegment to DisplayAd

* Possibly use a DUS to populate AudienceSegments

* Add to display ad form UI

* Add to display ad API

* Refresh strategy for audience segments

* Add user_id to async ads query

* Maybe :testing -> :manual, for no-refresh segment

* Test & tweak segment refresh

* Testing audience_segment#refresh logic

* Coverage: testing human_readable

* Scope segment refresh to recently active users

* Tweak logic for when to refresh

* Tweak experience levels to match SettingsHelper

* Test for front-end logic

* Fix test, hope this helps coverage?

* Better test names

* One worker for all, many workers for each, perform_bulk

* Fix audience segment UI, needs to use id, not enum

* cron/schedule should RefreshAll

* Singular id in RefreshWorker
2023-04-25 08:41:10 -04:00
Anna Buianova
f7a93aabbb
Remove html variants tracking (#18594)
* Removed code related to tracking html_variants

* Remove code related to HtmlVariant#find_for_test

* Remove spec for HtmlVariant#success_rate
2022-10-21 14:57:20 +03:00
Joshua Wehner
1fcafbbd41
Rollup service to compact DisplayAdEvent records (#18508)
* Restore DisplayAdEvents.counts_for

* Try a rollup service for DisplayAdEvent

* Schedule daily rollup worker for one month prior

* Refactor aggregator

* More testing for rollup

* Add test for rollup attribute fidelity

* DisplayAd success_rate based on counts_for
2022-10-19 16:21:47 +02:00
Anna Buianova
ff76cdd3c5
Scheduling articles (#17939)
* Article query spec for scheduled articles

* Added scheduled article badge on the user dashboard

* Added published_at field to editor options

* Accept and validate published_at from editor

* Refactor published_at validation

* Allow 1-minute difference in published_at

* Notice on an unpublished article page

* Added specs for 'Click to edit' link on scheduled article preview page

* ContextNotification model

* Articles::Publish worker

* Added specs for articles publish worker

* Schedule publish articles worker

* Added tests to check for scheduled posts in feeds

* Don't allow managing scheduled articles

* Don't send notifications for scheduled articles

* Set published_at in Articles::Updater when publishing

* Published_at value in post options

* Pass timezone and set published_at accordingly

* Limit setting published_at to the future

* Readonly published_at for articles that were already published

* Chagning published_at format in editor v1 (start)

* Changed published_at format in frontmatter, specs

* Added specs for updating published_at from frontmatter

* Fixed accepting past published_at for articles published_from_feed

* Enabled published_at validation: don't allow updating published_at for already published articles

* Validate published_at on create

* Added a spec for updating published_at for exported articles

* Fixed specs related to creating articles with past published_at

* Fixed specs related to past published_at for articles

* Added a hack so that admins would be able to update published_at

* Switch button text schedule/publish when changin publishedAt

* Fixed saving published_at with timezone

* Added a feature flag for scheduling articles

* Default text in markdown editor depends on feature flag

* Enable article editor cache again

* Fixed the default value in the markdown editor

* Fix sitemaps spec

* Removed tooltip

* Fixed articles update specs

* Added missing locales

* Fixed article create specs

* Fixed spec

* Removed commented code

* Returned enabling extensions in the schema

* Returned accidentally deleted constraint

* Make articles query spec more stable

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>

* Removed commented code

* Removed unused code

* A clearer policy

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>

* Use StringInquirer for article current state

* Added a note and todo to articles factory past trait

* Remove duplicated PropType

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* Refactor query in the Articles::PublishWorker

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

* Refactor articleForm.jsx

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

* Removed specs that are no longer relevant

* Removed useless onKeyUp on a hidden input

* Refactored articleForm

* Hide scheduling from post options when published_at is readonly

* Run sends notifications worker every 5 minutes instead of every minute

Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2022-07-07 17:32:49 +03:00
Fernando Valverde
c4df397fef
Community Wellness badge (#17394)
* First greedy algorithm approach to awarding community wellness badge

* Update app/services/badges/award_community_wellness.rb

I'm sorry I ignored you rubocop. It's still on draft for a reason 😅

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update app/services/badges/award_community_wellness.rb

Okay, whatever you say rubocop. This line will go away before merging anyways

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Use app/queries/comments/community_wellness_query.rb to replace greedy algorithm

* Query indenting + rename positive_reactions to negative_reactions in EXCEPT

* First step towards query spec

* Fix spec and make it more robust

* Slight cleanup/tweaks

* Badge reward & message

* copy edits + spec improvements + 3 days ago min for query

* Cron update to run daily + small tweak for FeatureFlag use

* inline comment tweaks

* Slight reorder of guard checks in service (FeatureFlag related)

* PR review feedback

* Fix specs from static method refactor

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-29 12:38:40 -06:00
Ben Halpern
1ae10d7e6f
Remove hardcoded /badge page that is DEV-only ✂️✂️✂️ (#16303)
* Remove hardcoded /badge page that is DEV-only

* Remove /badge test

* Remove scheduled job
2022-01-27 13:29:05 -05:00
Josh Soref
5324eb1477
Spelling fixes to live code (#15670)
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2021-12-06 12:11:25 +02:00
Jamie Gaskins
e50eccc85b
Add PGHero for more insights into the DB (#15073)
* Add PGHero for more insights into the DB

Andrew Kane's Ruby gems will continue being added until morale improves!

* Add linux x86_64 protobuf

* Fix discrepancy between Gemfile and Gemfile.lock

No idea how this happened, but it happened when merging `main` back into
this branch.

Co-authored-by: Dan Uber <dan@forem.com>
2021-11-05 12:25:02 -04:00
Ben Halpern
549336b0a2
Delete old retained emails after certain period (#14949)
* Delete old retained emails after certain period

* Update app/models/email_message.rb

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

* Update spec/workers/emails/remove_old_emails_worker_spec.rb

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

* Update app/models/email_message.rb

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

Co-authored-by: Jamie Gaskins <jamie@forem.com>
2021-10-12 16:27:13 -04:00
Jamie Gaskins
204ca4ae7e
Remove scheduled SitemapRefreshWorker job (#14986)
This worker no longer exists 
Force merged https://forem-team.slack.com/archives/CUJDU2R8D/p1633654148049700
2021-10-07 19:51:51 -05:00
Fernando Valverde
cf3bde4259
Add mobile push notifications to Forem (#12419)
* First commit with iOS PN working

* RPush cleanup worker + unique jobs config

* Remove rpush tables from schema.rb

* PR feedback

* Feature flag and test for route

* Tests and feature flag PushNotification ::Send

* Update app/controllers/devices_controller.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update spec/routing/devices_routes_spec.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update spec/services/push_notifications/send_spec.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* PR feedback

* Set Rpush driver and url

* More PR feedback

* Apply suggestions from code review

Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>

* PR feedback from Rhymes

* Don’t double render

* Sure

Co-authored-by: Josh Puetz <hi@joshpuetz.com>
Co-authored-by: Josh Puetz <josh@dev.to>
Co-authored-by: Michael Kohl <citizen428@dev.to>
Co-authored-by: Jamie Gaskins <jgaskins@gmail.com>
2021-03-12 14:08:18 -06:00
Molly Struve
c7c907ac86
Optimization:Sync Github Repos Hourly (#12757) 2021-02-22 12:49:54 -06:00
rhymes
1efbf20b90
Add descriptions to scheduled tasks (#12345)
* Add descriptions to scheduled tasks

* Address feedback
2021-01-20 16:32:22 +01:00
rhymes
e7f9735354
Remove RssReader (#12169)
* Add script to remove feature flag

* Remove :feeds_import feature flag and RssReader and related classes

* Change Feeds::ImportArticlesWorker signature to support Sidekiq Cron serialization

* Replace RssReader::Assembler with Feeds::AssembleArticleMarkdown

* Removing Assembler
2021-01-08 11:45:15 -05:00
Michael Kohl
63cf95d811
Split BadgeRewarder into multiple services (#11902) 2020-12-23 09:55:06 -05: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
Molly Struve
60b7572f5c
Feature:Send Alerts for Failed DataUpdateScripts to Datadog (#11381) 2020-11-12 10:59:54 -06:00
Molly Struve
4ab5bf5255
[deploy] Feature:Add Ability to Run RssReader via Sidekiq Cron, Prevent for DEV (#10066) 2020-08-28 14:57:22 -05:00
Molly Struve
8a44eb9421
[deploy] Refactor:Cleanup Naming and Optimize Email Digest Code (#10054) 2020-08-28 13:36:11 -05:00
Molly Struve
cd1db855b6
[deploy] Optimization:Break Send User Digest Emails in Single Jobs (#10043) 2020-08-28 06:37:27 -05:00
Molly Struve
b23374e737
[deploy] Revert "Refactor:Move RssReader Fetch Article task to Sidekiq (#9976)" (#9998) 2020-08-25 14:57:33 -05:00
Molly Struve
ff06454151
[deploy] Refactor:Move RssReader Fetch Article task to Sidekiq (#9976) 2020-08-25 13:47:13 -05:00
Molly Struve
0947256f13
[deploy] Refactor:Fetch New Github Repos From Sidekiq Cron (#9986) 2020-08-25 12:42:33 -05:00
Molly Struve
e0c37442c3
[deploy] Refactor:Move Enqueueing Podcast Workers to Sidekiq Cron (#9983) 2020-08-24 16:28:57 -05:00
Molly Struve
513717e680
Refactor:Move Credit Counter Cache Sync to Sidekiq (#9972) 2020-08-24 14:20:11 -05:00
Molly Struve
a4373346dd
[deploy] Refactor:Move Sitemap Refresh Rake Task to Sidekiq (#9975) 2020-08-24 13:22:25 -05:00
Molly Struve
d4a2f24c88
[deploy] Refactor:Move Cache Busting Rake Tasks to Sidekiq (#9931) 2020-08-24 08:23:11 -05:00
Molly Struve
e07c707ede
[deploy] Refactor:Move remove_old_notifications Rake Task to Sidekiq (#9936)
* Refactor:Move remove_old_notifications Rake Task to Sidekiq

* fix typo
2020-08-24 08:48:46 -04:00
Molly Struve
8574153b07
[deploy] Refactor:Move Remove Old HTML Variant Data task to Sidekiq (#9925) 2020-08-22 18:36:22 -05:00
Molly Struve
4308914fe8
[deploy] Refactor:Move send_email_digest Rake Task to Sidekiq (#9929) 2020-08-22 08:26:30 -05:00
Molly Struve
060ed32c48
Refactor:Send Welcome Broadcast Notifications From Sidekiq (#9923)
* Refactor:Send Welcome Broadcast Notifications From Sidekiq

* remove old spec and add to new one
2020-08-21 12:57:08 -04:00
Molly Struve
e8b14dec83
Refactor:Move prune_old_field_tests Rake to Sidekiq Cron (#9924) 2020-08-21 12:56:42 -04:00
Molly Struve
f00bb8eb8c
[deploy] Refactor:Move Listing and Support Tag Tasks to Sidekiq (#9898) 2020-08-20 14:05:34 -05:00
Molly Struve
ae4080a6ef
[deploy] Refactor:Move Tag Badge and Github Badge Awards to Sidekiq (#9885) 2020-08-20 08:41:36 -05:00
Molly Struve
4ac9020112
[deploy] Bug Fix:Run Badge Award Job Twice a Day (#9875) 2020-08-19 14:31:48 -05:00
Molly Struve
469ce3c533
Refactor:Move Streak Badges to Sidekiq Cron (#9872) 2020-08-19 14:53:03 -04:00
Molly Struve
960c51fbc0
[deploy] Refactor: Move beloved comment Badge to Sidekiq Cron (#9861) 2020-08-19 09:12:45 -04:00
Molly Struve
55e7e12e78
[deploy] Refactor:Move Yearly Badge Awarder to Sidekiq Cron (#9836) 2020-08-17 20:19:14 -04:00
Molly Struve
8d66d3c492
[deploy] Feature:Move Metric Rake Tasks to Sidekiq Cron (#9794) 2020-08-17 11:47:25 -05:00
Molly Struve
05abf3839c
[deploy] Feature:Use Sidekiq to Run Scheduled Jobs (#9789) 2020-08-14 14:44:31 -05:00