Commit graph

28 commits

Author SHA1 Message Date
Michael Kohl
f1aca16a1e
Improve Docker configuration (#6055) 2020-02-14 14:28:27 -05:00
Molly Struve
65eba740ab
Document DataUpdateScripts, Add to Deploy Process, Add Development Check (#6068) [deploy] 2020-02-14 11:45:27 -05:00
Vaidehi Joshi
f71c8b16e7
Allow dynamic authoring of welcome notifications (#6045) [deploy]
* Add "Welcome" type to Broadcasts, allow dynamic "authoring" of Broadcasts

This adds a new `type_of` to the Broadcast model: "Welcome". As we begin to create a new "welcome notification" workflow, we'll categorize them by making them all of the same type.

This also adds a concept of a "welcoming user", which can be set via an ENV var. The WELCOMING_USER_ID will allow us to explicitly set (and change) which user in the database is the one that "sends" welcoming notification. In production, we plan for this to be dev.to/sloan.

* Allow WelcomeNotificationWorker to accept + send any kind of broadcast

This abstracts out the logic of deciding which broadcast to send from the woker into the calling method. This will help us send many different kinds of welcome notifications using one, resuable worker class.

* Raise if a Notification can't be created

* Add STAFF_USER_ID as an ENV var

This is in preparation for moving away from SiteConfig.staff_user_id, and replacing it with an ENV var. We will need to set this in production first, and then make a separate PR to replace all instances of staff_user_id with the newly-set ENV var.
2020-02-12 13:50:37 -08:00
Vaidehi Joshi
c7a1bd9449
Fix logging for dev and test environments (#5922)
* Fix logging for dev and test environments

We had some unused code for Timber in our config files for development and test.
However, this was completely clobbering Rails' default behavior of logging out to log/development.log and log/test.log. We should allow for logging in these environments in particular, and since we're not using Timber there, we can just revert to using the Rails default debugging log levels.

* Add Timber logger to specs that explicitly require it

* Restore default Rails.logger in specs using Timber logger

* Explicitly use Rails.logger in OmniauthCallbacksController

We seem to have different logger classes leaking into this controller in tests.
I'm not entirely sure why this is/haven't been able to investigate yet, but I do think we should be using the Rails.logger explicitly until we can figure that out.
2020-02-07 10:15:08 -05:00
rhymes
c64a7c57c5
Update yarn.lock (#5811) 2020-01-31 14:49:43 -05:00
rhymes
fd6758fa39 Enable Bullet in development mode (#5527) 2020-01-15 13:21:00 -05:00
Ben Halpern
630c1b7425
Migrate to streaming app shell via serviceworkers (#5020) [deploy]
* Initial work for streaming app shell way of using serviceworkers

* Close in on serviceworker adjustment finalization

* Add docs and loading indicator

* Remove useless code

* Don't run on API

* Update app/javascript/contentDisplayPolicy/hideBlockedContent.js

* Fix small details

* Don't run serviceworker.js code in test env

* Fix JS in serviceworker

* Move private keyword to proper place in async controller

* Change shell_version to HEROKU_SLUG_COMMIT

* Update caching config

* Add test for async_info/shell_version
2019-12-16 12:21:33 -05:00
Keith Bennett
70e1ffbbc3 Fix rubocop Rails.root.path complaints (#5114) 2019-12-16 12:13:15 -05:00
Molly Struve
ce1bc8d2a4
Revert "Setup dual Redis store for rolling over fragment cacheing to Redis (#4991)" (#5014) [deploy]
This reverts commit e871a01c01.
2019-12-05 14:03:41 -06:00
Molly Struve
e871a01c01
Setup dual Redis store for rolling over fragment cacheing to Redis (#4991) [deploy] 2019-12-05 13:19:01 -06:00
Anna Buianova
4c9a40be41 Dispatch events to the webhook endpoints #3715 (#3872)
* Start with webhooks: table and model

* Start with webhooks api

* Start with webhooks api

* Webhook::Event class and events list

* Remove commented callbacks

* Start with sending events to webhook endpoints

* A couple of tests for Articles::Creator

* Send event to webhook endpoint on article destroy

* Dispatch event on article update

* Dispatch event when an article updated from admin

* Spec for the webhook job

* One more test for the dispatch event job

* Integration-like spec for event dispatching to webhook endpoints when creating an article

* Use Addressable::URI to parse endpoint url

* Add oj as a faster fast_jsonapi backend

* Renamed serializers

* Move article serialization out of a model

* Don't allow to create a webhook event with invalid type

* Add fields for ArticleSerializer

* Fix webhook event job specs

* Specify timeout when dispatching events

* Fix webhook job spec

* Change webhook events queue name

* Change serialized article fields for the dispatchable events

* Include user data when serializing an article for webhook event

* Moved decorating out of Webhook::DispatchEvent, fixed most specs

* Fix route in ArticleSerializer

* Move Article decoration to Webhook::PayloadAdapter

* Refactor image url helpers to avoid including helpers into serializer

* Fix specs

* Default url options for production
2019-09-07 13:17:45 -04:00
Kitten King
6290451273 Fix Typos (#3510) 2019-07-22 12:56:48 -04:00
rhymes
ba520f79c9 Add warn_on_records_fetched_greater_than setting (#3182) 2019-06-17 11:23:41 -04:00
rhymes
ff929fcf14 Some small performance improvements (#2876)
* Improve a few idioms with their faster counterparts

* Remove unused routes and some dead code

* Add the option to use bullet in testing mode and move rack host redirect

* Go back to the classic fetch to make mocking work

* Reorder gems and fix code climate issue
2019-05-20 18:53:31 -04:00
rhymes
3a53d5797e Upgrade Rails to 5.2.3 (#1408) 2019-04-03 13:08:59 -04:00
Abraham Williams
9cb40e546b Enables Rails cops (#2186)
* Enable Rails cops

* Fix Rails/DynamicFindBy

* Fix Rails/HttpStatus

* Fix Rails/Blank

* Fix Rails/RequestReferer

* Fix Rails/ActiveRecordAliases

* Fix Rails/FindBy

* Fix Rails/Presence

* Fix Rails/Delegate

* Fix Rails/Validation

* Fix Rails/PluralizationGrammar

* Fix Rails/Present

* Fix Rails/Output

* Fix Rails/Blank

* Fix Rails/FilePath

* Fix Rails/InverseOf

* Fix Rails/LexicallyScopedActionFilter

* Add Rails/OutputSafety to TODO

* Add Rails/HasManyOrHasOneDependent to TODO

* Add Rails/SkipsModelValidations to TODO
2019-03-25 09:25:55 -04:00
Tim Lange
3494264404 Enabled rubocop/lint (#2130)
* WIP: Enabled rubocop/lint

* FIX: Fixed failing test

* FIX: Small change to return

* FIX: Changed indent
2019-03-21 10:53:44 -04:00
Anna Buianova
854c7a773c Rubocop fixes (#1966) 2019-03-04 06:18:09 -08:00
Eugene Cheah
58f68b6602 Add SEND_LOGS_TO_TIMBER env var to control timber logging (#1933) [ci skip] 2019-03-01 12:07:32 -05:00
Andy Zhao
88cd4c13f3 Remove all flipflop related code (#1358)
* Remove all flipflop related code

* Undo an amend

* Comment out one last test

* Remove last test
2018-12-18 16:01:18 -05:00
Mac Siri
06e0cbabbb Revert "Replace Flipflop with Sail (#841)"
This reverts commit 21870e805a.
2018-12-18 13:44:40 -05:00
Vinicius Stock
21870e805a Replace Flipflop with Sail (#841)
* Replace Flipflop with Sail

* Address PR comments

* Bump sail version to latest

* Bump Sail to latest version

* Move setting creation to config/sail.yml

* Bump Sail to latest version

* Use correct limit for cast_type in schema

* Update Sail's route
2018-12-18 12:42:30 -05:00
Michael
cfda390845 Adds optional support for Docker/Compose (#296)
* Adds optional support for Docker/Compose

* Upgrades Dockerfile to use a multi-stage build

* Gets rest of stack running in Docker

* Renames queue to jobs, uses jobs namespace command

* Reverts file

* Adds webpacker

* Fixes yarn check issue

* Adds Database URL default connection string

* Remove daemons gem

* Update huskyhook config

* Update seed.rb

* Create .dockerignore

* Increase RackTimeout's config

* Simplify Docker config

* Update README

* Remove postgres url default

* Change docker entry point to 3000

* Remove duped integrity setting
2018-10-12 11:48:53 -04:00
Maksim Litvinov
33db32e5f4 Fix rubocop lints (#794) 2018-10-03 13:00:09 -04:00
rhymes
e588fa7ece Code cleanups (#659)
* Initial automatic cleanup with rubocop

* Fix syntax error introduced by rubocop

* Cleanup seeds file

* Cleanup lib folder

* Exclude bin folder because it contains auto generated files

* Make Rubocop a little bit more chatty

* Block length should not include comments in the count

* Cleanup config folder

* Cleanup specs

* Updated Rubocop version and generated a todo file

* Fix broken ArticlesApi spec

* Fix tests

* Restored rubocop pre-commit hook
2018-08-07 11:00:13 -04:00
Ben Halpern
4e4b2770de Update chat and add precompilation paths 2018-06-08 14:54:50 -04:00
Ben Halpern
2771a2e866
Add Algolia to comments, modify button styles, add comments tab to reading list area (#32)
* Add Algolia to search and add Only My Posts filter

* Actually fix Algolia index possible issue

* Fix search issue

* Make minor adjustments to sponsorship sidebar

* Make submission rules headsup html allowed and remove devise trackable

* Remove devise_trackable from application_controller

* Adjust login CTA for /new

* Adjust string in test to reflect changes

* Quick fix for internal navigatioon draft caching issue

* Add ID to internal/articles

* Fix auth with Twitter in two places

* Added comments to algolia and modified design

* Update sidebar styles and make other small adjustments

* Clean up tag styling and other small improvements

* Finalize design adjustments

* Add indexing condition for comments

* Fix Algolia typo

* Fix Algolia indexing on comment
2018-03-04 22:25:08 -05:00
Mac Siri
301c6080e3 Initial commit 2018-02-28 16:11:08 -05:00