Commit graph

391 commits

Author SHA1 Message Date
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
Molly Struve
33d6dca565
Apply Monkey Patch To Attempt To Fix Sidekiq Admin UI (#5634) [deploy]
* set sidekiq session to be the same as Rails to prevent forbidden UI errors

* monkey patch rack until new version is released to make Sidekiq Admin work
2020-01-22 14:46:24 -05:00
rhymes
09cf6719eb Use honeybadger.js from npm (#5643)
rails-assets.org is often down, and apparently has been down intermittently since yesterday.

In addition to this the only thing the gem does is literally to add `honeybadger.js` to the assets path:

```ruby
gem_path.join('app/assets').each_child.to_a
```

Hence we can ditch the gem and use the library directly.
2020-01-22 08:22:51 -05:00
Shelley Vohr
b146528aa8 feat: add per-user Open Dyslexic font setting (#5037) [deploy]
* feat: add per-user Open Dyslexic font setting

* Adjust css slightly

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-01-20 18:23:57 -05:00
Ben Halpern
8a403eba46
Bump assets version (#5587) 2020-01-20 08:13:58 -05:00
Molly Struve
ffba283b67
Only setup StrongMigrations in dev or test (#5562) [deploy] 2020-01-17 11:45:05 -05:00
Michael Kohl
9ef1ae512b Add strong_migrations gem (#5522)
* Add strong_migrations gem

* Incorporate PR feedback

* Move gem to group :development, :test
2020-01-17 09:45:44 -05:00
Molly Struve
1a3d59c97f
Send Sidekiq data to Honeycomb (#5517) [deploy] 2020-01-16 12:30:43 -05:00
rhymes
fd6758fa39 Enable Bullet in development mode (#5527) 2020-01-15 13:21:00 -05:00
Molly Struve
6726c62e94
Scrub unused data sent to Honeycomb to save space (#5512) [deploy] 2020-01-15 11:11:41 -05:00
Michael Kohl
256448f1f3 Remove unused Envfile variables (#5474)
* Remove unused variables from Envfile

* Remove unused Twitter variables from Envfile

* Also remove GITHUB_TOKEN

* Change Twitter token screenshot URL
2020-01-14 12:05:35 -05:00
Anna Buianova
e09e46ec99 Creating podcasts by users (#3730) [deploy]
* Create podcast as a user [WIP]

* Sample css for podcast form

* Nicer podcasts suggesting form

* Validate podcast feed_url

* Validate podcast main_color_hex

* Fix podcasts specs

* Fix form appearance

* Placeholder for podcast main_color_hex

* Provide a link to suggest a podcast

* Add a checkbox and a role for when a podcast is added by an owner

* Prettier checkbox in the podcasts form

* Added creator to podcasts

* Set the podcast creator

* Fix the /pod spec

* Added creator information to the internal podcast page

* Added cta class to the podcasts submit button

* Global notice when a podcast was suggested

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-01-08 16:14:25 -05:00
Jacob Herrington
9652ecc456 Refactor/internal ui update (#5339) [deploy]
* Move internal styles out of layout

* Upgrade to Bootstrap 4.4 and redo nav

* Redesign /internal/users/index

* Refactor /internal/tags/show

* Refactor /internal/broadcasts/index

* Refactor /internal/broadcasts/index

* Refactor /internal/pages/index

* Refactor /internal/mods/index

* Fix internal nav highlighting

* Refactor internal/organizations/index

* Refactor internal/growth

* Refactor internal/badges

* Refactor /internal/podcasts/

* Refactor internal listings filter

* Refactor /internal/endpoints/

* Refactor /internal/tools/

* Refactor /internal/chat_channels/

* Refactor /internal/config/

* Refactor /internal/feedback_messages

This is the one that worries me the most. I made a strong effort not to
touch any IDs and the JavaScript appears to be working after manual
testing.

This view probably needs some systems specs covering it.

* Remove unused CSS

* Refactor feedback_messages/show

* Refactor internal/comments

* Refactor internal/podcasts/edit

* Refactor internal/users/show

* Refactor internal/users/edit

* Refactor internal/organizations/show

* Refactor internal/permissions

* Refactor internal/tags/show

* Refactor internal/pages/form

* Add events to navbar

* Refactor internal/events

* Refactor internal/brodcasts

* Refactor internal/articles

* Refactor internal/listings

* Remove unused CSS

* Load jquery earlier
2020-01-06 07:58:03 -05:00
rhymes
13363dd329 Rails 5.2 features: enable cache versioning (recyclable keys) (#5329) [deploy] 2020-01-02 08:40:03 -05:00
rhymes
ba424854c2 Enable cache logging in development if requested (#5330) 2020-01-02 08:11:58 -05:00
Molly Struve
6a6fd949b7
setup sidekiq queues for different priority jobs (#5300) [deploy] 2019-12-30 10:16:52 -06:00
Molly Struve
45b156be86
add Sidekiq monitoring for Datadog and Honeybadger (#5270) 2019-12-30 10:16:25 -06:00
rhymes
1aee4202d8 Switch external redis_store to Rails supported redis_cache_store (#5282)
`redis_store` was initially introduced to switch sessions from the cookie store to Redis in https://github.com/thepracticaldev/dev.to/pull/4004. When we introduced a dual cache store in https://github.com/thepracticaldev/dev.to/pull/4991 we forgot to use the builtin Rails cache store - [ActiveSupport::Cache::RedisCacheStore](https://guides.rubyonrails.org/caching_with_rails.html#activesupport-cache-rediscachestore) - and instead kept using the external [ActiveSupport::Cache::RedisStore] which comes from the `redis-activesupport` gem included by `redis-rails`.

The gem `redis-activesupport` contains this disclaimer:

> Rails 5.2.0 includes a Redis cache store out of the box, so you don't really need this anymore if you're generating a new Rails application. We are no longer accepting new features for this gem, only pull requests for security and compatibility fixes will be accepted.

Other reasons to use the Rails builtin cache store, other than being supported and developed are the following:

- supports and uses `hiredis` as a client if installed:

22483b86a6/activesupport/lib/active_support/cache/redis_cache_store.rb (L12-L14)

- supports compressions for keys over 1kb (that can be configured)

- is evolved with Rails itself
2019-12-30 10:34:20 -05:00
Molly Struve
9ab150daac
Change RateLimitCheckerJob to RateLimitCheckerWorker and move to sidekiq (#5269) [deploy] 2019-12-27 16:09:25 -06:00
Molly Struve
2470355e89 Implement Datadog tracing agent and APM (#5107) [deploy]
* Implement Datadog tracing agent and APM

* if I had a nickle....

* more double quoted strings and rubocop fixes

* put gems in the right order

* Remove skylight to prevent initializer collisions with Datadog which cause infinite loops

* remove skylight config files
2019-12-27 15:49:05 -05:00
rhymes
09e5ad5c0c Remove PushNotificationSubscription (#5258) [deploy] 2019-12-27 13:45:38 -06:00