discourse/plugins/automation
Gabriel Grubba 1fba925cfb
FEATURE: Add automation to remove uploads from deleted posts (#36020)
This PR introduces a new automation script that removes uploads attached
to deleted posts.

Using this automation will add a revision to deleted posts by the System
User, removing the upload or attachment references. This Automation goes
a 1000 by every run and does not re-run on already ran posts

When the automation cleans the posts, uploads will no longer have
reference to the post and on the next time the [clean up uploads
job](f413e1b0de/app/jobs/scheduled/clean_up_uploads.rb (L1-L79))
runs it will permanently removes the uploads.

Example of automation run:

```
 Hey it is a regular post with a link to [Discourse](https://www.discourse.org) 
 and an image: ![logo.png|100x200](upload://gj6GJHlc1Sa5YXuGz549oXBbcFv.png)
 and a file: [small.pdf|attachment](upload://3bWzVVoRhUXxi7tiPenInoebHyX.pdf) (130 Bytes)
```
When the automation has run in this post, this will be the revisioned
version:

```
 Hey it is a regular post with a link to [Discourse](https://www.discourse.org) 
 and an image:
 and a file: 
```

---------

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2025-11-18 14:21:03 -03:00
..
admin/assets/javascripts DEV: Update lint-config and apply autofixes (#35991) 2025-11-12 14:48:49 +01:00
app DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
assets FIX: Improve automation on/off toggle (#33482) 2025-08-14 10:16:20 +03:00
config FEATURE: Add automation to remove uploads from deleted posts (#36020) 2025-11-18 14:21:03 -03:00
db FEATURE: Add automation statistics tracking to Automation (#31921) 2025-03-21 12:53:26 +11:00
lib FEATURE: Add automation to remove uploads from deleted posts (#36020) 2025-11-18 14:21:03 -03:00
spec FEATURE: Add automation to remove uploads from deleted posts (#36020) 2025-11-18 14:21:03 -03:00
test/javascripts/integration/components DEV: Restore qunit testing for plugins with only gjs files (#36046) 2025-11-14 17:20:59 +00:00
package.json DEV: Overhaul typechecking configuration (#35794) 2025-11-12 12:54:34 +00:00
plugin.rb FEATURE: Add automation to remove uploads from deleted posts (#36020) 2025-11-18 14:21:03 -03:00
tsconfig.json DEV: Overhaul typechecking configuration (#35794) 2025-11-12 12:54:34 +00:00