Update actions where needed#12226
Merged
mekarpeles merged 5 commits intointernetarchive:masterfrom Apr 15, 2026
Merged
Conversation
for more information, see https://pre-commit.ci
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves transaction metadata consistency across OpenLibrary by updating save, save_many, and Thing._save call sites to include explicit, descriptive action values. This supports more accurate downstream analytics and auditing (e.g., /recentchanges and participation-score-related instrumentation tied to #11955).
Changes:
- Added explicit
action=...values to manysave/save_many/_savecalls across scripts and plugins. - Refined certain actions to be more specific (e.g., distinguishing list/series creation, bulk operations, and various edit flows).
- Updated
User.set_datato require anactionand ensured its call site supplies one.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/update_stale_ocaid_references.py | Adds an explicit bulk action for redacting stale edition OCAIDs. |
| openlibrary/plugins/upstream/covers.py | Adds actions for updating book covers and author photos. |
| openlibrary/plugins/upstream/code.py | Adds actions to revert flows to label revert transactions. |
| openlibrary/plugins/upstream/addtag.py | Adds actions for tag edit vs tag delete saves. |
| openlibrary/plugins/openlibrary/lists.py | Replaces generic "lists" action with more specific list/series actions. |
| openlibrary/plugins/openlibrary/code.py | Adds actions to sampleload, author creation, and YAML edit save paths. |
| openlibrary/plugins/openlibrary/bulk_tag.py | Adds an action for bulk work tagging saves. |
| openlibrary/plugins/openlibrary/api.py | Adds actions for bulk deletion and for OCAID removal edits. |
| openlibrary/plugins/admin/code.py | Adds actions for spam-revert deletes, stats saves, blocked IP updates, and permission edits. |
| openlibrary/core/models.py | Requires action for User.set_data and adds actions to usergroup membership and tag creation saves. |
| openlibrary/catalog/add_book/init.py | Differentiates add-book vs edit-book actions based on whether an edition already exists. |
| openlibrary/accounts/model.py | Updates anonymization flow to supply an action when clearing a patron profile. |
mekarpeles
reviewed
Apr 15, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
jack-wines
pushed a commit
to jack-wines/openlibrary
that referenced
this pull request
Apr 18, 2026
* Update actions where needed We may need an update for addbook.py (savemany w/ bulk-update); currently saves authors, editions, and works (summary in UI should probably be augmented by transaction_details). Transaction_details for transactions we fetch should almost certainly be cached -- i.e. synthesized commit msgs from `transaction_details` will go in cache... It would be nice if we had a cached function that could accept a list of transaction IDs and fetch all details or synthesized commit messages in one call -- i.e. `cached_transaction_details(list_of_txids) -> dict of commit_msgs. * we *hope* this should track series and list updates distinctly Co-authored-by: Mek <michael.karpeles@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #11955
Supplants #12058
Updates most
save,save_many, andThing._savecalls to include a valid and accurateaction. Updates to actions inaddbook.pyare included in #12210.We may also want to update the default
saveandsave_manyvalues in Infogami. This PR does that. When merged, we can check the/recentchangesviews for the default types to determine if any transaction needs anaction.Technical
Testing
Screenshot
Stakeholders