Commit graph

8859 commits

Author SHA1 Message Date
Alex
de23d3ec8a
Add indexes to comments (#13476) 2021-04-22 15:37:46 -05:00
Nick Taylor
3483d69667
Lint script does not need to be a pre test script. (#13477) 2021-04-22 16:02:49 -04:00
rhymes
0cf99fd683
Use a manual query to find users by their names and usernames (#13474)
* Use a manual query to find users by their names and usernames

* Remove spec for accented names

* Remove superflous comment
2021-04-22 19:46:43 +02:00
Suzanne Aitchison
3ec91dd936
re-enable a cypress test, removing use of aliases (#13412)
* re-enable test

* specifically target the option rather than text in the dropdown

* remove use of aliases from flakey test

* trigger travis

* trigger travis

* focus option before clicking

* add comment, remove other aliases for textareas
2021-04-22 18:15:36 +02:00
dependabot[bot]
29dcea3750
Bump rubocop-performance from 1.10.2 to 1.11.0 (#13471)
* Bump rubocop-performance from 1.10.2 to 1.11.0

Bumps [rubocop-performance](https://github.com/rubocop/rubocop-performance) from 1.10.2 to 1.11.0.
- [Release notes](https://github.com/rubocop/rubocop-performance/releases)
- [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-performance/compare/v1.10.2...v1.11.0)

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

* Enable new cops and fix violations

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rhymes <rhymes@hey.com>
2021-04-22 09:31:25 -05:00
Alex
447a8ab908
Add tsvector index to comments.body_markdown (#13469)
* Add tsvector index to comments.body_markdown

* Users --> Comments
2021-04-22 10:31:05 -04:00
Daniel Uber
7c9a23fde2
re-enable skipped tests (#13456)
* re-enable skipped tests

reverts the changes in #13013

* Retrigger CI

* Retrigger CI
2021-04-22 09:28:33 -05:00
Daniel Uber
3e432c9047
When busting user cache, also clear the api response (#13465)
* When busting user cache, also clear the api response

This should fix #13293 by clearing both the UI copy and the api copy of the
user's page.

* Update spec to include the api path
2021-04-22 09:16:15 -05:00
dependabot[bot]
cd3e028f8b
Bump bootsnap from 1.7.3 to 1.7.4 (#13472)
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.7.3 to 1.7.4.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.7.3...v1.7.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-22 12:27:08 +02:00
Fernando Valverde
e602d50d32
Push Notification multi app support (#13304)
* PushNotificationTarget model + /admin/push_notifications (index)

* Admin panel CRUD + request tests

* Migrate Redis backed Rpush model responsibilities into PushNotificationTarget

* Fix failing specs

* Fix conflicts + clean up test by using constant reference

* Removed unused policy

* policy + services + misc feedback

* PushNotificationTarget refactored to AppIntegration

* Review feedback

* Some small cleanup

* Refactor AppIntegration -> ConsumerApp

* Fixing specs

* Trigger Travis

* More naming refactor changes

* Refactor services into queries

* Revert to where(...).first, fix typo and tests

* Apply suggestions from code review

Co-authored-by: rhymes <rhymes@hey.com>

* PR review feedback - create_or_find_by, validations, renaming + more tests

* Fix aria-label text

* Remove unnecessary individual index - composite index will do

Co-authored-by: rhymes <rhymes@hey.com>
2021-04-21 17:13:01 -06:00
Jacob Herrington
5afb4d9a24
[15-Minute Fix] Refactor code smells (#13347)
* Remove duplicate method calls

* DRY up duplicated code

* Address code smells in concerns

* Update based on PR feedback
2021-04-21 14:52:32 -05:00
dependabot[bot]
b0085570f7
Bump rubocop from 1.12.1 to 1.13.0 (#13458)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.12.1 to 1.13.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.12.1...v1.13.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-21 20:23:25 +02:00
dependabot[bot]
c54fd590f3
Bump knapsack_pro from 2.14.0 to 2.15.0 (#13460)
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 2.14.0 to 2.15.0.
- [Release notes](https://github.com/KnapsackPro/knapsack_pro-ruby/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v2.14.0...v2.15.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-21 19:16:46 +02:00
rhymes
1fd38aa172
[Search 2.0] Allow mention autocomplete to search users names (#13462)
* Add tsvector index on users.name

* [Search 2.0] Allow mention autocomplete to search users names
2021-04-21 18:47:15 +02:00
Daniel Uber
a615105653
Bust cache after commit, rather than after save (#13455)
There's a (tiny) race condition where if an enclosing transaction
has not yet been committed when a user is created, and a sidekiq
worker begins find(:id) and fails, that the job is enqueued, started,
and skipped.

This changes the after_save hook on User to after_commit, ensuring the
user's assigned id is visible to other processes.
2021-04-21 10:54:19 -05:00
Nick Taylor
8016a33dd2
[15 minute fix] Added a timeout before continuing if a dev does not respond to rebuild the E2E DB (#13461) 2021-04-21 09:14:38 -04:00
rhymes
14d98fc590
[Search 2.0] Homepage query (#13339)
* Added basic homepage query object

* Add serializers and initial service object

* Add flare tags, select only required columns

* Test default Homepage::FetchArticles behind a feature flag

* Add all needed params for the homepage feeds

* Add Homepage::ArticlesQuery specs

* Add Homepage::FetchTagFlares specs

* Add Homepage::FetchArticles specs

* Add approved filter to Homepage::ArticlesQuery

* Add specs for SearchController

* Addressed feedback

* Apply PR feedback to cleanup SearchController#feed_content

* Update app/services/homepage/fetch_tag_flares.rb

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* Update spec/queries/homepage/articles_query_spec.rb

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* Update spec/queries/homepage/articles_query_spec.rb

Co-authored-by: Jamie Gaskins <jamie@forem.com>

* Apply PR feedback

* Modify travis

* Revert "Modify travis"

This reverts commit b42548e866804af69542602556db47d37a31034e.

Co-authored-by: Jamie Gaskins <jamie@forem.com>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2021-04-21 12:41:24 +02:00
dependabot[bot]
08c9c00c77
Bump ddtrace from 0.47.0 to 0.48.0 (#13450)
Bumps [ddtrace](https://github.com/DataDog/dd-trace-rb) from 0.47.0 to 0.48.0.
- [Release notes](https://github.com/DataDog/dd-trace-rb/releases)
- [Changelog](https://github.com/DataDog/dd-trace-rb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dd-trace-rb/compare/v0.47.0...v0.48.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-21 09:34:56 +07:00
Alex
cf0baf05f9
[Search 2.0] Comments on search page (#13401)
* Working MVP

* Add comment to COMMENTABLE_TYPES

* Add specs to search_spec

* Add service specs and fix ordering

* Fixed queries and specs

* Clarify COMMENTABLE_TYPES comment

* Move FORCED_EAGER_LOAD_QUERY to Comment

* Add highlighting to Comment search

* Add explicit .to_s on class_name params

* Remove Comment#forced_eager_load_serialized_data

* Revert CommentSerializer changes

* Hardcode class_name attribute

* Add PR feedback

* Use one liner syntax in serializer

* Update user comment

* Update path attribute logic

* Fix user_ids

* Remove PodcastEpisode skipped spec

* Add sort order to Search::Postgres::Comment

* Fix search_specs

* Move pagination TODO comment
2021-04-20 12:34:21 -04:00
Jamie Gaskins
589f3066ff
Revert "Bump dogstatsd-ruby from 4.8.3 to 5.0.1 (#13352)" (#13454)
This reverts commit ba54a8cf08.
2021-04-20 11:27:14 -04:00
dependabot[bot]
ba54a8cf08
Bump dogstatsd-ruby from 4.8.3 to 5.0.1 (#13352)
Bumps [dogstatsd-ruby](https://github.com/DataDog/dogstatsd-ruby) from 4.8.3 to 5.0.1.
- [Release notes](https://github.com/DataDog/dogstatsd-ruby/releases)
- [Changelog](https://github.com/DataDog/dogstatsd-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/DataDog/dogstatsd-ruby/compare/v4.8.3...v5.0.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-20 09:52:46 -04:00
dependabot[bot]
3337a796d7
Bump devise_invitable from 2.0.3 to 2.0.5 (#13449)
Bumps [devise_invitable](https://github.com/scambra/devise_invitable) from 2.0.3 to 2.0.5.
- [Release notes](https://github.com/scambra/devise_invitable/releases)
- [Changelog](https://github.com/scambra/devise_invitable/blob/master/CHANGELOG.md)
- [Commits](https://github.com/scambra/devise_invitable/compare/v2.0.3...v2.0.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-20 08:34:44 -05:00
Michael Kohl
28dd50e718
Create settings model for rate limits (#13381)
Co-authored-by: rhymes <rhymes@hey.com>
2021-04-20 11:29:22 +07:00
Daniel Uber
2f1dad4e37
Add reading_time to articles api responses (#13446)
* Add reading_time to articles api responses

Fixes #13436

* Update api docs to match changes to the articles response

* Follow up docs updates

- increment api docs version
- add reading_time to articles/me responses
- add reading time to the show response example format

* Change reading_time attribute to reading_time_minutes

Update the article builder to use `article.reading_time` and present
it as `"reading_time_minutes"`.

Update the api spec to expect the new property name instead of the attribute.

* Update api documentation to reflect the new name

- Change reading_time -> reading_time_minutes.
- I decided to keep the (possibly redundant) description text here.
2021-04-19 17:11:55 -05:00
Anna Buianova
ba1c13bbb6
Asynchronous organization delete (#13388)
* Asynchronous organization destroy

* Notification after an organization was deleted

* Send data to Datadog and Honeybadger when org deletion failed

* Delete unused code

* Fixed Organization#destroyable? and organization delete specs

* Reorganized organization deletion specs

* Removed redundant specs

* Improved org deleted email text template

* Don't peform the org delete when a user or an org were not found

* Renamed user_id in the org delete worker

* Audit logging when deleten an organization

* Removed specs for tracking pixel and UTM params

* Changed slug for audit log on org delete

* Fixed schema.rb
2021-04-19 18:30:35 +03:00
dependabot[bot]
3dc8a386d2
Bump ancestry from 3.2.1 to 4.0.0 (#13370)
Bumps [ancestry](https://github.com/stefankroes/ancestry) from 3.2.1 to 4.0.0.
- [Release notes](https://github.com/stefankroes/ancestry/releases)
- [Changelog](https://github.com/stefankroes/ancestry/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stefankroes/ancestry/compare/v3.2.1...v4.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-19 10:04:30 -05:00
Andy Zhao
d5a55c0a3e
Add missing class back in for signed out featured post on feed (#13445)
* Add missing class back in

* Fix tests
2021-04-19 11:00:50 -04:00
dependabot[bot]
887c490db7
Bump sidekiq-unique-jobs from 7.0.7 to 7.0.8 (#13404)
Bumps [sidekiq-unique-jobs](https://github.com/mhenrixon/sidekiq-unique-jobs) from 7.0.7 to 7.0.8.
- [Release notes](https://github.com/mhenrixon/sidekiq-unique-jobs/releases)
- [Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.0.7...v7.0.8)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-19 10:00:37 -05:00
Josh Puetz
c3174cade8
Push Notification stats instrumentation (#13118) 2021-04-19 09:42:01 -05:00
Fernando Valverde
1d1771eb97
[15min fix] Return Device ID upon registration (#13427)
* Return Device ID upon registration

* Update app/controllers/devices_controller.rb

Co-authored-by: rhymes <rhymes@hey.com>

* Add check for status code in spec

Co-authored-by: rhymes <rhymes@hey.com>
2021-04-19 08:32:57 -06:00
rhymes
f5691dbb5e
[15 min fix] Document data update scripts best practices (#13432)
* Add data update scripts best practices

* Remove leftover counter
2021-04-19 16:11:10 +02:00
Michael Kohl
9d270fda16
Re-add Email digest frequency to admin config (#13437) 2021-04-19 13:45:59 +00:00
dependabot[bot]
92d8bfe31a
Bump chart.js from 3.1.0 to 3.1.1 (#13441)
Bumps [chart.js](https://github.com/chartjs/Chart.js) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/chartjs/Chart.js/releases)
- [Commits](https://github.com/chartjs/Chart.js/compare/v3.1.0...v3.1.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-19 14:04:25 +02:00
rhymes
3f9a91c638
Dependabot: change npm schedule to weekly (#13442) 2021-04-19 13:01:25 +02:00
dependabot[bot]
47fbb72f39
Bump sass from 1.32.8 to 1.32.10 (#13440) 2021-04-19 06:12:41 -04:00
dependabot[bot]
2a8e823c8f
Bump @testing-library/user-event from 13.1.3 to 13.1.4 (#13439)
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 13.1.3 to 13.1.4.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/master/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v13.1.3...v13.1.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-19 10:03:19 +01:00
Michael Kohl
a86c178fe0
Split Settings::Campaign from SiteConfig (#13238) 2021-04-19 10:01:03 +07:00
dependabot[bot]
daad36d708
Bump css-loader from 5.2.1 to 5.2.2 (#13431)
Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 5.2.1 to 5.2.2.
- [Release notes](https://github.com/webpack-contrib/css-loader/releases)
- [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/css-loader/compare/v5.2.1...v5.2.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-17 18:07:37 +02:00
dependabot[bot]
032e893e61
Bump knapsack_pro from 2.13.0 to 2.14.0 (#13421)
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 2.13.0 to 2.14.0.
- [Release notes](https://github.com/KnapsackPro/knapsack_pro-ruby/releases)
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v2.13.0...v2.14.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-16 15:39:30 -04:00
rhymes
05c220619f
[15 min fix] Enforce an upper limit for articles.body_markdown (#13418)
* Enforce a length limit for articles.body_markdown

* Fix spec assertion

* Add bytesize validation to body_markdown
2021-04-16 20:20:11 +02:00
Josh Puetz
9fe7be190b
Switch references to Forem master branch to main (#12325) 2021-04-16 11:51:06 -05:00
Daniel Uber
c842d1a0c6
Rename table_exists? to table_available? to indicate behavior (#13426)
We added a check for ConnectionNotEstablished, which causes the check
to return false if there is no database available (the case in
buildkite for rake tasks like assets:precompile), this changed the
implementation from an existence check (I can connect to the database,
but the table is not present, the situation when we have created a db,
but not yet populated the schema) to an availability check (either the
db is live but the table is absent, or the db is absent, in either
case we know we can't read from the table yet).

Change table_exists? to table_available? to indicate the new
behavior and update the two call sites.
2021-04-16 09:53:01 -05:00
dependabot[bot]
93091b925a
Bump oj from 3.11.4 to 3.11.5 (#13423)
Bumps [oj](https://github.com/ohler55/oj) from 3.11.4 to 3.11.5.
- [Release notes](https://github.com/ohler55/oj/releases)
- [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/ohler55/oj/compare/v3.11.4...v3.11.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-16 09:24:07 -05:00
Suzanne Aitchison
65d0183a47
fix accessible name of listings on dashboard (#13424) 2021-04-16 14:46:46 +01:00
dependabot[bot]
6af56585f7
Bump eslint-config-prettier from 8.1.0 to 8.2.0 (#13416)
Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 8.1.0 to 8.2.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/eslint-config-prettier/compare/v8.1.0...v8.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-16 10:38:51 +01:00
dependabot[bot]
fbeda5a4ff
Bump ibm-openapi-validator from 0.40.1 to 0.42.0 (#13411)
Bumps [ibm-openapi-validator](https://github.com/IBM/openapi-validator) from 0.40.1 to 0.42.0.
- [Release notes](https://github.com/IBM/openapi-validator/releases)
- [Changelog](https://github.com/IBM/openapi-validator/blob/main/CHANGELOG.md)
- [Commits](https://github.com/IBM/openapi-validator/compare/v0.40.1...v0.42.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-16 09:56:13 +01:00
dependabot[bot]
3692fdff85
Bump @testing-library/cypress from 7.0.5 to 7.0.6 (#13422)
Bumps [@testing-library/cypress](https://github.com/kentcdodds/cypress-testing-library) from 7.0.5 to 7.0.6.
- [Release notes](https://github.com/kentcdodds/cypress-testing-library/releases)
- [Changelog](https://github.com/testing-library/cypress-testing-library/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kentcdodds/cypress-testing-library/compare/v7.0.5...v7.0.6)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-16 09:27:09 +01:00
rhymes
456fecc043
Make sure columns in the schema file stay alphabetized after bin/setup (#13410) 2021-04-15 19:28:52 +02:00
Fernando Valverde
db7abbdf7b
Add x86_64-darwin-20 to PLATFORMS in Gemfile.lock (#13413) 2021-04-15 10:15:58 -06:00
Daniel Uber
a14adaa689
When there is no connection, answer false (#13417)
When building containers, when there is no postgresql instance, this
check to AR::Base.connection is raising an error. We'd like to be able
to continue running `rake assets:precompile` without needing a live db
to check the schema for a table.

Handle connection errors as though they were a table missing.
2021-04-15 10:50:45 -05:00