Commit graph

101 commits

Author SHA1 Message Date
Michael Kohl
c2d23cfc4d
[deploy] Seed profile fields (#9605)
* Fix schema.rb

* Add service objects for base and link fields

* Add link fields to seeds

* Make placeholder a keyword argument

* Add work fields

* Add explanation column to profile fields

* Add coding fields

* Switch from inheritance to mixin

* Add email checkbox to base fields

* Add branding fields

* Add spec for ProfileFields::FieldDefinition

* Move migration back into correct location

* Rename column from explanation to description

* Rename attribute in mixin

* chore: rename from explanation to description

* Add ProfileFields::ImportFromCsv

* Simplify ProfileFields::ImportFromCsv

* Add comment about disabled cop to spec

* Add TODO comment to Rake task

* Document mixin

* Add groups to profile fields

Co-authored-by: Ridhwana <ridhwana.khan16@gmail.com>
2020-08-05 10:11:30 -04:00
Molly Struve
34458d5de9
[deploy] Bug Fix:Run Hypershield Refresh AFTER db:prepare (#9546) 2020-07-27 17:30:02 -05:00
Molly Struve
397c9ed2bf
[deploy] Bug Fix: Refresh Hypershield after db:prepare if Enabled (#9353) 2020-07-16 13:50:22 -05:00
rhymes
8126c5c2c1
Rubocop: Address Metrics/BlockLength violations (#9246)
* Address Metrics/BlockLength violations

* Add jbuilder to package auto correct
2020-07-10 13:53:32 -04:00
Vaidehi Joshi
35b516a60d
Add metrics around welcome notifications + their click events (#9239)
* Log to DataDog when a welcome notification is created

* Fix typo in Metrics::RecordDailyUsageWorker

* Add Metrics::RecordDailyNotificationsWorker to log notification counts to DataDog

* Add specs around DataDog logging for welcome notifications + click events

* Call Metrics::RecordDailyNotificationsWorker from within log_daily_usage_measurables task

* Use user_id instead of user, move notification title into tags
2020-07-10 12:30:45 +02:00
rhymes
380adc30ed
[deploy] Remove user_counters table (#8445) 2020-06-15 11:46:02 -04:00
rhymes
71d53873d1
Use Rails 6 new features in the code (#8342)
* Use pick instead of pluck first

* Use touch_all instead of update_all

* Use destroy_by instead of where.destroy_all

* Use scopes

* Fix db:seed:replant

* Remove ActiveSupport::Cache::RedisCacheStore expires_in cache
2020-06-08 16:06:29 -04:00
rhymes
9215d04f08
[deploy] Routine Rubocop fixes (#8293)
* rubocop -a fixes

* rubocop --auto-gen-config
2020-06-05 18:46:10 -04:00
rhymes
ca71e4c237
[deploy] Fix app_initializer:setup for Rails 6 (#8269) 2020-06-04 17:09:29 +02:00
Ernesto Tagwerker
9ea3a8c67d
Upgrade to Rails 6.0 (#7658)
* Add dual booting logic to Gemfile

This might be helpful for the Rails 6.0 upgrade project.

* Add more than one gemfile to Travis' configuration

We want to see how the application behaves with more than one Rails versions:

- Gemfile -> Rails 5.2
- Gemfile.next -> Rails 6.0

This will help us figure out what needs to be addressed before migrating to Rails 6.0.

If you want to read more about this technique (dual booting) you can check out this page: https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html

* Fix joins

* Upgrade Gemfile.next.lock

* Make sure we're installing the correct versions of gems

* Add Rails 6 notes

* Update rubocop in Gemfile.next.lock

* Fix organization spec

* Fix page_views_spec

* Add Rails 6 and run rails app:update

* Remove some tricks

* Remove Gemfile.next for now

* Fix .content_type deprecation

* Fix deprecation of .where.not NAND/NOR behavior

* Fix deprecation of parameterized emails

* Fix specs

* Remove next flag for now

* Fix spec (hopefully)

* Add wait_for_javascript

* Fix spec, thanks @maestromac!

* Try without wait for javascript hack

* Remove unnecessary bin/update

* Remove file that snuck in the rebase

* Update the vendored gems

* Replace migrate+db:setup with db:prepare

* Update vendored gems

* Fix Gemfile.lock and update vendored stuff

* Fix Gemfile.lock to be the same as master's minus the changes

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-06-04 11:54:25 +02:00
Molly Struve
c837e7968a
[deploy] Only load Pages Rake in Development (#8233) 2020-06-02 09:22:02 -05:00
Fernando Valverde
fd639c2c15
pages:sync rake task for easier local coding of HTML Page (#8190)
* pages:bind rake task for local coding of HTML Page

* Tweaked task description

* Adds tests and enhancements to the task

* Replaces fixture with tmp file

* Adds check to avoid any side effects in production

* Removes clunky test

* Removes check for Test ENV (no longer in use)

* Adds reference to Pages in docs
2020-06-02 11:23:39 +02:00
Molly Struve
e1b99b1b96
[deploy] Generate Random Health Check Tokens on App Setup (#8178)
Co-authored-by: rhymes <rhymesete@gmail.com>
2020-05-30 14:11:02 -05:00
Molly Struve
182faa0289
[deploy] Consolidate Setup Tasks to a Single Rake Task (#8065) 2020-05-27 11:59:07 -05: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
rhymes
80a01cefed
Fix db:reset by adding search:setup after search:destroy (#8000) 2020-05-21 09:49:27 -05:00
Molly Struve
1c461f8891
[deploy] Remove Unused Pro Memberships (#7894) 2020-05-20 11:54:30 -05:00
Molly Struve
dda2e6aa65
Drop Elasticsearch Indexes When Database is Dropped (#7927) 2020-05-18 13:10:08 -05:00
Michael Kohl
a49ae729a0
Remove temporary Rake task (#7842) 2020-05-14 11:22:06 +02:00
rhymes
b5ebf8f3dc
Routine rubocop fixes (#7743)
* Rubocop auto fixes

* Fix Capybara/VisibilityMatcher

* Regenerate todo
2020-05-08 19:38:06 +02:00
Michael Kohl
7e6c2b3977
Refactor classified listing social previews (#7679)
* Refactor classified listing social previews

* Rename decorator method

* Fix overeager renaming
2020-05-06 14:00:09 -04:00
Alex
7149070bca
[deploy] Create FastlyConfig & refactor params safe list (#7630)
* Fastly refactor

- Create FastlyConfig
- Create FastlyConfig::Base
- Create FastlyConfig::Snippets
- Move safe_params to its own VCL file
- Rescue unauthorized errors in development
- Add FastlyConfig errors

* Move active version to method

* Update naming option --> config

* Refactor InvalidConfigsFormat msg to Error class

* Refactor active version logic

* Fix log_to_datadog call

* Move get_active_version logic back into method

* Add some specs ¯\_(ツ)_/¯

* Update Fastly rake task

* Remove old Fastly way

* Update docs for Fastly

* Move snippets to config/ & remove old config

* Change update_config to upsert_config

* Change error type to SubclassResponsibility

* Refactor get_updated_files with filter_map

* Refactor update

* Cleanup update_config --> upsert_config

* Fix updater specs
2020-05-01 11:23:48 -04:00
rhymes
2d26318cf9
[deploy] Replace (black|white)list with more inclusive language (#7459)
* Replace isBlacklisted

* Update fastly.rake task

* More renames

* Rename Faslty config file

* More changes

* Replace isForbiddenFromPreloading with isNotPreloadable

* Skip problematic test

* Re-enable
2020-04-27 18:00:12 +02:00
Alex
8b51d8e4b8
[deploy] Fix Fastly rake task spec and Travis CI (#7487)
* Try changing exit to next

* Add breaking test

* Fix search.rake

* Remove test failure
2020-04-23 16:06:57 -04:00
Alex
397734b29c
Generalize Fastly rake task (#7349)
* Generalize Fastly rake task

- Update Rubocop to disable DescribeClass on rake task specs

* Change default Fastly ENV vars to ""

* Move snippet name to ENV

* Update ENV to FASTLY_WHITELIST_PARAMS_SNIPPET_NAME

* Add FASTLY_WHITELIST_PARAMS_SNIPPET_NAME to the docs

* Update docs

* Quick refactor
2020-04-22 11:49:54 -04:00
Alex
cc6249beff
[deploy] Update whitelisted params on Fastly on deployments (#7279)
* Add Fastly whitelisted params

* Create FastlyVCL::WhitelistedParams.update service

* Add specs

* Create rake task to call new service

* Add rake task to setup script

* Add documentatoin

* Move sort inside params_to_array method

* Rename VCL_REGEX to VCL_DELIMITER

* Add PR URL to docs

* Move snippet name to SNIPPET_NAME constant

* Refactor setting content

* Rename params_to_array to params_to_sorted_array

* Change guard and log success on update

- Return early if params are equal
- Log success message to Rails.logger on update
- Log params diff to Datadog

* Return true explicitly

* Move rake task execution from to release-tasks

* Remove unnecessary environment guard in task

* Remove duplicate code param

* Refactor string from build_content

* Remove reliance on sort

* Reorder logging to implicitly return true

* Update docs to reference release-script.sh

* Update docs

* Update whitelisted params

* Fix params_updated? bug and add more specs

* Remove duplicate param...oopsie!
2020-04-16 15:11:57 -04:00
Michael Kohl
ca23b8e1c6
[deploy] Introduce ClassifiedListingCategory model (#7172)
* Add ClassifiedListingCategoryModel

* Add data update script for classified listing categories

* Add foreign key to reference

* Move data update script to temporary rake task

* Update factory

* Add and fix specs

* Fix typo

* Fix migration

* Correctly add unique index

* Fix migration

* Add slug column to classified listing categories

* Add unique index for slug column
2020-04-13 09:01:58 -04:00
Ridhwana
cbff423861
chore: remove script (#7215) 2020-04-10 16:59:09 +02:00
Ridhwana
e626cfa933
[deploy] Split out social media options (Important: post deployment task to be run) (#7173)
* feat: define the different social media handles

* feat: dynamically render all the social media fields

* feat: ensure that the social media handles are permitter and dealt in a separate path from the rest

* test: update  social_networks_handle to social_media_handles

* feat: update the sidebar to use different social media

* feat: update the twitter:site meta handle to be  SiteConfig.social_media_handles["twitter"]

* feat: update the a links to tweets

* feat: make the links dynamic and only show those that there is a value for

* refactor: make @ThePracticalDev dynamic

* refactor: make @ThePracticalDev dynamic

* feat: add dynamic social media handles

* chore: rename values

* chore: remove extra social handles

* chore: some spacing

* chore: remove lines

* rafector: user rails-settings-cached type: :hash to set the type and the defaults

* feat: use nil and blank instead of "" and empty

* chore: move the social media handles into the right box

* refactor: rearrange model placement based on the UI

* chore: code climate

* refactor: comments from PR

* chore: rename the ff

* chore: amended twitter username

* chore: add a temporary rake task

* feat: update names

* chore: why am i using the old syntax :(

* chore: revert dynamic erb variable in offline.html
2020-04-09 19:51:11 +02:00
Mac Siri
b5fa02bf33
Create Broadcasts.rake (#7010) 2020-04-02 17:24:39 -04:00
Mac Siri
217ee6c3f4
Organize rake tasks (#7005) 2020-04-01 12:39:40 -04:00
Alex
129cd3ba83
Log Elasticsearch index counts to Datadog (#6845) [deploy] 2020-03-25 15:52:54 -05:00
Ben Halpern
5bd042e7d6
Prune old field tests for ongoing tests (#6540) [deploy] 2020-03-09 16:22:42 -04:00
Alex
bbec492844
Remove more Algolia from ClassifiedListing (#6463) [deploy]
* Remove ClassifiedListing from algolia initializer

* Remove reference to remove_from_index
2020-03-05 09:23:22 -08:00
rhymes
e27c9b77a3
Refactor Elasticsearch client access (#6307) [deploy]
* Add Transport module to Search
* Test public methods only
* Add Search::Client with exception handling
* Remove Transport and request do
* Replace SearchClient with Search::Client
2020-02-28 11:38:37 -05:00
rhymes
f3c2adfa45
Routine rubocop fixes (#6138) 2020-02-18 11:21:42 -05:00
Molly Struve
0bfbd9bb1f
Set Up Framework For Running Data Update Scripts (#6025) [deploy] 2020-02-13 10:48:23 -05:00
Molly Struve
acfdd11b50
update cluster settings to prevent auto index creation, update destroy to remove ALL indexes (#6042) 2020-02-12 15:21:38 -05:00
Juanito Fatas
33b8014677
Fix indentation in search.rake (#5971)
lib/tasks/search.rake:9:3: C: Layout/IndentationWidth: Use 2 (not 3) spaces for indentation. (https://rubystyle.guide#spaces-indentation)
     Search::Cluster.update_mappings
  ^^^
2020-02-10 09:09:23 -05:00
Maykon Menezes
01dc81afa9
Move Podcasts::GetEpisodesJob to Sidekiq (#5443) [deploy]
* Refactored Podcast::GetEpisodesJob to sidekiq

* fixing specs

* removing env keys

* Change arguments to Hash

* Update specs and add spec for queue

* Update references for Hash argument

* Add comment to explain parameters of #perform

Co-authored-by: Alex <alexandersmith223@gmail.com>
2020-02-06 09:42:55 -08:00
Molly Struve
00fefe5865
Add Code To Setup the Elasticsearch Tag Index (#5919) [deploy] 2020-02-06 11:46:11 -05:00
rhymes
3260270103
Have counters:update_users use a transaction per user and customizable batch size (#5912) [deploy] 2020-02-05 12:26:03 -05:00
rhymes
a1835ae5b9
User counters using PostgreSQL JSON (#5373) [deploy]
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-02-03 10:35:08 -05:00
Ben Halpern
a4b86e3ff1
Add initial usage metrics for datatog (#5544) [deploy]
* Add initial usage metrics for datatog

* Make measurable name more clear

* Change name of daily usage worker

* Fix test names
2020-01-16 12:59:17 -05:00
Molly Struve
5962d52a61
record background queue stats in a worker (#5533) [deploy] 2020-01-15 14:44:57 -05:00
Molly Struve
2e5a36e538
Log DB Table sizes in a Sidekiq Worker (#5518) 2020-01-15 12:33:14 -05:00
rhymes
9b2886979a ActiveRecord count optimizations (#5478) [deploy]
* Do not load messages in memory, just to count them
* Add Model.estimated_count
* Use Model.estimated_count in task record_db_table_counts
* Use size and estimated_count
* Use table_name so that .estimated_count works with all models
* Add comment to explain the .load.size + .each pattern
2020-01-14 12:03:38 -05:00
Michael Kohl
dba7e6ca60 Move Twitch webhook registration from ActiveJob to Sidekiq (#5414) 2020-01-14 11:55:35 -05:00
rhymes
c267526ed2 Remove temporary site config script and unused ENV var (#5455) [deploy] 2020-01-14 09:49:31 -06:00
rhymes
102e1a6b9c Routine rubocop fixes (#5386) 2020-01-08 09:05:12 -05:00