Commit graph

26 commits

Author SHA1 Message Date
rhymes
cbc461a850
Refactor RssReader and Feeds::Import common parts: take 1 (#11412)
* Extract Feeds::CheckMediumReplyItem service

* Extract Feeds::CheckItemPreviouslyImported

* Clarified comment on Feeds::CheckItemMediumReply (thanks @maestromac)

* Refactor a bit to be more Rubeyeyey
2020-11-18 14:17:53 +01:00
Molly Struve
b23374e737
[deploy] Revert "Refactor:Move RssReader Fetch Article task to Sidekiq (#9976)" (#9998) 2020-08-25 14:57:33 -05:00
Molly Struve
ff06454151
[deploy] Refactor:Move RssReader Fetch Article task to Sidekiq (#9976) 2020-08-25 13:47:13 -05:00
rhymes
085c60992b
Rubocop: Enable and fix Style/OptionalBooleanParameter cop (#9711)
* Enable and fix Style/OptionalBooleanParameter cop

* Keep regular parameters for workers

* Keep regular parameters for workers

* Fix spec

* Trigger Travis correctly
2020-08-10 19:35:55 +02:00
Molly Struve
e03f337c9c
Refactor: Send RSS Reader and Payment Errors to Honeybadger (#9209)
* Refactor: Send RSS Reader and Payment Errors to Honeybadger

* remove old VCR cassettes
2020-07-09 08:48:52 +02:00
Michael Kohl
e25936ff57
Fix RSS import (#8877)
* FIx RSS import part 1

* Add spec for medium.com/feed/@dvirsegal

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-06-24 10:51:07 -04:00
Molly Struve
e3e3e2c386
[deploy] Bug Fix: Return An Empty Array if Error Occurs in RSS Reader (#8864) 2020-06-23 14:28:43 -05:00
rhymes
300ba1b33f
[deploy] Decouple Twitter authentication from fetching tweets (#7920)
* Add TwitterClient::Client

* Use TwitterClient::Client for Tweet

* Test retweets

* Test assignment to user

* Fix TweetTag spec

* Remove TwitterBot

* Fix some specs

* Fix RSS Reader specs
2020-05-19 18:05:41 -04:00
rhymes
decae056f1
Routine rubocop fixes (#7885) 2020-05-18 10:27:51 +02:00
rhymes
f2b0be2043
Add Slack messengers: part 2 (#6916)
* Add Slack::Messengers::ArticlePublished

* Add Slack::Messengers::ReactionVomit

* Add Slack::Messengers::CommentUserWarned

* Add missing URL helpers

* Add Slack::Messengers::ArticleFetchedFeed

* Remove callback condition

* Build, don't create
2020-04-03 17:00:06 +02:00
Alex
8cc791150c Move SlackBotPingJob to Sidekiq (#5615) 2020-01-22 08:24:33 -05:00
Mac Siri
dd391d5e34
Validates Article's published_at (#4140) 2019-10-01 15:57:36 -04:00
dependabot-preview[bot]
653b74b39b Bump feedjira from 2.2.0 to 3.0.0 (#3560)
* Bump feedjira from 2.2.0 to 3.0.0

Bumps [feedjira](https://github.com/feedjira/feedjira) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/feedjira/feedjira/releases)
- [Changelog](https://github.com/feedjira/feedjira/blob/master/CHANGELOG.md)
- [Commits](https://github.com/feedjira/feedjira/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Update Feedjira's usage of parse
2019-07-30 10:10:56 -04:00
Anna Buianova
18d1300341 Moved SlackBot.delay.ping calls to ActiveJob #3136 (#3139)
* Moved SlackBot.delay.ping calls to ActiveJob

* Removed unused user creation from the spec
2019-06-12 09:23:37 -04:00
Andy Zhao
47d9ec27fb Allow users to belong to multiple orgs (#2583)
* Allow user to have many orgs

* Allow users to handle multi orgs in settings

* Make rounded buttons inline

* Add multi org function to dashboards

* Fix merge conflicts

* Fix mistake in merge conflict fix oops

* Display the correct membership level

* Fix accessibility issues

* Display organizations for article editors

* Handle submitting org id with preact editors

* Make listings work with multiple organizations

* Allow listings to have multiple orgs on create

* Display the correct number of credits for each org

* Move script tag to Webpack

* Allow multi orgs for purchasing and viewing credits

* Use OrganizationMembership as authorization check

* Display multiple organizations for notifications

* Allow dashboard to be viewable under multi-orgs

* Remove unused method

* Add multi-org functionality for article editors

* Show pro dashboard buttons for member+ org levels

* Leave the correct organization

* Allow article API to change org id

* Add left-out authorization method oops

* Make nav buttons a bit more clear

* Fix merge conflict

* Fix adding org id for /api/articles and tests

* Fix tests for org policy

* Use proper logic for displaying org members

* Update org actions with new authorization

* Use correct org when creating a listing

* Remove additional payment charge oops

* Mark org notifications as read with authorization

* Remove deprecated post_as_organization attribute

* Use new org_admin syntax

* Remove deprecated org logic for article create and update

* Default all RSS posts to not belong to any org

* Render org_member page for guest users

* Update org policy spec to work with multi orgs

* Use org_membership for org traits and move identity code

* Use org_member trait

* Update to work with multi-orgs

* Validate article's org_id if param org_id is blank

* Make  a let variable

* Remove unnecessary eager load for credits

* Fix HTML structure and org logic for non-org users

* Update credits spec for multi-org

* Add test for failed payment when purchased by org

* Lint listings_spec

* Test that the listing was created under the user

* Add tests for POST /listings multi-org

* Use double quotes for classes

* Fix /manage and a few other multi-org bugs

* Fix test for multi org

* Use correct method SQL exists? not Rails exist?

* Fix reads spec for multi-org

* Fix org_controller actions to work with multi org

* Test only multi org and not old usage and fix leave_org

* Fix org showing user profile img test for multi-org

* Fix org logic for users with no orgs

* Remove switch org functionality

* Update tests and add hidden param for org id

* Redirect to the specific organization

* Test other org button actions

* Use settings_notice instead of legacy notice and refactor

* Fix weird extra end issue prob from merge conflicts

* Test for with new flash key

* Fix user_views_org tests for multi-org

* Test for new flash message

* Update snapshot with new a11y html

* Move styling to stylesheet

* Add site admins functionality

* Move org_member? method in user model and refactor

* Use unspent_credits_count for organizations

* Add tests for /listings/new and minor bug fixes

* Use .present? in case of empty array

* Fix a lingering deprecated method

* Use greater than 1 for random numbers

* Add tests for counting spent and unspent credits
2019-06-04 09:30:52 -04:00
rhymes
a09bf20503 Remove unused attr_reader (#2376) [ci skip] 2019-04-11 12:47:15 -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
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
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
cyrillefr
a2fcbdc4a4 Enable performance rubocop cops (#2140) 2019-03-21 16:01:45 -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
Ben Halpern
9736d411d3
Fix get_all_articles in RssReader (#1566) 2019-01-15 22:25:30 -05:00
Ben Halpern
7f7a35048a
Find by title or feed source URL in rss fetch (#1560) 2019-01-15 15:34:13 -05:00
Ben Halpern
47e8fbc9ec
Add feed_fetched_at for users to not refetch unnecessarily (#1555)
* Fix RSS issues by not refetching users as often

* Make rss fetch not forced in rake task

* Remove unnecesary schema line
2019-01-15 13:29:11 -05:00
Mac Siri
f780e5fbc9 Refactor RssReader (#1537)
* Update RssReader::get_all_articles

* Move RssReader to services

* Create RssReader::Assembler

* Improve RssReader's spec
2019-01-14 14:25:49 -05:00
Renamed from app/labor/rss_reader.rb (Browse further)