Commit graph

18 commits

Author SHA1 Message Date
Chlod Alejandro def1219fda
Add more details to post-delete page
This adds the following to the post-delete page:
* Number of pages queued for deletion (or deleted immediately)
* Username, talk page link, and Special:Block link for the target
  (if the target is a user)
* Number of pages not queued for deletion (i.e. skipped)
* List of pages not queued for deletion

This adds relevant tests, and also modifies the "uploadTestFile"
utility function, which now randomizes file name to ensure that
files uploaded by users regardless of title are also deleted.

Bug: T364223
Bug: T364225
Change-Id: I60cf1a1c54cdaa3ae4570b4d2bef7e7cf39b47e5
2024-11-20 23:13:56 +08:00
jenkins-bot 7cfed13f4f Merge "Make Nuke tag translatable" 2024-11-14 15:33:32 +00:00
Chlod Alejandro a5e92ffbfd
Make Nuke tag translatable
Adds `tag-nuke` and `tag-nuke-description` messages for user in
Special:Tags and changes the canonical tag name to "nuke" instead
of "Nuke".

Bug: T379168
Change-Id: Ic8846781cdac3bf08c6733f39d0cc5988fb09f6a
2024-11-14 00:52:11 +08:00
Chlod Alejandro 41d31c3076
Use revision table instead of recentchanges
This switches Nuke over to using the `revision` table instead
of `recentchanges`, allowing a wider timespan of pages to be
deleted. As a DoS prevention measure, this adds the
`$wgNukeMaxAge` config option (defaulted to the value of
`$wgRCMaxAge`) and a max execution time for the SELECT
(set to `$wgMaxExecutionTimeForExpensiveQueries`).

This also adds a relevant test.

Partially based off of I6c2b7e6b695d58a7dcba93ccaeba9ed35d81cf80.

Bug: T379147
Co-Authored-by: Kgraessle <kgraessle@wikimedia.org>
Change-Id: I5d68d2663751783bcc773799e951f74866ceb722
2024-11-13 02:14:03 +08:00
Kosta Harlan f1d53c8244
SpecialNuke: Display username next to pages for temp accounts
Why:

- When deleting pages created by temporary accounts via inputting an IP
  address, it's useful to see which temporary accounts were involved in
  creating the pages. This is currently not displayed because
  $row->rc_user_text is not set

What:

- Fetch the actor_name field unconditionally
- Display the page using the actor_name field
- Update tests for the change

Bug: T342785
Change-Id: Ic4112985874343ede78c4571bdfccc58977c5345
2024-10-28 21:06:57 +01:00
jenkins-bot dd5715525e Merge "Tag deletion logs performed with Nuke" 2024-10-22 03:38:45 +00:00
jsn 98aa8d9942
Enable temp account lookup by IP address
- Adds a soft dependency on CheckUser
- Lists pages created by IP user or temp acccounts associated with IP
  address when the lookup is available

Bug: T342785
Depends-On: I45a18f1fcf1a17bdaeefabebcd2f67a946a2cc2e
Change-Id: Idcdd7d787180e8e99fdcbe856e4fc237d9721824
2024-10-21 10:18:32 +02:00
Kgraessle e42a881976 Tag deletion logs performed with Nuke
Bug: T366068
Change-Id: I3455fab45698884d0b32f0065aaaf9fe7c0c6916
2024-10-17 08:53:59 -05:00
Kosta Harlan 3bc28520af
HooksTest: Add missing service argument to SpecialContributions
Change-Id: Ic071120172bf139af9c9d32a7966cd8b0b57cc7c
2024-10-17 13:25:18 +02:00
Matěj Suchánek 68269df6ea Use SpecialPageFactory in SpecialNukeTest
Core's SpecialLog is not @newable, therefore the constructor
may change without notice (which has apparently happened
in 07db710).

Change-Id: I91964bcd787201c89c5eb6f623daba86d8d28d3e
2024-08-12 18:59:44 +02:00
Chlod Alejandro a0eb145847
Add tests for hook handler
This *should* get Nuke to 100% line coverage now.

Also moves SpecialNukeTest to an integration/ subfolder, and makes
applicable changes, since there's now two integration tests.

Follow-Up: Ic15d4431dc8509ac2732ebce7517522e27d8f5a3
Change-Id: I4355b12647cb1a4cc163467d23166d7fa1aade9e
2024-05-22 01:25:05 +08:00
Chlod Alejandro 19c6fb0125
Add more tests
- Add tests to reach 100% coverage
- Ignore some methods which are simple enough
- Change some tests to fit with the new ones

Change-Id: Ic15d4431dc8509ac2732ebce7517522e27d8f5a3
2024-05-13 15:30:08 +08:00
suecarmol 1aee0f10e8 Add tests to Nuke
Added more tests to Nuke

Bug: T315761
Change-Id: Iaf23e4eda040d446c3ad4518d2d47d26385592f4
2024-05-05 14:47:02 +03:00
Seb35 fb60b51cd8
Permit spaces in the SQL LIKE pattern
The search is against the MediaWiki-DB-encoded title (with '_' for space
and initial uppercase letter): these constraints are converted in this
patch to let the user use MediaWiki-displayed titles if they want.

It was taken care about of the configuration-specific case where some
namespaces are first-case-insensitive but other namespaces are first-case-
sensitive, by partitioning the namespace space into to distinct spaces.

Bug: T234726
Co-authored-by: Chlod Alejandro <chlod@chlod.net>
Change-Id: Id83832c256660b691a896113c98641700ed02707
2024-05-04 16:15:24 +03:00
Bartosz Dziewoński 80bdcd3004 Restore support for matching 'LIKE' patterns/wildcards
Follow-up to 910ce4c870.

Add a test so that we don't break this again.

Bug: T355478
Change-Id: I98620dd66a3c3a6913f999d6f96eef0ef69271d1
2024-01-22 11:30:50 +00:00
Umherirrender fc111cb213 tests: Add basic test for HookRunner
Add a basic unit test for HookRunner to improve coverage and
validate arguments between hook runner and hook interfaces.

Change-Id: I3cb332abf9aefbb1cb435188cbf5938f4bcda0c5
2023-05-31 23:17:39 +02:00
Matěj Suchánek 1f3dd54dfc Migrate to new phan
Bug: T216929
Change-Id: I76a095438571132118aeed0a98657367b4ee5e42
2019-02-25 09:27:00 +01:00
Kunal Mehta f9d7a47243 Add configuration for phan
Change-Id: I4103d96b0701ddc9ef7cafc57b1b5d375f3b835f
2018-02-16 15:48:38 +00:00