Commit graph

107 commits

Author SHA1 Message Date
Kate Studwell
a7e03c89d6 Disable indented code blocks in markdown renderer (#4438) 2019-11-05 14:15:39 -05:00
Ben Halpern
d34dbae4c2
Add /future redirect (#4724)
* Add /future redirect

* Add check for HONEYCOMB_API_KEY

* Whoops wrong branch
2019-11-05 08:41:25 -05:00
Ben Halpern
628c044f3f
Check for existence of honeycomb before using it (#4725) 2019-11-05 08:38:42 -05:00
rhymes
0591362756 Use libhoney explicitly and group initializers (#4699) [deploy]
* Use libhoney explicitly and group initializers

* Use Libhoney TestClient during tests

* Use test client for Honeycomb during tests as well
2019-11-04 11:55:04 +00:00
Molly Struve
faaf6e35f1 Create custom HoneycombClient (#4692) [deploy] 2019-11-01 17:11:57 -04:00
Molly Struve
00e3ee811b Use ActiveSupport::Cache::RedisCacheStore As RedisRailsCache (#4676) [deploy] 2019-11-01 12:19:12 -04:00
Molly Struve
dc72b4f1fa Add Honeycomb beeline gem for monitoring and observability (#4649) 2019-10-30 12:02:31 -04:00
Molly Struve
69e35dc1b3 Add Redis gem and Create RedisClient (#4582)
* Add redis gem and client

* use keyword arguments in redis initializer

* check for REDISCLOUD_URL and fallback on REDIS_URL when connecting to redis

* dont parse Redis url in initializer
2019-10-30 10:32:59 -04:00
rhymes
8989a52aba Strip EXIF and GPS data from uploaded images (#4450)
* Add specs for ArticleImageUploader

* Add specs for BadgeUploader

* Add specs for CoverImageUploader

* Add specs for ProfileImageUploader

* Refactor uploaders to inherit from BaseUploader

* Strip EXIF and GPS data from uploaded images

* Add ImageMagick to the docs

* Protect strip_exif
2019-10-24 16:35:10 -04:00
Branko Arnaudovski
efbb108061 Implement Moderators audit logs (#3449) 2019-10-23 10:30:45 -04:00
rhymes
e461f0d799 Routine rubocop fixes after gem update (#4309)
* Regenerate rubocop todo

* Fix outstanding problems

* Fix Style/FormatStringToken

* Final update to rubocop todo file

* Set RSpec/ExampleLength to max 10 and regenerate todo file
2019-10-10 17:27:01 -04:00
Allan Klaus
4402cc212c Create tests to PingAdmins (#4169) [ci skip] 2019-10-03 11:18:53 -04:00
rhymes
178e752239 Require rubyzip (#4141) 2019-09-30 10:41:58 -04:00
rhymes
280f314123 Update rubyzip to 1.3.0 to fix vulnerability (#4133) 2019-09-30 09:58:41 -04:00
Anna Buianova
9778ada44a Doorkeeper default scope (#4066)
* Start with the doorkeeper scopes

* Added read_articles scope

* Proper doorkeeper authorization for the API articles#me
2019-09-24 11:11:12 -07:00
rhymes
c8abbe9d60 Pro: memberships (#3461)
* Add ProMembership model

* Implement ProMembershipsController#create

* Implement basic ProMembershipsController#show

* Add ProMembership to ledger

* Populate user history after pro subscription is created

* Add fields for expiration notifications

* Add ProMemberships::ExpirationNotifier to notify users of expiring memberships

* Add tasks for recurring jobs to notify users of expiration

* Add auto_recharge column to ProMembership

* Add ProMemberships::Biller (incomplete)

* Fix specs

* Add ProMembership to Administrate

* Fix spec

* Add has_enough_credits? to User and Organization

* Add Payments::Customer class

* Finish ProMembership::Biller functionality

* Fix ProMemberships::Creator check for credits

* Disable destroy actions for ProMembershipsController

* Correctly authenticate ProMembershipsController actions

* Make sure only pro user's history can be indexed

* Add ProMembershipsController#update action for auto recharge

* Use regular AR to save new credits and add touch to the purchaser

* Clarify Pro membership create policy

* Display information about an existing pro membership

* Add UI to show page

* Add system test for Pro membership creation

* Implement edit membership

* Make sure users with pro memberships can access history and dashboard pro

* Fix padding issue

* Show a different text for a user that has credits but not enough for Pro

* Move Pro Membership functionality inside settings

* Update Pro Membership link in email notifications

* Bust all relevant caches

* Add the Pro checkmark around the website

* Use Users::ResaveArticlesJob instead of delay

* Add/remove user from pro-members chat channel

* Use the appropriate Pro checkmark

* Remove unfinished pro elements

* Remove checkmark JS
2019-09-24 10:38:54 -07:00
Mac Siri
6fa8dfd7aa Ignore page_views (#4063) 2019-09-19 09:06:14 -07:00
Anna Buianova
c07eb8d9cd Define Doorkeeper::Application association (#4065) [ci skip] 2019-09-19 10:28:55 -04:00
Mac Siri
3b32b29937 Update core API endpoints to support access_token (#3644)
* Update specs for doorkeeper test

* Add bang

* Create #authenticate

* Create /api/articles/ endpoint

* Update specs

* Update me.json.jbuilder

* Fix typo and spacing

* Support pagination for #me

* Update #authenticate! to support cookies

* Make per_page a param

* Disable method-complexity check

* Enable refresh_token

* Create /api/users/me endpoint
2019-08-08 15:55:23 -03:00
rhymes
fea8ad1e87 Hash OAuth2 access tokens (#3596) 2019-08-01 11:05:57 -04:00
Mac Siri
fc9272fe71 Make Doorkeeper inherit from ApplicationController (#3591)
* Resolve doorkeeper issue

* Refactor spec

* Remove comment
2019-07-31 18:41:44 -04:00
Mac Siri
3071ac8c76 Implement Doorkeeper gem (#3504)
* Add doorkeeper gem

* Generate files with Doorkeeper's generator

* Create Doorkeeper tables

* Add new associations to User

* Update associations

* Remove confusing schemas

* Change oauth2_provider name
2019-07-31 10:30:58 -04:00
Ali Spittel
52c60ce37e Feature/refactored onboarding (#3333)
* set up refactored onboarding

* create onboarding page

* add in first slide and change slide functionality

* fix test suite

* profile refactor

* profile refactor

* refactor to api

* add checkbox fields

* add checkbox fields

* remove puts

* add basic css

* add styling

* add redirect

* hide back and next at first and last slides

* test refactored onboarding

* test refactored onboarding

* remove article edits

* Fix schema

* Add deleted file back in

* Add default value for checked_t&c column

* Adjust HTML structure to keep nav buttons in place

* Fix ESLint issues on Onboarding.jsx file

* Handling for undefined or empty followedTags on getUserTags

* Fix codeclimate issues

* Fix codeclimate issues

* Fix more codeclimate issues

* Fix more codeclimate issues

* Update Onboarding snapshots

* Uncheck the CoC and T&C checkboxes on render

* Update snapshots

* Return false instead of raising error

* Update spec to use new onboarding

* Redirect to onboarding if haven't seen it yet

* Prevent redirect to onboarding from /signout_confirm

* Use assign_attributes instead of saving twice

* Move COC and T&C checkbox page to second slide

* Add 'go back to original page' functionality

* Reuse ready prototype logic

* Keep track of the last visited onboarding page

* Fix email subscription bug

* Fix overflow issue for tags page

* Remove height to prevent page container scrolling

* Check for CoC and T&C for displaying onboarding

* Add InstantClick redirect and preserve referrer in client

* Fix async update + check by using localStorage

* Turn off onboarding for tests

* Finalize design for onboarding

* Finalize design for onboarding

* Make bulk follows during onboarding

* Fix bulk follow test
2019-07-26 15:53:32 -04:00
Kitten King
6290451273 Fix Typos (#3510) 2019-07-22 12:56:48 -04:00
Andy Zhao
22e76bee84 Add functionality to remove and recover identity (#3377)
* Lint some quotation marks

* Add BackupData table

* Add identity and removal functionality

* Test additional functionality

* Remove dependent destroy for backup data

* Add auth_data_dump column

* Add challenge to reserved words

* Add more shoulda matchers
2019-07-03 12:01:16 -04:00
Jess Lee
10674aed72 Buffer Listings (#2956)
* add share to buffer button

* wip

* wip

* adds listings to buffer via form

* create migration for buffered timestamp and update seed file

* display when listing was last buffered

* remove annoying spacing

* refactor article script for listings

* social preview wip

* add custom social card for indivdual listings

* add styling

* fix css

* tweak styling

* final css tweaks

* fix branch

* add buffer listings id

* update envfile

* add social previews spec
2019-06-14 19:33:19 -04:00
Andy Zhao
b953f17d0c New Feature: Subscribe to posts! (#3149)
* Add MVP of notification subscriptions

* Add rate limiting for notification subscriptions

* Show modal for logged out users on subscribe click

* Add enter key functionality for checkbox

* Add relationships for notification subscriptions

* Add model test for notification subscription

* Deprecated article mutes in favor of notification subscriptions

* Deprecated comment mutes in favor of notification subscriptions

* Move comment muting tests and logic over

* Merge comment and article muting into subscriptions

* Remove redundant check

* Use database to check for rate limit instead of cache

* Test for subscriptions handling notifications properly

* Fix notification model spec for subscriptions

* Fix tests for subscriptions

* Remove rate limiting

* Properly handle logged out users getting subscription status

* Fix test for new pattern

* Update reserved words

* Add config column to notification subscriptions

* Add logic for top level config and move tests

* Test for top level subscribers getting notified

* Fix logic mistake oops

* Add index and refactor comment_user_ids
2019-06-14 12:03:43 -04:00
Mac Siri
1ea1a30ca7
Remove js-yaml.js (#3054) 2019-06-05 21:27:39 -04:00
Ben Halpern
df44cbd254
Change design of main feed CTA and remove from tag pages (#3050)
* Change design of main feed CTA and remove from tag pages (to prevent complexity)

* Lock Chromedriver to 74.0.3729.6

* Fix tests and modify reserved words (tack on)

* Removed less useful shared examples from rspec

* Remove references to file that no longer exists in test

* Remove unneeded tests
2019-06-05 14:33:22 -04:00
dependabot[bot]
5890542f01 Bump pusher-push-notifications from 1.0.0 to 1.1.0 (#1880) [ci skip] 2019-05-01 17:22:19 -04:00
rhymes
50ed146515 Use only fog-aws with carrierwave instead of fog (#2569)
Currently dev.to is including the entire fog library just to support image uploads to AWS S3. carrierwave can be used just with fog-aws.
I preserved the same exact version is currently used now.
2019-04-30 15:22:01 -04:00
rhymes
2bf3e38a73 Fix double AWS_LAMBDA initialization (#2570) 2019-04-26 11:15:18 -04:00
Anna Buianova
d57f8eec4a BlackBox specs #2524 (#2542)
* Specs for FuctionCaller

* Fix accepting nil values from AWS lambda

* Specs for the black_box #2524

* Spec for BlackBox#comment_quality_score

* Remove vcr cassette usage from the CouponGenerator spec
2019-04-25 10:19:11 -04:00
Ben Halpern
78138532c8
Classified Listings (#2545)
* Initial classified listings work

* More work on tags

* Additional work finalizing stripe and getting the listings page along

* Finalize-ish listings 🤞
2019-04-24 16:17:01 -04:00
rhymes
d2fbd243c3 Upgrade airbrake to 9.1.0 (#2526) 2019-04-24 11:41:16 -04:00
rhymes
5057584458 Upgrade ahoy_email to 1.0.3 (#2534) 2019-04-23 16:32:14 -04:00
rhymes
f17d0f34e1 Update framework defaults to match those in Rails 5.1 (#2309)
* Enable all Rails 5.0 defaults, except for CSRF mitigations

* Enable all Rails 5.1 defaults

* Enable per_form_csrf_tokens

* Enable forgery_protection_origin_check

* Avoid replacing the CSRF in the comment form

Each form now has its own CSRF in addition to the global one.
I've left in place the setInterval

* Restore per_form_csrf_tokens to false
2019-04-17 12:21:15 -04:00
Mario See
c6ee9fe3b4 Add Console message ascii art (#2392) [ci skip] 2019-04-16 16:47:27 -04:00
rhymes
bf33490b04 Removed csv_shaper, bourbon and share_meow_client (#2450)
None of these gems seems to be in usage
2019-04-15 12:05:08 -04:00
Andy Zhao
8ef611f879 Remove Honeycomb from the app (#2366)
* Remove Honeycomb related gems

* Remove Honeycomb related code from controllers

* Remove Honeycomb from RSS Reader

* Remove Honeycomb related files

* Remove Honeycomb related tests

* Remove leftover Honeycomb methods
2019-04-11 10:49:35 -04:00
cyrillefr
4fd66372dc Enable Layout/AlignParameters (#2340)
Check if the parameters on a multi-line method call or definition are aligned.

Resolves: #2021
2019-04-08 18:47:34 -04:00
rhymes
3b4bda89df Upgrade Honeycomb gem, fix and improve RssReader tests (#2319)
* Switch from deprecated honeycomb-rails to honeycomb-beeline

* Improve error handling, tests and add refactoring

* Fix multiple fetching test and add one more

The test wasn't actually testing the correct behavior, because the class
by default force fetches. It worked because it wasn't reloading the user
from the database.

* Test that Honeycomb's client is doing its thing

* Use some defensive programming to avoid any possible problem during shutdown

* Fix typo

* Use the new API to add fields to the current measured event

* Use default instrumentation and add user info to event

* Replace user.email with user.username, less personal data around

* Use mocking instead of calling Honeycomb.init

* Freeze time before traveling

* Remove a flaky test dependent on rand
2019-04-07 15:27:53 -04:00
rhymes
a1787d0702 Fixed some Style/* rubocop violations (#2314)
* Fix Style/FormatString and Style/TrivialAccessors

* Fix Style/NegatedIf and Style/DoubleNegation

* Style/ClassAndModuleChildren is already enabled by default

* Fix Style/GlobalVars

* Group all style/ cops inside rubocop config file
2019-04-06 14:24:33 -04:00
rhymes
3a53d5797e Upgrade Rails to 5.2.3 (#1408) 2019-04-03 13:08:59 -04:00
Ben Halpern
c90be27677
Ignore unnecessary airbrake notices (#2283) 2019-04-01 17:40:50 -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
Keshav Biswa
8d57d45ecc Rubocop Style cops enabled (#2056)
* Rubocop enabled style/alias

* Enabled Style/ArrayJoin Cop

* Enabled Style/Attr

* Enabled Case Equality

* Enabled CharacterLiteral

*  Enabled ColonMethodCall Cop

* Enabled CommentAnnotation cop

* Enabled PreferredHashMethods Cop

*  Enabled DoubleNegation Cop

* Enabled EachWithObject Cop

* Enabled EmptyLiteral Cop

* Enabled EvenOdd Cop

* Enabled IfWithSemicolon Cop

* Enabled Lambda and LambdaCall Cop

* Enabled LineEndConcatenation Cop

* Enabled ModuleFunction Cop;

* Enable NegatedIf and NegatedWhile Cop

* Enabled NilComparison Cop

* Enabled Not Cop

* Enabled NumericLiterals Cop

* Enabled OneLineConditional Cop

* Enabled PercentLiteralDelimiters Cop

* Excluded internal/users_controller from negated_if cop

* Reverted the double negation change from github_issue_tag and github_issue.rb"

* Enabled PerlBackrefs Cop

* Changed Regexp.last_match(1) to Regexp.last_match(0)

* Enabled proc cop

* Enabled RaiseArgs Cop

* Reverted Regexp.last_match(0) to Regexp.last_match(1)

* Enabled SelfAssignment Cop

* Enabled SingleLineMethods Cop

* Enabled SpecialGlobalVars Cop

* Enabled VariableInterpolation Cop

* Enabled WhenThen Cop

* Enabled WhileUntilModifier Cop

* Enabled WordArray Cop

* Enabled IfUnlessModifier Cop

* Enabled GuardClause Cop
2019-03-15 18:33:54 -04:00
Anna Buianova
58b2013377 Fix delayed job errors related to follows #1621 (#1835)
* Add delayed_job_web to dev environment for debugging

* Add specs for the current Follow callbacks implementation

* Move follower touching to ActiveJob

* Spec for the touch followers job

* Move Follow#create_chat_channel to ActiveJob and make the job safe

* Add ActiveJob to send email notifications about follows

* Enqueue SendEmailNotificationJob after the follow is created

* Specs to wnsure jobs are enqueued on Follow creation

* Make CreateChatChannelJob queue name more specific
2019-02-23 18:16:20 -08:00
Jess Lee
49e3878239 Add Stripe Cancellation Webhook (#1682) 2019-02-13 15:56:19 -05:00
Mac Siri
1137d6fba4 Improve specs (#1693)
* Lock erb_lint

* Refactor moderation spec

* Remove & replace RequestSpecHelper

* Update uid to sequence

* Lower the need for persistence in specs

* Update moderation spec

* Update shoulda-matchers

* Enable backgroundjobs and update commenct spec

* Fix fail specs

* Update comment's validations

* Remove redundent specs

* Actually turn off DJ

* Apply run_background_jobs_immediately

* Remove giveawy specs

* Create Identity spec
2019-02-04 15:56:00 -04:00