Commit graph

27 commits

Author SHA1 Message Date
Michael Kohl
a1f512e49e
✂✂✂ Remove events (#15062)
* Remove events

* Fix schema

* Fix specs

* More removal
2021-10-15 09:31:08 -04:00
Jamie Gaskins
268ea66dcd
Optimize Article query in EdgeCache::BustArticle (#14916) 2021-10-05 11:58:34 -04:00
dependabot[bot]
f24d3d157f
Bump rubocop-rails from 2.10.1 to 2.11.0 (#14043)
* Bump rubocop-rails from 2.10.1 to 2.11.0

Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.10.1...v2.11.0)

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

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

* Enable new cops and fix violations

* Remove expected string literal

As we're passing a block (that yields a string) there are no arguments
to the debug call.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rhymes <github@rhymes.dev>
Co-authored-by: Dan Uber <dan@forem.com>
2021-06-22 11:25:28 -05:00
Vaidehi Joshi
5e6aad98e3
Replace MAX_USER_MENTIONS with Settings::RateLimit.mention_creation (#13736)
* Replace MAX_USER_MENTIONS with Settings::RateLimit.mention_creation

* Remove Vaidehi-specific TODOs

* Remove unnecessary constant stubs

* Remove rate_limit_mention_creation from SiteConfig
2021-05-12 08:16:38 -07:00
dependabot[bot]
9066de9b65
Bump rubocop-rails from 2.9.1 to 2.10.0 (#13655)
* Bump rubocop-rails from 2.9.1 to 2.10.0

Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.9.1 to 2.10.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.9.1...v2.10.0)

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

* Add 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-05-05 14:16:44 -07:00
Alex
393ba00221
Remove Elasticsearch ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ ✂️ (#13606)
* Attempt number 1

* Fix rack_attack specs

* Fix users_searches_users spec

* Fix display_users_search_spec

* Fix comment typo

* Remove search:destroy task from cypress

* Remove port 9300 from gitpod

* Stub response in attack_spec
2021-05-03 11:09:45 -04:00
Michael Kohl
610f6151e6
Split Settings::Community from SiteConfig (#13403)
* Add settings_community_contents model

* Add settings_communities model

* Update usage

* Add controller and update code

* Add e2e test

* Add data update script

* Update schema.rb

* Fix specs

* PR feedback

* Remove experience_* from Settings::Community

* Update spec

* Fix spec
2021-04-26 10:46:35 +02:00
Daniel Uber
c1a93ad3c3
Cleanup articles cache busting (#13467)
* Extract repeated calls to cache_bust.call to iteration over list

This mirrors what the EdgeCache::BustUser service looks like.

It might make sense to have cached_article_paths be a method accepting
a block and yielding paths, and including the collections cache paths
as well.

* Move article path information into a separate method

BustArticle.call now only knows to bust cache for each path associated
with the article, the information about which paths to clear is moved
to a separate `paths_for` method.

I may have gone overboard on this.

* Remove extra blank line
2021-04-23 09:35:40 -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
Jamie Gaskins
afa3178b79
Fix rescue in EdgeCache::Bust (#13303)
We were trying to report an exception to Honeybadger but we never
actually captured the exception.
2021-04-07 15:31:30 -04:00
Alex
d109b6824e
Refactor cache purging (#12811)
* Refactor caching

* Bring back old bust class

* Refactor with PR feedback

* Remove useless return values
2021-03-02 10:09:05 -05:00
rhymes
09abd1af81
Fastly edge caching: use PURGE HTTP method instead of POST (#12627)
* Add :fastly_http_purge feature flag

* Add fastly.purge to EdgeCache::Bust::Fasty

* Update app/services/edge_cache/bust/fastly.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update app/services/edge_cache/bust/fastly.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Update spec/lib/data_update_scripts/add_fastly_http_purge_feature_flag_spec.rb

Co-authored-by: Michael Kohl <citizen428@dev.to>

* Improve specs applying the feedback

* Deploy to BHC

* Undo Travis changes

Co-authored-by: Michael Kohl <citizen428@dev.to>
Co-authored-by: Mac Siri <krairit.siri@gmail.com>
2021-02-17 13:34:37 -05:00
Kirk Haines
ed74f2f245
Abstract DatadogStatsClient to ForemStatsClient (#12304)
* This change abstracts the DatadogStatsClient into a ForemStatsClient.
The purpose of this abstraction is to set the foundation for a subsequent PR that will allow one to use New Relic for recording Forem stats, instead of Datadog, if there is a New Relic configuration found.
This specific change creates an abstraction layer that can be built upon, without changing any actual default behavior. All specs still pass.

* Use delegate instead of explicit methods.

* Delegate instead of explicit methods.

* Fix the error.

* Refactor according to the suggestions in the comments.

* Ooops.  Stats work better when all of the code is committed.

* Removing the alias of count to increment since that was done in error.
2021-01-27 11:25:44 -05:00
Ben Halpern
3308bf5e3d
Add sidebar bust logic (#11878)
* Add sidebar bust logic

* Fix typo
2020-12-13 19:43:44 -05:00
Alex
494359fd21
Create services for busting organizations, podcast episodes, listings, and users (#11832)
* Create service for bust_organization

* Create bust_podcast_episode_service

* Add error spec to BustOrganization

* Create bust_listings

* Create bust_user service
2020-12-11 08:59:24 -05:00
Alex
8598ed090e
Create services for busting pages, tags, events, and podcasts (#11812)
* Create bust_page service and spec

* Specify spec with .once

* Create bust_tag service and spec

* Create bust_event service and spec

* Create bust_podcast service and spec
2020-12-09 10:37:02 -05:00
Alex
d0eb582236
Add bust_article service (#11788)
* Add bust_article service

* Make timestamps lambdas

* Remove nil safe operators

* Updated bust_article specs

* Add spec for TIMEFRAMES and relative time
2020-12-08 11:56:43 -05:00
Alex
7ee8523ba3
Refactor EdgeCache (#11684)
* Refactor EdgeCache

* Update specs

* Add bust comment spec

* Fix more specs

* Use const_get

* Make methods private

* Add .discussion? decorator to Article

* Change variable name to article for clarity
2020-12-02 14:20:22 -05:00
Vaidehi Joshi
97d5bc47b6
Use OPENRESTY_URL over protocol + domain (#11289)
* Use OPENRESTY_URL over protocol + domain

* Prefer OpenResty over Openresty
2020-11-06 08:58:59 -08:00
Vaidehi Joshi
6a697173bc
Split EdgeCache::Bust into Fastly + Nginx-specific classes (#10505) [deploy]
* Split EdgeCache::Bust into Fastly + Nginx-specific classes

* Update EdgeCache::Bust service specs

* Move Nginx TODO comment into Nginx-specific file
2020-10-01 10:07:51 -07:00
Molly Struve
d2d9984f28
[deploy] Return Cache Bust Response When Busting a Cached Path (#10500) 2020-09-30 17:17:04 -05:00
Vaidehi Joshi
d5f810a6f8
[deploy] Refactor edge caching logic to live in EdgeCache::Service (#10369)
* Refactor edge caching logic to live in EdgeCache::Service

* Rename EdgeCache::Service to EdgeCache::Buster

* Reorganize some code, move from Buster to Bust naming
2020-09-18 16:41:40 -05:00
Molly Struve
527c98fa01
[deploy] remove no longer used index! and check for main_image method in view (#7526) 2020-04-27 10:16:49 -05:00
Molly Struve
05b6220e2d
[deploy] reindex articles to Elasticsearch in places where relations are updated or update_column is used (#7003) 2020-04-01 10:59:30 -05:00
Michael Kohl
b57ced5466 CacheBuster refactoring (#4766)
* Turn CacheBuster into a module

This class used no internal state, so repeatedly creating short-lived objects seems wasteful.

* Consistently use string interpolation and parenthesis

* Destructure arrays into meaningful names, formatting

* Fix request spec for internal classified listings controller

Interestingly this works when asserting directly on the module, but not on a double.
Asserting directly in the module seems sufficient for this test so the indirection
was removed.

* Turn CacheBuster into a module

This class used no internal state, so repeatedly creating short-lived objects seems wasteful.

* Fix specs after rebasing
2019-11-13 10:51:23 -05:00
cyrillefr
369aeb9130 Fix comment deletion bug (#3732)
Fix bug where deleted comment still appears on user's profile
2019-08-27 17:07:09 -04:00
rhymes
260fe901b8 Refactor Comments::BustCacheJob to use a service (#2655) 2019-05-09 10:10:37 -04:00