Commit Graph

293 Commits

Author SHA1 Message Date
Sam
5f64fd0a21 DEV: remove exec_sql and replace with mini_sql
Introduce new patterns for direct sql that are safe and fast.

MiniSql is not prone to memory bloat that can happen with direct PG usage.
It also has an extremely fast materializer and very a convenient API

- DB.exec(sql, *params) => runs sql returns row count
- DB.query(sql, *params) => runs sql returns usable objects (not a hash)
- DB.query_hash(sql, *params) => runs sql returns an array of hashes
- DB.query_single(sql, *params) => runs sql and returns a flat one dimensional array
- DB.build(sql) => returns a sql builder

See more at: https://github.com/discourse/mini_sql
2018-06-19 16:13:36 +10:00
Sam
1d9fdcd9d3 Attempt to make spec more robust 2018-06-14 16:10:30 +10:00
Sam
89ad2b5900 DEV: Rails 5.2 upgrade and global gem upgrade
This updates tests to use latest rails 5 practice
and updates ALL dependencies that could be updated

Performance testing shows that performance has not regressed
if anything it is marginally faster now.
2018-06-07 14:21:33 +10:00
Guo Xiang Tan
aaea24448e DEV: Add specs for 085eaaf18d. 2018-06-05 10:03:26 +08:00
Guo Xiang Tan
dcba320bf6 Remove spec that isn't testing for anything. 2018-06-05 09:30:02 +08:00
Gerhard Schlager
c0bab84dc1 Fix random build error
Spec usually failed when there was an UpdateGravatar job for the system user.
2018-06-01 17:34:19 +02:00
Guo Xiang Tan
7fc8a36529 DEV: Take 2 Queue jobs in tests by default.
On my machine this cuts the time taken to run our test suite
from ~11mins to ~9mins.
2018-05-31 16:23:23 +08:00
Guo Xiang Tan
56e9ff6853 Revert "DEV: Queue jobs in tests by default."
Too risky for now

