internetarchive / internetarchive/openlibrary
Bulk Tagger: Dry-run mode
- Dominant language
- Python
- Stars
- 6.7k
- Forks
- 2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 138
Description
### 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](https://github.com/internetarchive/openlibrary/blob/7e32e7f1bdbb7e2c7ae8408bedd077ee5a2de68f/openlibrary/plugins/openlibrary/bulk_tag.py#L12).
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 `POST`ing changes if we need to engage dry run mode. The bulk tagger form is rendered client-side, by [this method](https://github.com/internetarchive/openlibrary/blob/7e32e7f1bdbb7e2c7ae8408bedd077ee5a2de68f/openlibrary/plugins/openlibrary/js/bulk-tagger/index.js#L6).
### Stakeholders
Contributor guide
Research direction
Start with the bulk-tagging POST handler in openlibrary/plugins/openlibrary/bulk_tag.py and the client-rendered form in openlibrary/plugins/openlibrary/js/bulk-tagger/index.js. Trace how the form submits its fields and inspect the existing history diff views for reusable behavior. Done means the form includes a falsey dry_run input and dry-run requests avoid catalog edits while showing the original and updated work states.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, python
- Domain
- backend, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100