Commit graph

411 commits

Author SHA1 Message Date
rhymes
c3e7179f5b
Bump to sprockets 4.0.0 (#6172) [deploy]
* Bump to sprocket 4.0.0

* Add manifest.js

* Link internal/layout.css

* Make it more similar to Rails 5.2 default
2020-02-24 18:16:08 -05:00
rhymes
a5588ae430
Enable strong-migrations in all environments (#6279) [deploy]
* Enable strong-migrations in production
* Disable environment checks in initializers
* Remove misleading description
2020-02-24 11:12:49 -05:00
rhymes
aa5f4b8d85
Remove leftover Stripe subscriptions code (#6243) 2020-02-24 08:33:36 -05:00
rhymes
9153f61ef8
Optionally log to stdout (#6230) 2020-02-21 13:56:39 -05:00
rhymes
8c7aa2e494
Rename DataDog to Datadog (#6226) 2020-02-21 12:00:30 -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
Nick Taylor
ee9b1f58b9
Enabled ERB support for webpacker (#6166) [deploy] 2020-02-19 08:58:37 -05:00
Josh Puetz
35c2800c89
Add json support at stories/index endpoint (#6070)
* Add json support at stories/index endpoint

* Tweak tests

* Add main image

* Some light refactoring in StoriesController

* Tiny test refactor

* Split feed generation to it's own controller

* Use Jbuilder for article formatting

* Blank lines thanks Rubocop

* Don't cache this response: we want it generated per use each time

* Whoops!

* PR changes and tweaks to Timeframmer constants

* Remove initializer test since arguments aren't required
2020-02-18 15:15:40 -06:00
Molly Struve
895bf07ef3
Add Elasticsearch to Datadog APM (#6129) [deploy] 2020-02-18 16:07:50 -05:00
rhymes
b05d14a851
Enable CORS preflight caching (#6153) [deploy] 2020-02-18 13:37:54 -05:00
Molly Struve
74118c2d1f
Setup ChatChannelMembership Index (#6152) [deploy] 2020-02-18 13:30:52 -05:00
rhymes
b8955f19fe
Add history as a reserved word (#6150) [deploy] 2020-02-18 11:55:00 -05:00
rhymes
6cbfb01394
Stop using legacy user's organization_id and remove followers unused code (#6079) [deploy] 2020-02-18 11:27:43 -05:00
rhymes
f3c2adfa45
Routine rubocop fixes (#6138) 2020-02-18 11:21:42 -05:00
rhymes
a56eb8fab0
Enable CORS on public API endpoints (#6116) [deploy]
* Enable CORS for public API

* Add specs for Articles API

* Mention CORS in the API docs
2020-02-18 10:47:07 -05:00
Molly Struve
98f25e2b9d
Remove UserHistory Feature and PageViews from Algolia (#6127) [deploy] 2020-02-18 10:06:30 -05:00
Molly Struve
21d88399be
require worker_retries_exhausted_reporter in Sidekiq initializer (#6131) [deploy] 2020-02-18 07:56:11 -05:00
Molly Struve
04dcca0b13
remove algolia from Tag model (#6123) 2020-02-17 12:28:10 -05:00
Molly Struve
7ff79f77b8
Search Tags in Elasticsearch from Classified Listing and Post Creation (#6024) [deploy] 2020-02-17 08:16:45 -05:00
Vaidehi Joshi
76fe99b76a
Add Broadcast seeds + generator service to set up for welcome notifications (#6080)
* Add more Broadcasts to seeds for welcome notification flow

* Remove unnecessary welcoming_user_id from development config

* Add basic service class for generating appropriate broadcast per user

Eventually, this should be called from a rake task that will rely on this service to determine which broadcast, if any, is the appropriate one to send to newly signed-up users, and will enqueue a worker to create/send a welcome notification when appropriate.

* Add a few TODOs, plus some general cleanup

* Add some skipped tests for WelcomeNotification::Generator
2020-02-14 12:30:25 -08:00
Michael Kohl
f1aca16a1e
Improve Docker configuration (#6055) 2020-02-14 14:28:27 -05:00
Alex
b81c2e8df3
Remove delayed_job (#6071) [deploy]
* Update adapter to sidekiq

* Remove delayed_jobs routes

* Remove delayd_jobs initializer and references

* Remove delayed_job_spec

* Remove bin/delayed_job

* Remove app/jobs/

* Migration to drop delayed_jobs table

* Remove delayed_job_web & delayed_job_active_record

* Update docs

* Remove reference to delayed_job dashboard

* Remove delayed_job settings from initializers

* Add delayed_job_admin back to reserved words list
2020-02-14 10:00:26 -08:00
Molly Struve
65eba740ab
Document DataUpdateScripts, Add to Deploy Process, Add Development Check (#6068) [deploy] 2020-02-14 11:45:27 -05:00
Alex
2bd2800365
Update queue_adapter to Sidekiq (#6066) [deploy] 2020-02-14 11:07:49 -05:00
Alex
d32dc38bed
Move ClassifiedListing mappings to JSON file (#6061) [deploy] 2020-02-13 14:39:39 -08:00
Molly Struve
7e5a8d59d9
enable bread crumbs for Honeybadger (#6069) 2020-02-13 17:30:36 -05:00
Molly Struve
9f4dad77da
Move Elasticsearch mappings to config folder as json file (#6051) [deploy] 2020-02-13 11:33:47 -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
Michael Kohl
2a0a89239c
Add health check endpoint for Mailchimp unsubscribe webhook (#6034) [deploy] 2020-02-12 15:55:21 -05:00
Andy Zhao
0f9b52f800
Use post instead of get for CSRF (#6026) 2020-02-11 17:56:11 -05:00
rhymes
ac7785ea8d
Update doorkeeper initializer with new (disabled) features (#6011) 2020-02-11 16:04:52 -05:00
Michael Kohl
050a2e2726
Implement Mailchimp unsubscribe webhook (#5804) [deploy] 2020-02-11 14:25:48 -05:00
rhymes
3258bc357a
Sort reserved words (#6000)
* Sort reserved words

* Remove duplicate words

* Make it a set

* Nope, it cannot be a set
2020-02-10 16:07:27 -05:00
rhymes
c41d66e900
Replace ban/banned with suspend/suspended in user facing text (#5816) [deploy] 2020-02-10 10:12:53 -05:00
Molly Struve
4691ae1e34
Log in Datadog When Sidekiq Worker Fails for Final Time (#5942) [deploy] 2020-02-10 08:56:41 -05:00
Alex
41d812b8a7
Revert "Update queue_adapter to Sidekiq (#5960)" (#5961) [deploy]
This reverts commit 05ce09b899.
2020-02-07 18:37:05 -05:00
Alex
05ce09b899
Update queue_adapter to Sidekiq (#5960) [deploy] 2020-02-07 14:48:19 -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
6cd46ae2f9
Enable bullet during tests to catch N+1 early (and some cleanups) (#5930) [deploy]
* Remove unused methods

* Small refactorings

* Enable bullet in testing mode

* Remove unused eager loading for notes

* Skip bullet on rolify method

* Use .present?

* Fix method name
2020-02-07 09:02:22 -05:00
rhymes
fd5643bc9d
Improve API controllers efficiency by selecting only columns needed for serialization (#5805) [deploy] 2020-02-06 07:36:56 -05:00
rhymes
3b25b014a3
Replace the initial migration for strong_migrations gem (#5865) 2020-02-03 11:32:46 -05:00
Molly Struve
0409722899
Introduce Elasticsearch to DEV env (#5762) [deploy] 2020-02-03 09:12:05 -05:00
rhymes
c64a7c57c5
Update yarn.lock (#5811) 2020-01-31 14:49:43 -05:00
Molly Struve
a19ce5518e
combine Rack::Timeout::RequestTimeoutErrors with Exceptions in Honeybadger (#5789) [deploy] 2020-01-28 16:55:51 -05:00
Ben Halpern
82f2281b1c
Create dynamic robots.txt page (#5794) [deploy]
* Create dynamic robots.txt page

* Add tests and remove cachebust
2020-01-28 16:49:34 -05:00
Molly Struve
b06ad5064a Remove ENV["USE_NEW_AWS"] and use Orig ENV variables for New Creds (#5771) [deploy]
* Remove temp ENV variable for switching buckets and use original ENV variables

* correctly choose AWS region
2020-01-27 15:46:57 -05:00
Michael Kohl
6321fbac9c Add production verify stage to TravisCI config (#5621) 2020-01-27 14:15:22 -05:00
Molly Struve
c336dfc84a
Setup SitemapGenerator and CarrierWave to use new AWS creds when ENV var is set (#5570) [deploy] 2020-01-24 14:25:57 -05:00
Molly Struve
efed5461d4
Whitelist dev.to for Rack when working with Sidekiq (#5700) [deploy] 2020-01-24 13:00:02 -05:00
Molly Struve
25e985cfce
Group all PG::TRDeadlockDetected and PG::QueryCanceled errors together (#5681) [deploy] 2020-01-23 17:54:46 -05:00