Commit Graph

9522 Commits

Author SHA1 Message Date
evazion
ae7fc7d1bc Update eslint to 7.0, add babel-eslint plugin.
Add babel-eslint plugin so that eslint can recognize optional chaining
syntax (a?.b).
2020-06-19 02:25:28 -05:00
evazion
213766fac9 posts: fix "view original" not working on mobile.
ref: 38f385d1ca (r40000777)
2020-06-18 12:25:45 -05:00
evazion
459f67c431 iqdb: fix 599 timeout errors.
Increase timeout to 30 seconds when uploading files to IQDB. Previously
we used the default timeout of 3 seconds, which could cause 599 timeout
errors sometimes if the upload took too long.
2020-06-18 00:57:51 -05:00
evazion
f790a1aeed http: increase default timeout to 10 seconds.
Three seconds was little tight and might have caused timeouts in source
strategies sometimes.
2020-06-18 00:56:42 -05:00
evazion
fd6ba473a5 tests: possible fix for images getting nuked by tests. 2020-06-17 12:30:37 -05:00
evazion
d5a7eef53d uploads: fix remote file size not appearing. 2020-06-17 04:13:16 -05:00
evazion
b8b5c8d6a0 iqdb: fix error with file uploads.
Fix "cannot determine size of body" errors on upload page. Caused by
exception during IQDB lookup. We were posting the form data wrong, we
need to wrap the file with HTTP::FormData::File and pass it through the
`form` parameter.
2020-06-17 02:28:16 -05:00
evazion
91beb288b6 reportbooru: cache post views endpoint.
Cache most viewed posts endpoint for /explore/posts/viewed page.
2020-06-17 00:57:55 -05:00
evazion
8d4844d485 Merge pull request #4517 from nonamethanks/fix_4509
Add more tags to post replacements filtering and modqueue highlighting.
2020-06-17 00:49:01 -05:00
nonamethanks
c23fee846f Add more tags to post replacements filtering and modqueue
highlighting.
2020-06-17 07:28:22 +02:00
evazion
b551e3634f Fix misc rubocop warnings. 2020-06-16 21:36:15 -05:00
evazion
dc460aab53 Merge pull request #4514 from danbooru/dependabot/bundler/sanitize-5.2.1
build(deps): bump sanitize from 5.2.0 to 5.2.1
2020-06-16 19:52:59 -05:00
dependabot[bot]
3a71f610be build(deps): bump sanitize from 5.2.0 to 5.2.1
Bumps [sanitize](https://github.com/rgrove/sanitize) from 5.2.0 to 5.2.1.
- [Release notes](https://github.com/rgrove/sanitize/releases)
- [Changelog](https://github.com/rgrove/sanitize/blob/master/HISTORY.md)
- [Commits](https://github.com/rgrove/sanitize/compare/v5.2.0...v5.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-16 22:10:14 +00:00
evazion
a572a6614d popular/missed searches: fix blank views.
Fix missing call to `.each`.
2020-06-16 13:09:05 -05:00
evazion
101e8a13b8 /posts: fix blank tag sidebars.
Fix the sidebar on the /posts index page sometimes being blank. This
could happen when either the related tag calculation was too slow and
timed out, or when Reporbooru was unavailable and we couldn't fetch the
list of popular tags.

In the tag list would otherwise be blank, we fall back to frequent tags
(the most common tags on the current page of results).

Also change it so that if Reportbooru is unconfigured, we fail
gracefully by returning blank results instead of failing with an
exception. This is so we can still view the popular searches and missed
searches pages during testing (even though they'll be blank).
2020-06-16 12:58:41 -05:00
evazion
ed152a780b Upgrade ruby gems and yarn packages. 2020-06-16 00:38:09 -05:00
evazion
1aa0f65187 sources: fix rubocop warnings. 2020-06-16 00:10:37 -05:00
evazion
049f33916b tests: fix random username conflicts.
Fix parallel tests randomly failing because of username conflicts.
2020-06-16 00:10:37 -05:00
evazion
b583b3c810 tests: fix nicoseiga download tests. 2020-06-16 00:10:35 -05:00
evazion
7868e5045e nicoseiga: fix regression with http redirects.
3cdf67920 changed it so that Danbooru::Http follows redirects by
default. This broke some things in the Nico Seiga strategy, so disable
following redirects in the Nico Seiga API client for now.

Also change it so that Danbooru::Http follows redirects after a POST
request (by setting `strict: false`). Nico Seiga needs this because it
sends a redirect after we POST the login form.
2020-06-15 22:13:28 -05:00
evazion
962e60f4f1 Merge pull request #4496 from nonamethanks/refactor_nicoseiga
Refactor nicoseiga
2020-06-15 21:05:10 -05:00
evazion
19727ab5c4 Merge pull request #4505 from nonamethanks/pixiv_digital_tags
Pixiv: don't blacklist digital tools anymore
2020-06-15 20:56:56 -05:00
evazion
52367c79e2 ci: upload code coverage even when tests fail. 2020-06-15 20:21:09 -05:00
evazion
4c56447d66 ci: add codecov.io integration. 2020-06-15 17:32:59 -05:00
evazion
107729e17f ci: enable codeclimate reporter debug output. 2020-06-15 17:21:41 -05:00
evazion
a615a28b1b ci: disable warnings during tests. 2020-06-15 16:45:37 -05:00
evazion
f60b184a12 ci: don't trigger twice on pull requests. 2020-06-15 16:45:37 -05:00
evazion
6a7d25591b ci: use more permissive rubocop / codeclimate settings. 2020-06-15 16:45:37 -05:00
evazion
ec5aa6c662 tests: fix saved search index action test.
This passed in development but failed in CI because SavedSearch.redis
used the live Redis server, which worked by accident as long as you had
a Redis server running.
2020-06-15 16:45:37 -05:00
nonamethanks
5b186f3072 Support for new nicoseiga cdn domain 2020-06-15 04:01:34 +02:00
nonamethanks
6fc4d3ec44 Nicoseiga: Add support for drm-served manga 2020-06-15 03:37:51 +02:00
nonamethanks
260bc997f6 NicoSeiga: Add preview urls 2020-06-15 03:37:51 +02:00
nonamethanks
9f0e85e1b5 Refactor nicoseiga strategy
* Get rid of mechanize, fully switch to Danbooru::Http
* Switch to mobile api, improving speed
* Merge main and manga clients
* Add full support for manga pages
* Add support for anonymous and r-15 images
* Don't fail when attempting to upload oekaki direct links
* Various misc fixes
2020-06-15 03:37:51 +02:00
evazion
3cdf679202 http: automatically follow redirects.
* Automatically follow redirects (up to 5, return a synthetic 598 error after that).
* Add `put` and `timeout` methods.
* Add tests.
2020-06-14 01:39:55 -05:00
evazion
cd501fe27b iqdb: switch to Danbooru::Http. 2020-06-14 01:06:51 -05:00
evazion
a4df18e650 Refactor Reportbooru API clients.
* Combine MissedSearchService, PostViewCountService, and
  PopularSearchService into single ReportbooruService class.
* Use Danbooru::Http for these services instead of HTTParty.
2020-06-14 00:32:42 -05:00
evazion
1846133cd6 post view count service: switch to Danbooru::Http. 2020-06-13 21:50:06 -05:00
evazion
9e29326b96 README.md: add Discord status badge. 2020-06-12 00:49:01 -05:00
nonamethanks
e83d07ea7b Pixiv: don't blacklist digital tools anymore 2020-06-12 04:15:20 +02:00
evazion
025e09ff7f tests: upload test coverage reports to code climate.
Downgrade simplecov to 0.17 because 0.18 is incompatible with code
climate. Ref: github.com codeclimate/test-reporter/issues/413
2020-06-11 15:35:15 -05:00
evazion
8181ee6a1d Update rubocop config. 2020-06-11 14:08:23 -05:00
evazion
889c4ce4d9 Add Code Climate integration. 2020-06-11 13:31:17 -05:00
evazion
be4646aa6f tests: fix username conflicts in parallel tests.
Parallel tests sometimes failed because the username generator sometimes
generated duplicate usernames.
2020-06-11 02:43:19 -05:00
evazion
e14a577ed9 tests: clean up test_helper.rb initialization. 2020-06-11 02:41:44 -05:00
evazion
8e50f1d1a0 tests: remove unused test images in tmp/. 2020-06-11 02:41:17 -05:00
evazion
27c5361b96 tests: add minimum test coverage requirements. 2020-06-11 02:40:02 -05:00
evazion
a829fbfb8d tests: fix test coverage reporting for parallel testing.
* Fix simplecov clobbering test coverage reports when using parallel tests.
* Generate coverage reports by default (remove $SIMPLECOV flag).
* Store coverage reports in tmp/coverage/ instead of coverage/.
* Enable branch coverage.

ref: github.com /colszowka/simplecov/issues/718#issuecomment-538201587
2020-06-11 02:16:20 -05:00
evazion
99a9149fc4 tests: eliminate as_user helper. 2020-06-11 01:02:01 -05:00
evazion
2d05004bef tests: don't cache pixiv sessions. 2020-06-11 00:47:12 -05:00
evazion
7ba786010d tests: store test uploads in temp dir.
Fixes parallel tests failing because uploads for different tests were
stored in the same directory and uploads got clobbered when cleaning up
this directory.
2020-06-10 22:54:33 -05:00