Commit Graph

36 Commits

Author SHA1 Message Date
Peter Bhat Harkins 2332d28022 bump gems except commonmarker (#1234)
lot of irritating churn out of standardrb here
2023-12-28 19:26:56 -06:00
Peter Bhat Harkins b45d175083 add brakeman
Wrote ignore notes and specs for the security assumptions implied.
Removed TZ from moderations table; everything is Chicago time, best time.
2023-12-17 20:22:47 -06:00
Peter Bhat Harkins 237e219116 standardrb: add standard-sorbet 2023-09-14 08:45:21 -05:00
Peter Bhat Harkins c3f8625788 standardrb
I can't take Rubocop any more. Moving up to Ruby 3 forces us to update RuboCop,
and it comes with dozens of linters that I'd have to evaluate, none of which is
a marginal improvement. I'm done having opinions.
2023-09-08 15:39:50 -05:00
Peter Bhat Harkins 2e268e40d7 wrong place 2022-08-11 00:31:27 -05:00
Peter Bhat Harkins f3bcbb107e fit bounds 2022-08-11 00:24:47 -05:00
Peter Bhat Harkins 7e0434afe8 fake tag descs 2022-08-06 07:39:57 -05:00
Jason Maa 604d00f8c1
Fix #1087: Add unban reason to fake data (#1089) 2022-06-01 11:13:02 +00:00
Peter Bhat Harkins 344e947374 Fix fake_data task; add CI test for it (#1087)
The test is overdue for how brittle fake_data.rb is, but as that's a slow
process that's not critical functionality, I only want it running on CI.
2022-06-01 05:57:18 -05:00
William Karsten 36cee94b69
Fix the fake data bugs & add progress bar (#1086) 2022-05-26 01:17:29 +00:00
Three Planets Software 5113d0bb11
Update fake_data script to help troubleshoot flags. (#924)
* Update fake_data to create test Categories and pass those in to
new tags when created. Does not use find_and_create_by! for new
Tags since that could attempt to create another tag with the same
name if the random Category is different.

Update fake_data to use the newer Faker::Lorem syntax, specifying
the parameter name in .sentences() and .paragraphs().

* Update fake_data script to help troubleshoot flags.
Create users that are admins, as well as moderators.
Flag comments and stories from random users.
Add user karma and invite heirarchy.

* Add more realistic data, such as stories with links and text,
saved stories, user moderation, and hat moderation.

Signed-off-by: Three Planets Software <threeplanetssoftware@users.noreply.github.com>

* Add moderation of stories (merging and deleting) to fake data.

* Add story title edits to moderation fake data.

* Update fake_data to store comments and stories in Arrays, instead of
calling the database. Set default values for the generator method.

* fix merge conflicts

* rubocop

Co-authored-by: Peter Bhat Harkins <pushcx@users.noreply.github.com>
2022-05-18 14:53:29 +00:00
Diep Pham b54d351021 fake_data try to add comments to deleted stories
Following error happens when running fake_data task:

> ActiveRecord::RecordInvalid: Validation failed: Story is no longer accepting comments.

The fix is do not create deleted stories with is_deleted: true
immediately, but delete them after adding comments.
2022-03-30 13:08:26 +00:00
Peter Bhat Harkins dba88ba6c8 Story: rename expired -> deleted to match usage 2022-02-08 22:20:41 -06:00
Peter Bhat Harkins 8fe3a7f248 /about: explain new user restrictions; better error messages 2022-01-29 10:53:31 -06:00
Dorian Marié cc19708575
rake fake_data - generate old enough accounts (#981) 2021-05-18 17:11:01 +00:00
Peter Bhat Harkins 9855628bcd needed in staging 2021-01-16 15:57:39 -06:00
Alan Post 59bb7b5b42 s/dail/daily/ for daily_maintenance task. 2020-08-28 18:41:13 -06:00
Peter Bhat Harkins 54bfa4991f ReadRibbon perf polishing
Production has 2.4M records; the first run of this will drop 1.3M.

.touch uses a transaction to touch ReadRibbon timestamp; switch to a method
that doesn't do that (or callbacks or validations).
2020-08-28 07:27:36 -05:00
Three Planets Software 59b15fbfa5
fake_data: create test Categories; lorem updates (#916) 2020-08-27 23:47:27 +00:00
Alessandro Minali 8a70b1abc1
Update deprecrated Faker params (#881) 2020-07-14 00:18:03 +00:00
Peter Bhat Harkins 0a5b1b1023 add stats page 2020-07-03 18:29:24 -05:00
Diep Pham cc354393ad
fix fake_data failed at User.is_new? validator (#824) 2020-03-02 18:49:29 -08:00
Mark Billie 8c88876a3a fake_data: add mods and comments actions (#777) 2019-10-30 06:08:47 -07:00
Mark Billie f5f19c0532 add replying comments and deleted stories (#767) 2019-10-23 18:06:36 -07:00
Nikhil Jha 9ed740767d Fake Data: Hats, Comments 2019-01-16 08:11:08 -06:00
Peter Bhat Harkins 79b6a2b69c don't 500 if a user banned/deleted before server move tries to log in
Also add a rake task documenting what jcs did before the server move.
(Though ModNote is new since then.)
2018-11-08 10:56:20 -06:00
Peter Bhat Harkins 759aaf12aa fix bugs in fake_data task, improve safety warnings
I don't see a reason for this to delete everything first, so I touched up the
workflow to provide a warning instead of an error.

Merge #484
2018-05-03 10:21:28 -05:00
Peter Bhat Harkins bf4327de49 rubocop: Layout/AlignParameters, 708
Seriously considered renaming vote_thusly_on_story_or_comment_for_user_because
just becaues of how many weird linewraps it causes.
2018-03-17 14:06:21 -05:00
Peter Bhat Harkins b1f83f545f rubocop: Layout/SpaceBeforeBlockBraces and SpaceInsideBlockBraces, 2977 2018-03-16 16:41:09 -06:00
Peter Bhat Harkins 98adf81867 rubocop: Lint/Unused*, 3365 2018-03-02 07:19:50 -06:00
Chun Li 3bcc33b906 Add text-only stories to fake_data task
For #414
2017-11-28 10:41:58 -05:00
Andrey Chernih 9e849de0f7 Add task to generate test data 2014-07-07 12:15:28 +04:00
joshua stein 9b5ab9b978 try really hard to convert inbound mail to utf8 2014-01-07 11:42:21 -06:00
joshua stein c9571dabaf back out 9ece666 removing utf8mb4 hacks, no longer needed 2013-05-26 12:32:54 -05:00
joshua stein 9ece6666bf add stupid temporary hack to strip out utf8mb4 chars that are screwing up mysql
4-byte utf8 chars like emoji are passed around in ruby fine, but
when they are put into mysql queries, strings get truncated at the
first mb4 character.  to prevent truncation, strip out mb4
characters in most user-controlled fields like comments, story
descriptions and titles, and messages.

to properly support utf8mb4, mysql server 5.5 is needed, the table
encodings need to be changed to utf8mb4, and the mysql2 gem needs to
be upgraded once it supports utf8mb4:

https://github.com/brianmario/mysql2/issues/249
2012-11-07 21:58:10 -06:00
joshua stein 72b67b0103 move monkey patches to a separate file 2012-10-24 14:55:14 -05:00