-
Notifications
You must be signed in to change notification settings - Fork 0
[CLEAN] Synthetic Benchmark PR #36020 - FEATURE: Add automation to remove uploads from deleted posts #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: base_pr_36020_20251204_9147
Are you sure you want to change the base?
[CLEAN] Synthetic Benchmark PR #36020 - FEATURE: Add automation to remove uploads from deleted posts #19
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
User description
Benchmark PR discourse#36020
Type: Clean (correct implementation)
Original PR Title: FEATURE: Add automation to remove uploads from deleted posts
Original PR Description: 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 runs it will permanently removes the uploads.
Example of automation run:
When the automation has run in this post, this will be the revisioned version:
Original PR URL: discourse#36020
PR Type
Enhancement
Description
Adds new automation script to remove upload markup from deleted posts
Implements batch processing with 1000 post limit per run
Integrates with clean_up_uploads job for permanent upload deletion
Includes comprehensive test coverage for recurring and point-in-time triggers
Diagram Walkthrough
File Walkthrough
scripts.rb
Register new upload cleanup automation scriptplugins/automation/lib/discourse_automation/scripts.rb
REMOVE_UPLOAD_MARKUP_FROM_DELETED_POSTSto scriptsregistry
plugin.rb
Configure batch size and register script fileplugins/automation/plugin.rb
REMOVE_UPLOAD_MARKUP_FROM_DELETED_POSTS_BATCH_SIZEconstant setto 1000
remove_upload_markup_from_deleted_posts.rb
Implement upload markup removal automation scriptplugins/automation/lib/discourse_automation/scripts/remove_upload_markup_from_deleted_posts.rb
markup from deleted posts
syntax
via custom field
uploads_removed_attimestamp to preventre-processing
remove_upload_markup_from_deleted_posts_spec.rb
Add comprehensive test coverage for automationplugins/automation/spec/scripts/remove_upload_markup_from_deleted_posts_spec.rb
point-in-time triggers
non-deleted posts
processing
permanent deletion
server.en.yml
Add localization strings for automationplugins/automation/config/locales/server.en.yml
caution