This reverts commit be28154d3b.
2018-05-31 15:34:46 +08:00
Guo Xiang Tan
be28154d3b DEV: Queue jobs in tests by default. 2018-05-31 14:45:47 +08:00
Guo Xiang Tan
58fbe74b6f Remove assertion to_not raise_error.
If an error is raised the test would fail anyway.
2018-05-25 09:57:08 +08:00
Guo Xiang Tan
43f7cb05c9 FIX: Broken ping event for web hooks due to missing payload. 2018-05-24 15:16:52 +08:00
Guo Xiang Tan
bf84037f79 FIX: Payload for webhooks should be current as of the time the event was triggered.
https://meta.discourse.org/t/group-category-tag-user-deleted-webhooks-not-firing/87752
2018-05-21 17:29:58 +08:00
Sam
21e0b7c818 avoid async report pattern and replace with simpler hijack 2018-05-16 16:05:03 +10:00
Régis Hanol
a28c58feb1 FIX: automatic group membership when using SSO 2018-05-15 01:48:30 +02:00
Sam
67054d524d correct missing day from async reports 2018-05-11 15:06:23 +10:00
Misaka 0x4e21
ff6be3c2e3 FEATURE: add profile_background fields into SSO (#5701)
Add profile_background and card_background fields into Discourse SSO.
2018-05-07 10:03:26 +02:00
Kyle Zhao
0cc4b42180 FIX: TopicEmbed.import should update title and author 2018-05-02 17:12:31 +10:00
Régis Hanol
598aba3261 fix the build 2018-04-25 22:34:23 +02:00
Arpit Jalan
65be3c627d further optimize spec 2018-04-25 11:08:38 +05:30
Arpit Jalan
9d7f4cec3e optimize spec 2018-04-25 10:27:56 +05:30
Arpit Jalan
d2cc5452ec add spec for user csv export 2018-04-25 10:22:39 +05:30
Arpit Jalan
91bf10bd12 FIX: create upload record for exported csv files 2018-04-20 00:27:49 +05:30
Guo Xiang Tan
142571bba0 Remove use of rescue nil.
* `rescue nil` is a really bad pattern to use in our code base.
  We should rescue errors that we expect the code to throw and
  not rescue everything because we're unsure of what errors the
  code would throw. This would reduce the amount of pain we face
  when debugging why something isn't working as expexted. I've
  been bitten countless of times by errors being swallowed as a
  result during debugging sessions.
2018-04-02 13:52:51 +08:00
Vinoth Kannan
efb19dbdaf
Merge pull request #5705 from discourse/new_webhooks
FEATURE: Webhook for group and category events
2018-04-02 10:53:21 +05:30
Vinoth Kannan
dc33f2d071 Add new web hook serializers 2018-03-28 17:40:29 +05:30
Neil Lalonde
ced7e9a691 FEATURE: control which web crawlers can access using a whitelist or blacklist 2018-03-22 15:41:02 -04:00
Guo Xiang Tan
486bbe9cc2 FIX: Auto re-opened topics should restore category auto close settings.
https://meta.discourse.org/t/topic-closed-temporarily-due-to-community-flags-overwrites-category-auto-close-timer/77421
2018-02-27 15:33:31 +08:00
Régis Hanol
0559a4736a FIX: don't double request when downloading a file 2018-02-24 12:35:57 +01:00
Vinoth Kannan
e924de71e7 Spec test to make sure we do not skip trashed post 2018-02-13 12:23:47 +05:30
Neil Lalonde
d7e90edeb5 PERF: Tl3Promotions job can limit the number of TL3 candidates by using some simple requirements in the query 2018-02-05 17:54:36 -05:00
Régis Hanol
130974d58d FIX: automatically unsilence users 2018-02-05 17:45:47 +01:00
Régis Hanol
a7603b1cfb remove unused file 2018-02-05 16:58:57 +01:00
Régis Hanol
77ac14d475 prevent users with a tiny number of posts to dominate the 'new user of the month' leaderboard 2018-01-29 12:09:17 +01:00
Jan Suchal
bc56d86a63 Support ruby 2.5.0 2018-01-09 16:03:17 +01:00
Arpit Jalan
6c1ebbb95c add test case for csv BOM handling 2018-01-09 15:49:41 +05:30
Arpit Jalan
ef4c6c67ba fix the build 2017-12-23 14:42:40 +05:30
Gerhard Schlager
7b58afe677 FIX: ProcessPost job failed for posts that have no user 2017-12-21 14:45:59 +01:00
Guo Xiang Tan
97ceebb570 SECURITY: Don't pass email backup token to sidekiq as a parameter.
* This exposes the token in the Sidekiq dashboard which can be
  viewed by an admin and defeats the purpose of using a token
  in the download backup email ink.
2017-12-18 11:25:22 +08:00
scossar
11050e5d10 Don't override count value that has been set by query.count 2017-12-13 18:48:46 -08:00
Sam
b998efdc94 FIX: do not send mailing list emails to unapproved users 2017-12-13 15:13:17 +11:00
Kyle Zhao
5f318a5241 FEATURE: Replace SimpleRSS with Ruby RSS module (#5311)
* SPEC: PollFeedJob parsing atom feed

* add FeedItemAccessor

It is to provide a consistent interface to access a feed item's tag
content.

* add FeedElementInstaller

to install non-standard and non-namespaced feed elements

* FEATURE: replace SimpleRSS with Ruby RSS module

* get FinalDestination and download with Excon

* support namespaced element with FeedElementInstaller
2017-12-06 10:45:09 +11:00
Sam
af061efcf5 DEV: if plugins are installed do not fail the test 2017-12-04 18:17:30 +11:00
Guo Xiang Tan
c128e421c4 FIX: Don't run job if topic timer has already been deleted. 2017-11-30 15:26:26 +08:00
Régis Hanol
a586738f25 fix randomly failing spec 2017-11-16 18:16:16 +01:00
Régis Hanol
678e28794a FIX: properly handle too large & broken images in posts 2017-11-16 15:45:07 +01:00
Vinoth Kannan
6f2a3cb026
Remove unwanted triggers to CookedPostProcessor (#5319) 2017-11-16 15:20:44 +05:30
Sam
9c22c68d39 FIX: only save custom fields if they actually change 2017-11-16 15:14:10 +11:00
Vinoth Kannan
7b494a65c9 NEW: large image placeholder added in cooked html (#5291) 2017-11-15 11:30:47 +01:00
Robin Ward
971e302ff2 FEATURE: Support an end date for user silencing 2017-11-14 13:20:19 -05:00
Régis Hanol
7370adeae3 FIX: don't delete uploads referenced in drafts or queued posts when using the short_url 2017-11-13 15:01:31 +01:00