Commit Graph

600 Commits

Author SHA1 Message Date
Guo Xiang Tan 17047806b9 Add a rake task to fix uploads with wrong extension. 2018-08-08 13:15:17 +08:00
Régis Hanol 14bbd5d167 FIX: use the right URL when downloading the file from S3 2018-08-02 10:04:41 +02:00
Régis Hanol 0f1137dafa FIX: 'migrate_from_s3' rake task wasn't handling short urls 2018-08-01 22:58:46 +02:00
Neil Lalonde b829452c75
Merge pull request #6209 from discourse/mini_scheduler
REFACTOR: extract scheduler to the mini_scheduler gem
2018-08-01 10:28:24 -04:00
Neil Lalonde 4ad7ce70ce REFACTOR: extract scheduler to the mini_scheduler gem 2018-07-31 17:12:55 -04:00
Sam f0c203a5cf clean up previous commit 2018-07-31 14:50:02 +10:00
Jay Pfaffman b55d9e63a0 Rake mail test debugging (#6171)
* FEATURE: rake emails:test add debugging

* Oops! Remove safety code

* more language tweaks
2018-07-31 14:45:59 +10:00
Gerhard Schlager e42038eae2 Rake task called method with wrong arguments 2018-07-24 00:10:09 +02:00
Jay Pfaffman 0ed2834c2d FEATURE: Add users:disable_2factor rake task
https://meta.discourse.org/t/admin-locked-out-of-2fa/92156/2?u=pfaffman
2018-07-16 09:56:55 +08:00
Arpit Jalan 536cef86f4 PERF: do not carry post ids in memory when rebaking all posts 2018-07-11 14:34:33 +05:30
Guo Xiang Tan 59a2767de8 Ensure that we restore the site setting in posts:rebake rake task. 2018-07-06 16:22:54 +08:00
Neil Lalonde 92000bc8a0 FEATURE: add a rake task to recalculate user stats post_count and topic_count 2018-07-05 10:38:46 -04:00
Sam d1b21aa73b add timings to asset precompile 2018-07-04 09:42:38 +10:00
Gerhard Schlager 23acddc9fa Add descriptions for rake tasks 2018-06-27 20:24:46 +02:00
Joffrey JAFFEUX 2f7960bd2a
DEV: updates prettier and displays linters/prettifiers version in CI 2018-06-20 18:34:49 +02:00
Joffrey JAFFEUX 8126b603e4
fix prettier 2018-06-20 18:26:43 +02:00
Joffrey JAFFEUX c5c1b45d19
higher loglevel for prettier 2018-06-20 16:51:48 +02:00
Sam cb824a6b33 DEV: remove all calls to SqlBuilder use DB.build instead
This is part of the migration to mini_sql, SqlBuilder.new is being
deprecated and replaced with DB.build
2018-06-20 17:53:49 +10:00
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
Joffrey JAFFEUX 913d97e780
fix prettier 2018-06-18 20:10:48 +02:00
Joffrey JAFFEUX 6f2c5ea1f2
increases loglevel to debug CI only failure 2018-06-18 19:25:54 +02:00
Joffrey JAFFEUX 03a7d532cf
DEV: introduces prettier for es6 files 2018-06-15 17:03:24 +02:00
Guo Xiang Tan b91a3c12a5 Revert "Smoke test should wait up to 5 minutes before it fails"
This reverts commit 34d4712133.
2018-06-11 08:47:57 +08:00
Joffrey JAFFEUX d96c775833
enforces prettier 2018-06-08 17:38:29 +02:00
Gerhard Schlager 4ba910ac54 Update username only after successful user anonymization 2018-06-08 15:50:07 +02:00
Joffrey JAFFEUX 22c186a792
disables prettier enforcing for now 2018-06-08 15:44:00 +02:00
Joffrey JAFFEUX eedf7ffc4f
force install with sudo 2018-06-08 13:25:33 +02:00
Joffrey JAFFEUX bc7f16a406
forces install of prettier using npm 2018-06-08 13:22:36 +02:00
Joffrey JAFFEUX 3869a9d027
forces global install of prettier 2018-06-08 12:40:05 +02:00
Joffrey JAFFEUX ddade9c145
better log of yarn setup 2018-06-08 12:12:17 +02:00
Joffrey JAFFEUX bb920e9bb1
DEV: makes sure yarn is ran before docker:test 2018-06-08 12:04:53 +02:00
Joffrey JAFFEUX 174d392e5a
DEV: adds prettier (#5956)
Run `prettier --write "app/assets/stylesheets/**/*.scss" "plugins/**/*.scss"` after making sure you installed it with `yarn`

It's recommended to configure your editor to run prettier on file save.
2018-06-08 11:49:31 +02:00
Sam 322b66bcee attempt to shuffle order of operation for test 2018-06-07 18:16:45 +10:00
Guo Xiang Tan 3533bdb83f Remove line that is no longer required. 2018-06-07 15:56:16 +08:00
Guo Xiang Tan 1d5c176ea5 DEV: `docker:test` rake task should install plugins first before migrating. 2018-06-07 15:20:06 +08: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 cb9596e196 Remove invalid `hosted-site` plugin. 2018-06-07 08:49:19 +08:00
Guo Xiang Tan 32c0ff4831 DEV: Install dependencies before running smoke test. 2018-06-05 18:46:41 +08:00
Arpit Jalan 313ff264f2 use generic example domain 2018-06-01 14:20:41 +05:30
Sam 5a8d2b5e45 FIX: rake assets:precompile should be re-runnable 2018-05-31 16:18:01 +10:00
Guo Xiang Tan db4af262dc DEV: Create smoke test screenshot directory in rake task. 2018-05-30 16:20:18 +08:00
Guo Xiang Tan fe5a48997c DEV: Store smoke tests failure image in a dedicated tmp folder. 2018-05-30 15:59:07 +08:00
Neil Lalonde 1b0a3023bb fix rake task usage 2018-05-29 16:29:12 -04:00
Vinoth Kannan a7be1ddf4f variable name typo 2018-05-28 19:21:06 +05:30
Vinoth Kannan 586e45edb9 FIX: Split by space to support multiple categories export 2018-05-28 19:19:26 +05:30
Gerhard Schlager ef84099db1 Add rake task for updating username in posts 2018-05-28 11:25:24 +02:00
Sam efe7b6dbc1 DEV: after installing official plugins, install the gems 2018-05-17 17:18:22 +10:00
Gerhard Schlager a024e5e9ac Retry on read timeouts while warming up for qunit tests 2018-05-15 21:26:59 +02:00
Gerhard Schlager 34d4712133 Smoke test should wait up to 5 minutes before it fails 2018-05-15 14:40:33 +02:00
Gerhard Schlager f4e9d47a27
Make linter happy 2018-05-13 15:20:39 +02:00
Jay Pfaffman c9f959f9cb Add emails:test rake task (#5816) 2018-05-13 14:15:15 +02:00
Arpit Jalan e9d92da9ee minor optimizations to categories:move_topics rake task 2018-05-08 15:14:19 +05:30
Arpit Jalan 62c266f987 add a rake task to move all topics from one category to another 2018-05-08 15:05:56 +05:30
Gerhard Schlager 3be3c50c7e FEATURE: Rename user in mentions and quotes
Co-authored-by: Robin Ward <robin.ward@gmail.com>
2018-05-01 13:49:14 -04:00
Joffrey JAFFEUX 691174fa8f
FEATURE: adds emoji search aliases 2018-05-01 15:43:49 +02:00
Joffrey JAFFEUX 9e7150a2ad Revert "add a few emoji aliases"
This reverts commit d942bf6282.
2018-05-01 11:04:26 +02:00
Sam d942bf6282 add a few emoji aliases 2018-05-01 15:07:59 +10:00
Yaw Anokwa 02cd035164
Correct spelling errors 2018-04-26 09:46:32 -07:00
Sam f0803e9611 sleep here is a better fit 2018-04-11 16:46:27 +10:00
Sam be0366d587 add debugging for docker test 2018-04-11 16:39:39 +10:00
Gerhard Schlager 64f2086cca rake task should allow reordering posts of single topic 2018-04-10 13:52:08 +02:00
Arpit Jalan adb93716ca FIX: rake task should rebake posts in descending ID order 2018-04-10 00:18:49 +05:30
Arpit Jalan cd66dd1404 fix admin rake task 2018-04-07 16:57:17 +05:30
Sam 0d6cfe45bf tl1 should be enough for grant admin. tl4 is hard to revert 2018-04-05 10:53:11 +10:00
Guo Xiang Tan 4f7f733ab0 Upgrade docker:test to use PG 10. 2018-04-04 10:28:23 +08:00
Blake Erickson 31ce955487 Add destroy rake task
Adds several rake tasks to delete users, topics, pm's and site stats so
that you can have a fresh site but maintain site settings and category
structure.
2018-03-30 18:32:21 -06:00
Gerhard Schlager cf9965fd54 Add rake task for reordering posts by creation_date 2018-03-29 14:42:41 +02:00
Régis Hanol 9e7d5a3cdf FIX: 'uploads:recover_from_tombstone' rake task wasn't restoring attachments 2018-03-28 15:51:47 +02:00
Blake Erickson 9fdf139235 Add tests for Site Settings import/export
- extracted out site settings rake task to a class
- added tests for import and export of site settings
2018-03-23 14:55:17 -06:00
Guo Xiang Tan 5782a23a69 Allow `uploads:missing` to skip optimized image check. 2018-03-12 20:08:53 +08:00
Gerhard Schlager ec3a2d2762 Stop retrying tests three times if qunit tests fail
Warming up the Rails server should be enough
2018-03-12 12:51:26 +01:00
Gerhard Schlager 7a2183e8ab FEATURE: rake task for merging users 2018-03-01 12:28:12 +01:00
Joffrey JAFFEUX aa990604c5 Adds :puke: as alias to :face_vomiting: 2018-02-24 17:11:04 +01:00
Arpit Jalan a1ea477604 rescue error when cleaning avatars 2018-02-23 18:15:55 +05:30
Sam 86d12bd44b FEATURE: search within title using in:title
Also

- Significantly improved search ranking, title is treated most strongly
- Adds tag names to the index
- Run search re-indexer more aggressively
- Re-index topic and all posts on category change
2018-02-20 14:41:21 +11:00
Blake Erickson 49ad983050 fix extra blank line 2018-02-15 16:54:22 -07:00
Blake Erickson 925d1a7869 FEATURE: add rake task for import/export of site settings 2018-02-15 16:23:42 -07:00
Neil Lalonde 0edd386b48 FEATURE: Vanilla bulk importer 2018-02-02 16:28:51 -05:00
Arpit Jalan 9bbfad1081 rename private to personal 2018-02-01 13:25:29 +05:30
Régis Hanol cbf4204ecc FIX: uploads:migrate_from_s3 wasn't destroying records before creating new ones 2018-01-24 13:22:07 +01:00
Régis Hanol 28d432263e rework the uploads:migrate_from_s3 rake task 2018-01-23 18:48:06 +01:00
Sam 83a346cd68 FIX: migrate_from_s3 rake task not working 2018-01-22 11:42:09 +11:00
Régis Hanol b6c9d7a9d2 move requires to top of file 2018-01-19 17:51:42 +01:00
Régis Hanol 2d49250107 FIX: support recovering images using 'upload://' scheme 2018-01-19 15:40:17 +01:00
Joffrey JAFFEUX cc819539b0
FIX: makes rake qunit:test task work on macOS 2018-01-10 14:51:08 +01:00
Joffrey JAFFEUX 754fa3d2f5 FIX: facebook deprecated facebook messenger emojis 2018-01-05 11:01:23 +01:00
Gerhard Schlager 81427e26ea Ignore errors when remapping posts 2017-12-28 15:13:01 +01:00
Guo Xiang Tan 6f89db4c24 Re-enable check for yarn when running qunit:test rake task. 2017-12-22 09:11:49 +08:00
Guo Xiang Tan aabac55edd Better ENV name for QUnit's seed. 2017-12-21 09:47:32 +08:00
Guo Xiang Tan 4986132e1b Fix missing variable in smoke test rake task. 2017-12-20 14:49:41 +08:00
Guo Xiang Tan ca8e4dfb43 Allow seed to be passed via ENV. 2017-12-19 21:35:51 +08:00
Guo Xiang Tan 141a4a059d QUnit tests should be run in random order. 2017-12-19 21:33:31 +08:00
Guo Xiang Tan 349dc8da29 Disable check for yarn in qunit tests first. 2017-12-19 20:09:36 +08:00
Guo Xiang Tan 6a4f391e38 Switch to chrome headless mode instead of phantomjs. 2017-12-19 16:00:43 +08:00
Guo Xiang Tan 8d44642b97 Add smoke test script that runs in chrome headless. 2017-12-18 16:39:01 +08:00
Gerhard Schlager b15059418b FIX: rake task for updating posts received by email should not crash 2017-12-13 22:03:31 +01:00
Michael Brown 45c19e44f0 assets rake task: only try and detect brotli if COMPRESS_BROTLI is set 2017-11-24 12:00:38 -05:00
Michael Brown 5584085943 assets rake task: detect the brotli version on the image as the usage changes 2017-11-24 10:40:57 -05:00
Michael Brown 3c60702663 assets rake task: gzip and brotli exit codes exist for a reason - to be checked 2017-11-24 09:52:08 -05:00
Guo Xiang Tan 26d14dbcbb Remove onceoff job in migrate rake task. 2017-11-22 12:50:01 +08:00
Guo Xiang Tan edfa2c3af9 FIX: Don't enqueue onceoff job in migration.
* Deployment of app servers may happen minutes after migrations.
2017-11-22 12:07:48 +08:00
Robin Ward 966c7e7f07 FEATURE: Allow plugins to dynamically add seed fixture paths
This is useful if your plugin wants different seed data for different
locales for example.
2017-11-16 14:43:17 -05:00
Robin Ward 8cd0026cde FIX: If there is an invalid locale in the site setting, default to en 2017-11-16 10:58:29 -05:00
Vinoth Kanan d9823f69c6 FEATURE: Option to export multiple categories using export_category method 2017-11-11 19:11:16 +05:30
Vinoth Kannan a00af4d85a FEATURE: Rake task to export and import category structure 2017-11-01 17:17:05 +05:30
Arpit Jalan efbd923f60 Merge pull request #5261 from xrav3nz/fix-rebake-match-rake
FIX: `post:rebake_match` rake task
2017-10-25 10:22:56 +05:30
Kyle Zhao 82c18f6ca3 fix: undefined variable in `post:rebake_match` 2017-10-24 20:05:58 -04:00
Neil Lalonde 2c15e9c6fe FIX: search couldn't find tags from before 2017-08-25 2017-10-24 17:55:05 -04:00
Sam 4ea87b5ab8 Merge branch 's3_refactor' 2017-10-09 10:27:52 +11:00
Sam a8b4255bae Correct rule installation in AWS 2017-10-09 10:26:58 +11:00
Gerhard Schlager 1477a0e910 Adds a rake task for refreshing posts received via email
This is useful when the email_reply_trimmer gem was updated and you want to apply those changes to existing posts.
2017-10-06 14:29:11 +02:00
Sam 70bb2aa426 FEATURE: allow specifying s3 config via globals
This refactors handling of s3 so it can be specified via GlobalSetting

This means that in a multisite environment you can configure s3 uploads
without actual sites knowing credentials in s3

It is a critical setting for situations where assets are mirrored to s3.
2017-10-06 16:20:01 +11:00
Kyle Zhao 0342324b47 FEATURE: support regex in rake post:remap (#5201) 2017-10-04 11:47:53 +11:00
Sam 5b96463c40 in production there is no cached it seems 2017-10-03 18:27:09 +11:00
Sam ac01885b60 FEATURE: rake tasks for uploading assets to S3
This opens the door to serving application.js and so on from s3.

Also updates s3 gem for some tagging support
2017-10-03 18:00:53 +11:00
Arpit Jalan df09599531 FIX: use different method name for topic rake task
https://kevinjalbert.com/defined_methods-in-rake-tasks-you-re-gonna-have-a-bad-time/

cc @gschlager
2017-09-29 22:47:03 +05:30
Guo Xiang Tan 77d4c4d8dc Fix all the errors to get our tests green on Rails 5.1. 2017-09-25 13:48:58 +08:00
Gerhard Schlager e08b5feb8a improved status output during auto-closing and ignore deleted topic timers 2017-09-21 10:58:09 +02:00
Gerhard Schlager 26d10370c6 Adds a rake task for applying auto-close to old topics 2017-09-20 15:49:53 +02:00
Arpit Jalan 041ace5d3b new rake task to defer all flags 2017-09-15 16:42:58 +05:30
Arpit Jalan 18142d8abf new rake task to bake uncooked posts 2017-09-12 12:40:18 +05:30
darix 4b5724ec02 Extend config/version.rb with more informations (#5061)
This gives installations not using git checkouts
to provide all the informations needed for the
internal version checks and version display in
the dashboard.

The build:stamp rake task was extended to also
add the new informations.
2017-08-28 12:24:56 -04:00
Arpit Jalan 4623b46b0b rescue error when remapping permalinks 2017-08-28 20:43:40 +05:30
Sam 6e1809ce32 add a debugging task for running all schedules 2017-08-25 12:19:34 -04:00
Sam fef08c6fee FEATURE: rake db:stats
Basic rake task to provide db stats like largest tables, row count and size
2017-08-25 10:29:04 -04:00
Arpit Jalan 70f7a0ca1a new rake task to remap old phpbb links 2017-08-25 15:09:11 +05:30
David Taylor ed6e1c3825 Combine docker:lint and docker:test into one command 2017-08-22 13:47:29 +01:00
David Taylor a3f5878ec9 Use `if`, not `unless` 2017-08-18 22:12:20 +01:00
David Taylor 7704e8246b Allow SINGLE_PLUGIN environment variable to be used 2017-08-18 22:04:35 +01:00
David Taylor ea43f50f6d Add documentation for new ENV variables 2017-08-18 22:03:09 +01:00
David Taylor d65570a8a1 Preparation for using chrome for qunit in docker images (#5062)
Move use_chrome option to ENV variable
Rewrite script to work with node 6 (current LTS version used in discourse_docker)
Add node stuff to gitignore
2017-08-18 14:08:58 -04:00
Guo Xiang Tan 8ecf383c55 Extract linter in `docker:test` Rake task into `docker:lint`. 2017-08-18 12:22:01 +09:00
David Taylor c981edfa20 Add option to run qunit tests in headless chrome (#5054) 2017-08-16 07:42:42 -04:00
Guo Xiang Tan a1f60cfcb8 Fix incorrect test migration. 2017-08-10 00:20:07 +09:00
Guo Xiang Tan 2c39743d5d Introduce multisite tests for better coverage. 2017-08-08 12:58:22 +09:00
Arpit Jalan c0a2d9e671 Make rubocop happy 2017-08-04 12:30:35 +05:30
Arpit Jalan 687b05750b add Permalinks support for vBulletin bulk import script 2017-08-04 12:23:11 +05:30
Arpit Jalan 2d909f7894 new phpBB PostgreSQL bulk import script 2017-08-03 21:21:58 +05:30
David Taylor ea032d8372 Improve source code linting for continuous integration (#5017)
* Add rubocop linting to docker:test rake task

* Add eslint JS listing to plugin files, and add SKIP_LINT variable

* Fix failing ‘polls’ plugin eslint

Using eslint-disable-line, as is done in core qunit tests such as `acceptance/group-logs-test.js.es6`

* Add plugin test eslint to travis config

* Merge some eslint lines
2017-08-02 11:33:29 +09:00
Guo Xiang Tan 5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Robin Ward 5cfc2d8972 Run wizard specs in docker:test 2017-07-27 11:29:18 -04:00
Sam 2d41c5ed3c missing bracket 2017-07-26 13:11:08 -04:00
David Taylor 2c6ed64ebe Spawn a new rake process to run tests, so that LOAD_PLUGINS gets re-checked (#5001) 2017-07-26 12:54:56 -04:00
David Taylor febd7621ea Qunit plugin rake tasks (#4985)
* Allow running specific plugin tests using ENV variables

* Add a `rake plugin:qunit` task to match the existing `rake plugin:spec` task

* Improve docker.rake to allow running specific plugin qunit tests

* Purge cache before and after qunit tests

* Stop module auto-loader trying to auto-load tests

* Use URL query parameters to pass config into Qunit, avoiding caching issues

* Oops, searchParams doesn’t work in phantomJS. Parse the URL manually.

* Escape ampersands before passing URL to phantomJS, otherwise multiple parameters go wrong
2017-07-26 09:07:46 -04:00
Sam 400a55eca3 Merge pull request #4995 from davidtaylorhq/qunit-warmup
Improve “server warmup” check for qunit rake task
2017-07-25 11:39:32 -04:00
David Taylor 4ad864892b Improve “server warmup” check for qunit rake task 2017-07-25 16:31:30 +01:00
Sam 283d42d6f3 FEATURE: allow bisect and rspec seed 2017-07-25 11:09:51 -04:00
Régis Hanol c7c93e7159 FEATURE: new 'strip image metadata' site setting 2017-07-25 11:48:39 +02:00
Guo Xiang Tan dd932217ca Fix docker tests not loading plugins. 2017-07-25 15:27:09 +09:00
David Taylor 62604e9297 Allow docker test rake task to be used for single plugins (#4973)
* Allow docker test rake task to be used for single plugins
2017-07-21 09:59:54 +09:00