Commit graph

47 commits

Author SHA1 Message Date
Molly Struve
83d44401f5
[deploy] Index Reaction created_at Timestamp (#10142) 2020-09-02 12:56:33 -05:00
Michael Kohl
f023c6174f
[deploy] Add data update script for profile fields (#10119) 2020-09-02 09:54:04 +07:00
rhymes
ba8b3dd443
[deploy] Add missing dependent clauses to User and cleanup relations (#10011)
* Add dependent: :destroy relation to user.notes

* Add cleanup script for orphaned notes

* Reorder relations and reorganize specs in User

* Update specs as notes are not needed after a user is deleted

* Tweets can just be nullified

* Add other cleanup scripts

* Tell the specs we keep tweets

* Fix comments

* Keep page_views and rating_votes when a user is deleted

* Fix specs
2020-08-28 20:19:24 +02:00
rhymes
c9e401758a
[deploy] Add dependent clauses to Article and fix Comment validation (#9990)
* Add dependent clauses to Article model

* Comment should be valid without a commentable

* Add cleanup scripts

* Cache the comments ids before destroying the article

* Add dependent clause to Article.user_subscriptions as well

* Fix specs
2020-08-28 18:24:28 +02:00
Michael Kohl
161ed7d55e
[deploy] Introduce ProfileFieldGroup model (#10007)
* Introduce ProfileFieldGroup model

* Make profile_fields_groups name column unique

* Fix some specs

* feat: allow the page to work again

* Add guard clause to data update script

* Remove unused file

* Fix specs

* Add foreign key

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-08-28 10:51:33 +07:00
Josh Puetz
d47d02f090
[deploy] Log in with Facebook (#9922)
* First draft of facebook auth

* Add Facebook welcome broadcast to seeds, data script

* Tests!

* Documentation

* Update docs with pictures

* User siteconfig/app config

* Adjust dropdown menu width to avoid wrap for Facebook button

* Add Facebook auth keys to SiteConfig properly

* Remove unnecessary VCR cassette

* Add omniauth facebook gem to vendor cache

* Use uid instead of email for nickname randomization

* Test fix, test for missing email in Facebook

* Update docs/backend/auth-facebook.md

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

* Typo fix!

* Don't default facebook auth settings to ApplicationConfig

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-08-26 12:04:20 -04:00
rhymes
66b5cb513f
[deploy] Add dependent clauses to relations for Organization and add cleanup scripts (#9932)
* Add dependent clauses to has_many relations in Organization

* Add cleanup scripts

* Update script

* Destroy organizations listings

* Update lib/data_update_scripts/20200822082229_remove_orphaned_notifications_by_organization.rb

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

Co-authored-by: Molly Struve <mollylbs@gmail.com>
2020-08-24 19:35:02 +02:00
rhymes
03ed8aedb1
[deploy] Remove orphaned polls related rows (#9855) 2020-08-20 10:40:01 +02:00
Michael Kohl
eff28766fc
[deploy] Migrate profile data (#9750)
* Add temporary Rake task for creating profile fields

* Fix problems after splitting branch

* Add profile migration Rake task

* Add unique index to profiles

* Add migration code to users

* Be smarter about updating profiles

* Update spec

* Update Bullet config

* Fix typo

* Change temporary rake task to data update script

* Re-add profile factory and update spec

* Change private declaration to make CodeClimate happy

* Update comment

* Drop validation in favor of DB default

* Update spec
2020-08-20 11:17:57 +07:00
rhymes
1375bf676e
[deploy] Nullify article_id for HtmlVariantTrials linked to non existing articles (#9845) 2020-08-18 14:51:06 +02:00
rhymes
0f6baaf4ba
[deploy] Remove orphaned DisplayAdEvent rows (#9765)
* Remove orphaned DisplayAdEvent rows

* Add dependent in the has_many relationship between ads and ad events
2020-08-14 09:29:08 -04:00
rhymes
d337f5ee41
[deploy] Add foreign keys to Ahoy models (#9636)
* Add foreign keys to Ahoy models

* Empty incorrect script

* Delete with SQL

* Moved cleanup script in #9710

* Trigger Travis correctly
2020-08-11 20:46:17 +02:00
rhymes
3a56e4b442
[deploy] Cleanup orphaned Ahoy rows in the DB (#9710)
* Cleanup orphaned Ahoy rows in the DB

* Trigger Travis correctly
2020-08-11 16:20:54 +02:00
Alex
d200959809
[deploy] Improve clean up of user language settings (#9671) 2020-08-10 14:51:38 -04:00
Alex
c988481004
[deploy] Cleanup preferred_languages language_settings for users (#9641)
* Cleanup language settings for users

* Remove logic for old language format

* Make preferred_langagues_array.include? nil safe
2020-08-06 10:00:01 -04:00
Molly Struve
d120fc7e54
[deploy] Bug Fix:Rename Listing Search Field in Elasticsearch to Fix Searching (#9609) 2020-08-03 10:18:17 -05:00
rhymes
864b13b9ab
[deploy] Rubocop: fix Rails/HasManyOrHasOneDependent for Ahoy::Visit and Badge (#9565)
* Fix Layout/EmptyLines

* Fix Rails/HasManyOrHasOneDependent for Ahoy::Visit

* Fix Rails/HasManyOrHasOneDependent for Badge
2020-07-31 11:43:50 -04:00
Michael Kohl
26ee8f194c
Rubocop: Move from OpenStruct to Struct in Organization (#9431)
* Move from OpenStruct to Struct in Organization

* Add data update script

* Introduce Articles::CachedEntity model

* Update data update script for new model

* Fix comment

* Update jbuilder
2020-07-30 21:04:05 +07:00
rhymes
5a2cae4fbb
Rubocop: enable and fix new Rails cops (#9537)
* Enable new Rails/* cops and use autocorrect on them

* Fixed Rails/PluckInWhere leftovers

* Fix Rails/DefaultScope

* Enable and fix Rails/PluckId

* Fix manual mistake with forcing autocorrection on Rails/PluckId

* Apply PR feedback to remove Rails/PluckId inline disables

* Apply PR feedback to get rid of Rails/PluckInWhere inline
2020-07-29 11:14:19 +02:00
Ben Halpern
bffa204310
[MERGE AFTER INVITATION PR] Add registered_at data script (#9331)
* Add registered_at data script

* Update lib/data_update_scripts/20200715140848_backfill_user_registered_at.rb
2020-07-27 12:28:06 -04:00
Julianna Tetreault
4a0784f080
Hotfix: Fix Typo in backfill_broadcastable_type_for_broadcasts (#9292) [deploy]
* Fix typo and replace .each with .find_each in broadcastable_type data_update script

* Adjust data_update script name to trigger script rerun
2020-07-13 10:50:29 -06:00
Julianna Tetreault
5f143c4308
Add Polymorphism to Broadcasts (Part 1) (#9231) [deploy]
* Add polymorphism to Broadcasts table
  - Adds a broadcastable_id column to Broadcasts
  - Adds a broadcastable_type column to Broadcasts

* Create Announcements and Welcome Notifications tables
  - Adds an Announcements table
  - Adds a Welcome Notifications table
  - Adds timestamps to both tables
  - Adds banner_style column to Announcements table

* Adds Announcement and Welcome Notification models
  - Adds an Announcement model in prep for polymorphism
  - Adds a WelcomeNotification model in prep for polymorphism

* Add data_update script to backfill type_of column for Broadcasts

* Add unique index on broadcastable_type and broadcastable_id on the Broadcasts table

* Add update! to the data_update script to backfill broadcastable_type
2020-07-13 09:36:19 -06:00
rhymes
5b62811c98
[deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
rhymes
70dc2429bc
Add timestamps to broadcasts (#8181)
* Add timestamps to broadcasts

* Update schema version
2020-06-01 18:11:38 +02:00
Michael Kohl
7f75f99560
[deploy] Rename classified listings (#7910)
* Change models and related files

* Update controllers and specs

* More renaming

* Seek and destroy, I mean search and replace

* Round up the stragglers

* Ground control to Major Travis...

* More fixes

* PR feedback

* Various fixes

* Rename view

* Fix list query builder

* Unify request specs

* Fix some API spec errors

* Fix remaining API specs

* Make spec conform to API

* Fix leftover problems

* Fix JS tests

* Fix column name in select

* Fix API specs

* Fix search specs

* Paging Mr. Travis
2020-05-27 13:35:09 +00:00
Andy Zhao
b02bf5ed5a
[deploy] Sync public reactions count with positive reactions count (#8064) 2020-05-26 14:41:51 -05:00
Andy Zhao
e686d63d78
[deploy] Add public reactions count fields to Elasticsearch (#7956)
* Add public_reactions_count field to elasticsearch

* Add new data update scripts and update old ones

* Use BulkIndexWorker to batch indexing

* Use proper search class for handling feed content

* Remove redundant script oops

* Rename data update script and remove old specs

* Combine specs into one file
2020-05-20 13:06:48 -04:00
Andy Zhao
91b14d7d4b
[deploy] Add data update script to backfill public reaction count (#7932)
* Add data update script to backfill public rxn count

* Reduce to two transactions instead of three
2020-05-18 17:51:02 -04:00
rhymes
ae8a58fec2
[deploy] Decouple GitHub authentication from fetching GitHub issues (#7660)
* Improve error handling

* Add tests for Github::Client

* Add GithubIssue validation

* Refactor GithubIssue and fix bug with pull requests

* Improve tests

* Fix PR API URL generation

* Improve logic and get rid of the issue fragment

* Fix disappeared avatar

* Improve rendering

* Activate client side caching using Redis

* Remove unnecessary file

* Add RemoveGithubIssues data update script

* Fix comma

* Forgot to disable the approvals verify text

* Apply PR feedback
2020-05-04 16:17:16 -04:00
Molly Struve
a4cc606291
[deploy] Remove Elasticsearch from Index Worker Names (#7594) 2020-04-29 12:12:29 -05:00
Molly Struve
ee373fa6c0
[deploy] Remove Algolia from Article Model (#7540) 2020-04-28 09:55:48 -05:00
Molly Struve
51b9312cf1
silence duplicate data update scripts to optimize starting up a new env (#7340) 2020-04-17 12:30:56 +02:00
Molly Struve
01adfc377c
[deploy] Index all readinglist Reactions into Elasticsearch (#7310) 2020-04-16 09:36:05 -05:00
Molly Struve
e4de9c2742
[deploy] Resync Elasticsearch Docs that had Previous Bugs (#7230) 2020-04-13 09:39:19 -05:00
Guilherme Vinicius Moreira
9618ccc927
[deploy] Add new user attributes to elasticsearch (#7123)
* chore(user): add new user attributes to elasticsearch

* Fix schema.rb
2020-04-07 13:16:15 -04:00
Molly Struve
2c49b34ebf
Hotness Score for Tags Should Use Article positive_reactions_count (#6808) [deploy]
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-03-31 09:04:20 -05:00
Molly Struve
d20a50aa2b
sync feed content documents in Elasticsearch (#6888) [deploy] 2020-03-26 13:11:09 -05:00
Molly Struve
a4ce1625e3
Search Users for Chat Channels Frontend (#6626)
* hook up user search for chat channels to Elasticsearch

* Add spaces

* run specs

* add more spaces

* reset travis file

* add another data upadte script to reindex Users
2020-03-13 10:26:32 -04:00
rhymes
ed66d7b181
Run BackfillColumnForBroadcasts only if the column still exists (#6508) 2020-03-09 15:38:34 +01:00
Molly Struve
82526989fc
Index Articles and Podcast Episodes to Elasticsearch (#6488) [deploy]
* Index Articles and PodcastEpisodes to Elasticsearch

* add callbacks to podcast episodes and specs

* refactor and clean up serializers
2020-03-06 16:39:36 -05:00
Molly Struve
731b89ca26
Index users into elasticsearch (#6489) [deploy] 2020-03-06 14:12:02 -05:00
Anna Buianova
df93e8d41e
Custom social preview template for tags (#6290) [deploy]
* Custom social preview template for tags

* Added index on tags social_preview_template + small refactoring

* Add checks if index exists to tags migration
2020-02-27 17:56:21 -05:00
Vaidehi Joshi
81e2a5efc3
Add active attribute to Broadcasts (#6318) [deploy]
* Add active attribute to Broadcasts

* Backfill active attribute on Broadcasts
2020-02-26 16:44:27 -05:00
Molly Struve
e752ff98af
Index ChatChannelMemberships to Elasticsearch (#6162) [deploy] 2020-02-19 14:29:16 -05:00
Alex
8d7b95ea15
Index ClassifiedListings to Elasticsearch (#6132) [deploy]
* Add ClassifiedListingEsIndexWorker & spec

* Update ClassifiedListing model

- Add es index methods (inline and async)
- Index ClassifiedListing to es after_commit
- Add serialized_search_hash
- Update model specs for new methods
- Add serializers referenced in new model method

* Update specs

* Create DataUpdateScript to index ClassifiedListings

* Fix formatting

* Fix codeclimate :/

* Use match_array instead of keys.sort

* Change find_by! to find

* Update spec

* Update mappings for ClassifiedListing

* Update specs

* Implement refactor with Searchable module
2020-02-19 09:55:37 -05:00
Ridhwana
6356089ee0
Re-index existing articles with DataUpdateScript (#6109) [deploy] 2020-02-17 10:14:50 -05:00
Molly Struve
ef9611d745
Create DataUpdateScript to Index all Tags (#6078) [deploy] 2020-02-14 14:17:52 -05:00