Commit graph

378 commits

Author SHA1 Message Date
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
rhymes
11689929ef Disable Sidekiq web sessions to make it work with Redis sessions (#5266) [deploy] 2019-12-27 12:04:50 -06:00
Molly Struve
2e661809b6 Introduce Sidekiq For Background Jobs (#5252)
* Introduce Sidekiq to the app and update RateLimitCheckerJob to use it

* fix rate limit checker spec with new sidekiq syntax

* add Sidekiq to tech stack overview

* Remove RateLimitChecker job change, add sidekiq web UI and testing support
2019-12-27 10:39:48 -05:00
Molly Struve
9638e3da26
Group Honeybadger Rack::Timeout::RequestTimeoutExceptions (#5231) [deploy] 2019-12-23 19:34:08 -06:00
Ben Halpern
03c2404b13
Redo /mod for performance and usability (#5230) [deploy] 2019-12-23 18:10:25 -05:00
Sarthak Sharma
b602b7b91f 🚀Feature/ability to edit messages (#5139) [deploy]
* Feature 🚀 : Ability to delete messages in chat channels

- Sending message ID to frontend
- Deleting Message
- Use pusher to delete message realtime

* Minor Bug 🐞: Show message action only for current user

- User can delete or edit their own messages

* Test cases added

* Bug 🐞: Update message id for receiver

Message id was not sent to receiver by pusher

* Refactoring🛠: Message controller refactoring

* Test Cases📝 : Specs for Delete message added

* Feature 🚀 : Ability to edit messages

* Test Cases📝 : Specs for Edit message added

* Refactoring🔩: Refactoring for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Test Cases📝 : Test Cases for edit message added

* Minor Bug 🐞: Show message action only for current user

- User can delete or edit their own messages

* Test cases added

* Bug 🐞: Update message id for receiver

Message id was not sent to receiver by pusher

* Feature 🚀 : Ability to edit messages

* Test Cases📝 : Specs for Edit message added

* Refactoring🔩: Refactoring for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Refactoring🔩: Refactoring:2 for edit messages

* Bug Fix 🐞: Added space between edited and timestamp

Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2019-12-20 10:19:00 -05:00
Anna Buianova
dcfa6d29b8 Fix Rubocop lints (#5155) 2019-12-19 10:09:37 -05:00
Molly Struve
1156aff711
Ignore ActiveRecord::QueryCanceled errors in Honeybadger (#5165) [deploy] 2019-12-18 13:09:49 -06:00
Jacob Herrington
d98f8237bd Add view for managing organizations (#5149) [deploy]
* Add view for managing organizations

This adds only an index and show action for the internal/organizations
page. Eventually we'll flesh this out with features to automate the more
mechanical org management tasks.

* Use instance variable for search query

* Convert multiple expects into one

* Add pagination to organizations

* Add search spec for organizations

* Use size over count
2019-12-17 12:07:11 -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
Jacob Herrington
35ede32be7 Internal bulk badge awarder (#5110) [deploy]
* Move admin specs

These tests should probably be grouped together, so I moved them into a
directory called "internal"

This also encourages some additional internal tests.

* Add an internal badges controller

* Add internal view for running BadgeRewarder task

Because:
  - Peter is currently running this rake task from Heroku and this is
  going to make his workflow easier
  - It's a step towards having a decent tool under internal for managing
  badges (though I'd hesitate to call this decent)

This change adds a view and controller action to award badges in
batches, it's an improvment over the current workflow that Peter is
using, but it's still very rough around the edges.

We could definitely improve this with some error handling around the way
the BadgeRewarder works, but for now this is a net gain over how Peter
has been doing this task. I think it's worth merging as is and future
work to improve the experience and reliability of this tool can be
prioritized against other tasks.
2019-12-16 11:31:37 -05:00
Jacob Herrington
b34ae9b7d9 Remove dead code (#5090) [deploy] 2019-12-12 12:19:55 -06:00
Andy Zhao
71157c993e Hide comment feature (#4944)
* Add MVP of hide comment feature

* Slight copy adjustments

* Remove unused file oops

* Fix strange styling issues

* Add hide/unhide comment specs

* Authenticate user for hide/unhide

* Add tests for hide/unhide functionality

* Remove opacity CSS for hidden comments

* Fix hidden comment explanation logic

* Fix some styling issues

* Fix hiding top level comment logic

* Show only hidden comments in permalink and not thread

* Hide subtree properly if hidden comment

* Fix weird CSS issue

* Properly hide comments for permalink view

* Show children comments in permalink view

* Add tests for comment hiding visibility

* Remove superfluous code and adjust copy

* Remove some more logical duplication

* Add dedicated article column for any comments hidden

* Add reload in test
2019-12-10 15:09:47 -05:00