internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.1k stars 1.33k forks source link

Bulk Tagger: Dry-run mode #8657

Open jimchamp opened 9 months ago

jimchamp commented 9 months ago

Describe the problem that you'd like solved

We recently encountered a number of issues related to updating a work's subjects. It was difficult to pinpoint exactly where the issue was occurring. If the bulk tagger had some type of "dry-run" mode that prevented actual edits to the catalog, we could have had an easier time troubleshooting the problem.

Proposal & Constraints

Add a "dry-run" mode to the bulk tagging POST handler. If dry-run mode is engaged, do not save any subject changes to the catalog. Instead, display a diff view which shows the original state of the work and the updated state. This view should be similar to the history diff views, reusing that code if possible.

Additional context

The POST handler for the bulk tagger is here.

For now, add a hidden input with the name dry_run to the bulk tagger form, and give it a falsey value. We can modify this before POSTing changes if we need to engage dry run mode. The bulk tagger form is rendered client-side, by this method.

Stakeholders

jimchamp commented 8 months ago

@xonx4l please stop linking to the issue in your commit messages.