Commit graph

10773 commits

Author SHA1 Message Date
Michael Kohl
60639bcb71
More ListingsToolkit refactoring (#16221) 2022-01-27 09:47:41 +07:00
Arit Amana
337657e53d
Implement Unified Embeds for Stackblitz URLs (#16313)
* building

* complete implementation and add specs

* handle params "?"

* changes

* optimization
2022-01-26 17:10:38 -05:00
Arit Amana
feebae6ae3
Implement Unified Embeds for Stackery URLs (#16320)
* complete implementation and add specs

* nudge Travis

* optimization
2022-01-26 16:19:27 -05:00
dependabot[bot]
355328cd4a
Bump rspec-rails from 5.0.2 to 5.1.0 (#16315)
Bumps [rspec-rails](https://github.com/rspec/rspec-rails) from 5.0.2 to 5.1.0.
- [Release notes](https://github.com/rspec/rspec-rails/releases)
- [Changelog](https://github.com/rspec/rspec-rails/blob/main/Changelog.md)
- [Commits](https://github.com/rspec/rspec-rails/compare/v5.0.2...v5.1.0)

---
updated-dependencies:
- dependency-name: rspec-rails
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 13:01:21 -07:00
dependabot[bot]
b8ee38a327
Bump hairtrigger from 0.2.24 to 0.2.25 (#16317)
Bumps [hairtrigger](https://github.com/jenseng/hair_trigger) from 0.2.24 to 0.2.25.
- [Release notes](https://github.com/jenseng/hair_trigger/releases)
- [Changelog](https://github.com/jenseng/hair_trigger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jenseng/hair_trigger/compare/v0.2.24...v0.2.25)

---
updated-dependencies:
- dependency-name: hairtrigger
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 11:26:52 -07:00
Anna Buianova
3fdb87ee66
Added "Tags" category to search results (#16265)
* Added tag search to nav menu

* Added tag search

* Improved tags search results view

* Removed commented lines from the controller

* Fix specs for Search::Tag

* Prepare for tags search pagination

* Fixed Search::Tag specs

* styling

Co-authored-by: Paweł Ludwiczak <ludwiczakpawel@gmail.com>
2022-01-26 20:51:15 +03:00
Mac Siri
46fb59c944
Refactor FastImage usage (#16304) 2022-01-26 09:48:03 -05:00
ludwiczakpawel
122cae6bfe
Improve reset.css to cover all inputs (#16296)
* fix

* buttons too

* buttons too
2022-01-26 14:34:08 +01:00
ludwiczakpawel
99c05982e5
fix (#16307) 2022-01-26 12:34:14 +01:00
Michael Kohl
38f7957e3a
Clear app cache during bin/setup (#16267) 2022-01-26 13:10:36 +07:00
dependabot[bot]
9a76d32bcd
Bump counter_culture from 3.1.0 to 3.2.0 (#16302)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-26 09:15:56 +07:00
Michael Kohl
67f68b1cc2
POC: use Sidekiq.perform_bulk for Github repos (#16293) 2022-01-26 09:11:07 +07:00
Daniel Uber
4b4d8a7234
Ensure arguments to perform_async are json safe (#16285)
* Convert symbol hash keys to strings when calling .perform_async

Fixes a warning from Sidekiq 6.4.0+ about perform_async arguments
which are not equal when passed to perform (`JSON.parse(JSON.dump(arg))`
should equal arg).

This is a safety measure to prevent passing objects (like classes, or
model instances) rather than their representations (like a class name,
or a model's attributes hash).

This warning will be an error in sidekiq 7

* Turn warning into an error in non-production environments

* Use string keys for reaction notification and article fetched

Missed these two on the first pass

* Update example argument hashes for #enqueues_on_correct_queue

Since this calls perform_async under the hood we need to pass json
safe hashes in the test cases as well.

https://github.com/forem/forem/blob/main/spec/workers/shared_examples/enqueues_on_correct_queue.rb

* Convert keys from FollowData#to_h to string before perform_async

I'm not sure enough where else (outside of notification) to_h is being
called, so I'm converting here when building args, rather than in
FollowData#to_h, which might be my next step.

* Let FollowData#to_h return a hash with string keys

Update spec to use string keys as well.

* Make to_h return string keys for ReactionData

Like FollowData, the #to_h method is only used to call
notifications (this is used to enqueue sidekiq jobs).

* Remove a key that was in the hash

Since reaction_data calls to_h, it gets string and not symbol,
keys. Call Hash#except with a key that was actually there.
2022-01-25 18:07:40 -06:00
Ben Halpern
f393de4c21
Feed Experiment round 5: Factor in sum of tag points (#16272)
* Experiment with sum of tag points

* Cast sum of points to integer
2022-01-25 17:08:31 -05:00
Sabarish Rajamohan
922a9a9e10
Added title to be displayed for stackexchange question (#16289)
* Added title to be displayed for stackexchange question

* Fix for introduced spec

* Test Case Refactoring
2022-01-25 13:24:03 -06:00
Michael Kohl
31c805aa09
Let's be friends again, Rubocop (#16294) 2022-01-25 11:58:00 -05:00
Michael Kohl
a8813572c6
Request for Comments: Add Rubocop action (#16295)
* Add Rubocop action

* Update step name
2022-01-25 23:27:46 +07:00
Fernando Valverde
546c3b73bd
Android Runtime Banner - Chrome Intent support (#15181)
* Android - Chrome Intent

* Remove old inline comment

* Use regex for context check

* Update banner intent + playstore URL

* Use single constant for app launch scheme launch

* Use location.href instead of location.host

* Don't display banner on Firefox (Android)

* fix linter changes
2022-01-25 09:01:59 -06:00
Arit Amana
88d0823073
Implement Unified Embeds for Speakerdeck URLs (#16276)
* complete implementation and add specs

* nudge Travis
2022-01-25 07:21:39 -05:00
yheuhtozr
cae8ea2deb
i18n key updates in app/liquid_tags (#16275) 2022-01-25 11:03:09 +07:00
Jeremy Friesen
2b3f4e1342
Refactoring cached_followed_tags (#16175)
* Refactoring cached_followed_tags

This refactor consolidates two queries and a loop into a single query.

One thing that is unclear is if we're ever really clearing the cache of
the user by id?

What follows is un-related to the refactor but appears to be related to #14937.

> First, I see we set a cache here:
>
> ebdaaaf15b/app/decorators/user_decorator.rb (L23-L34)
>
> But when I look at what busts the user cache, it doesn’t look like we’re busting it for the above cached location:
>
> ebdaaaf15b/app/services/edge_cache/bust_user.rb (L3-L22)
>
> What if anything am I missing in regards to cache busting?

* Adding some deprecated methods

* Updating documentation

* Bump for travis

* Bump for travis

* Updating comments to fix confusion

NOTE: I might be introducing more confusion, but at least
I'm addressing the prior confusion.

* Bump for travis

* Updating so we don't cache ActiveRecord objects

* Selecting only applicable attributes for caching

* Apply suggestions from code review

Co-authored-by: Michael Kohl <citizen428@forem.com>

* Adjusting code based on feedback

* Bump for travis

* Bump for travis

* Update app/decorators/user_decorator.rb

Co-authored-by: Michael Kohl <citizen428@forem.com>

Co-authored-by: Michael Kohl <citizen428@forem.com>
2022-01-24 19:53:48 -05:00
Ben Halpern
4960f8913f
Refactor AB Experiments and exercise all variants in rspec (#16236)
* Refactor AB Experiments and exercise all variants in rspec

* Fix test that still uses wut
2022-01-24 17:03:58 -05:00
Nick Taylor
d227bbf770
Now <viewbox /> is preserved in SVGs when using the inline-react-svg plugin (#16287) 2022-01-24 16:25:14 -05:00
Nick Taylor
382b5528c7
Now the close X SVG icon is imported via the inline-react-svg plugin for the Modal component (#16288) 2022-01-24 16:01:21 -05:00
dependabot[bot]
fb15644f65
Bump sass from 1.47.0 to 1.49.0 (#16277)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-24 15:17:48 -05:00
dependabot[bot]
ce44780250
Bump @storybook/addon-backgrounds from 6.4.9 to 6.4.14 (#16280) 2022-01-24 14:52:29 -05:00
dependabot[bot]
de19d341d8
Bump @storybook/addon-a11y from 6.4.10 to 6.4.14 (#16278) 2022-01-24 14:50:52 -05:00
Jeremy Friesen
7320a1ee5d
Appeasing rubocop (#16286)
* Appeasing rubocop

* Bump for travis
2022-01-24 14:46:49 -05:00
Arit Amana
b00f68b7fe
Complete implementation and add specs (#16274) 2022-01-24 14:23:16 -05:00
Mac Siri
3f2653a14d
Prefer custom SMTP config over Sendgrid (#16216) 2022-01-24 14:11:50 -05:00
dependabot[bot]
a39850b05e
Bump @storybook/addon-actions from 6.4.10 to 6.4.14 (#16279)
Bumps [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/addons/actions) from 6.4.10 to 6.4.14.
- [Release notes](https://github.com/storybookjs/storybook/releases)
- [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md)
- [Commits](https://github.com/storybookjs/storybook/commits/v6.4.14/addons/actions)

---
updated-dependencies:
- dependency-name: "@storybook/addon-actions"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-24 12:09:22 -07:00
dependabot[bot]
b361685073
Bump pg from 1.2.3 to 1.3.0 (#16284)
Bumps [pg](https://github.com/ged/ruby-pg) from 1.2.3 to 1.3.0.
- [Release notes](https://github.com/ged/ruby-pg/releases)
- [Changelog](https://github.com/ged/ruby-pg/blob/master/History.rdoc)
- [Commits](https://github.com/ged/ruby-pg/compare/v1.2.3...v1.3.0)

---
updated-dependencies:
- dependency-name: pg
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-24 12:08:22 -07:00
dependabot[bot]
b3928a3bb7
Bump @storybook/builder-webpack5 from 6.4.10 to 6.4.14 (#16281)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-24 13:47:43 -05:00
dependabot[bot]
4e25a7339b
Bump rubocop-rspec from 2.7.0 to 2.8.0 (#16282)
Bumps [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/rubocop/rubocop-rspec/releases)
- [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rspec/compare/v2.7.0...v2.8.0)

---
updated-dependencies:
- dependency-name: rubocop-rspec
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-24 13:42:00 -05:00
dependabot[bot]
53e1b6d8fa
Bump solargraph from 0.44.2 to 0.44.3 (#16283)
Bumps [solargraph](https://github.com/castwide/solargraph) from 0.44.2 to 0.44.3.
- [Release notes](https://github.com/castwide/solargraph/releases)
- [Changelog](https://github.com/castwide/solargraph/blob/master/CHANGELOG.md)
- [Commits](https://github.com/castwide/solargraph/compare/v0.44.2...v0.44.3)

---
updated-dependencies:
- dependency-name: solargraph
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-24 13:35:05 -05:00
Jeremy Friesen
24ccc5ac06
Adding lightweight structure .coerce methods (#16249)
I saw the following error in Honeybadger:

```
[PROJECT_ROOT]/app/services/notifications/reactions/send.rb:61 :in `call`

    old_json_data = notification.json_data
    previous_siblings_size = notification.json_data["reaction"]["aggregated_siblings"].size if old_json_data

	notification.json_data = json_data
[PROJECT_ROOT]/app/services/notifications/reactions/send.rb:20 :in `call`
[PROJECT_ROOT]/app/workers/notifications/new_reaction_worker.rb:16 :in `perform`
[PROJECT_ROOT]/app/models/notification.rb:84 :in `send_reaction_notification_without_delay`
[PROJECT_ROOT]/app/controllers/reactions_controller.rb:136 :in `destroy_reaction`
[PROJECT_ROOT]/app/controllers/reactions_controller.rb:168 :in `handle_existing_reaction`
[PROJECT_ROOT]/app/controllers/reactions_controller.rb:77 :in `create`
```

As I was exploring the error, I saw that we were making assumptions
about the data coercion.  These are valid and somewhat stable
assumptions, but I wanted to look a little deeper into the situation.

This refactor helps consistently negotiate two situations where we're
transforming request-cycle models into lightweight data structures.  It
also begins to show a path towards a generalizable "macro" for this behavior.

Related to #2122, #9534
2022-01-24 11:32:19 -05:00
dependabot[bot]
dbee131571
Bump nanoid from 3.1.30 to 3.2.0 (#16264)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-24 09:53:59 -05:00
ludwiczakpawel
b9d56d1158
focus style (#16266) 2022-01-24 15:39:20 +01:00
Arit Amana
26be901758
Implement Unified Embeds for Medium URLs (#16235)
* Complete implementation and add specs

* return StandardError upon url mismatch
2022-01-24 09:19:51 -05:00
Arit Amana
59810faa7c
Implement Unified Embeds for Kotlin URLs (#16256)
* Complete implementation and add specs

* correct spec mistake

* nudge Travis
2022-01-21 15:50:16 -05:00
dependabot[bot]
182b29963d
Bump gibbon from 3.4.2 to 3.4.3 (#16252)
Bumps [gibbon](https://github.com/amro/gibbon) from 3.4.2 to 3.4.3.
- [Release notes](https://github.com/amro/gibbon/releases)
- [Changelog](https://github.com/amro/gibbon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/amro/gibbon/compare/v3.4.2...v3.4.3)

---
updated-dependencies:
- dependency-name: gibbon
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-21 13:19:23 -07:00
Arit Amana
659806b754
Implement Unified Embeds for Jsitor URLs (#16250)
* Complete implementation and add specs

* update regex
2022-01-21 14:40:14 -05:00
dependabot[bot]
2522b924e6
Bump rpush from 6.0.1 to 7.0.0 (#16255)
Bumps [rpush](https://github.com/rpush/rpush) from 6.0.1 to 7.0.0.
- [Release notes](https://github.com/rpush/rpush/releases)
- [Changelog](https://github.com/rpush/rpush/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rpush/rpush/compare/v6.0.1...v7.0.0)

---
updated-dependencies:
- dependency-name: rpush
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-21 11:39:40 -07:00
dependabot[bot]
9693cea86c
Bump sidekiq from 6.3.1 to 6.4.0 (#16253)
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 6.3.1 to 6.4.0.
- [Release notes](https://github.com/mperham/sidekiq/releases)
- [Changelog](https://github.com/mperham/sidekiq/blob/main/Changes.md)
- [Commits](https://github.com/mperham/sidekiq/compare/v6.3.1...v6.4.0)

---
updated-dependencies:
- dependency-name: sidekiq
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-21 11:27:52 -07:00
dependabot[bot]
5d4fedb116
Bump bootsnap from 1.10.1 to 1.10.2 (#16254)
Bumps [bootsnap](https://github.com/Shopify/bootsnap) from 1.10.1 to 1.10.2.
- [Release notes](https://github.com/Shopify/bootsnap/releases)
- [Changelog](https://github.com/Shopify/bootsnap/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Shopify/bootsnap/compare/v1.10.1...v1.10.2)

---
updated-dependencies:
- dependency-name: bootsnap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-21 13:26:01 -05:00
Daniel Uber
085c566a7b
Onboarding "improvements" (#16210)
* Don't set saw_onboarding automatically

This should be set by the onboarding checkbox update (user accepted
terms of service and code of conduct).

The issue is a PATCH request to track the last seen page is sent on
the first page, _before_ the user consents to the terms via the
checkboxes.

This issue is masked by a 422 unprocessable entity response when we
don't get a username in the patch request (next commit).

* Only validate username on the username page

Every other "last page seen" dialog was returning a 422 because the
username is only submitted in the 3rd dialog "build your profile".

Only validate the username field when it's submitted, process other
onboarding updates normally.

* Remove failing test

Since the onboarding_update action no longer sets saw
onboarding (since we send the patch before they've accepted the code
of conduct), don't test that we do.

There's a parallel test for the onboarding checkbox update later in
this file that covers the checkboxes have been accepted.

* overwrite instead of merging user_params

We now initialize it empty, no need to merge params here.
2022-01-21 10:58:05 -06:00
Michael Kohl
a0edc9ac7e
Add Settings::Base.to_h (#16241) 2022-01-21 22:23:24 +07:00
Jeremy Friesen
fc8158a5ba
Stripping tags from "tags.short_summary" column (#16248)
On the DEV.to database, I ran the following SQL:

```sql
SELECT name, short_summary FROM tags WHERE short_summary LIKE '%<%';
```

There were three tags with a `<` in them:

- changelog
- cnc2018
- javascript

This PR will tidy up our short summary as part of saving a tag.  It will
also tidy up the existing tags.
2022-01-21 09:38:26 -05:00
Fernando Valverde
41e6b7f858
Add host tag in ForemStatsClient (#16237)
* Add host tag in ForemStatsClient

* fix error in host tag
2022-01-21 08:27:42 -06:00
Nick Taylor
df8c12950c
Configured the repository to handle line endings (#16234) 2022-01-21 08:57:05 -05:00