Skip to content

Update actions where needed#12226

Merged
mekarpeles merged 5 commits intointernetarchive:masterfrom
jimchamp:event-names
Apr 15, 2026
Merged

Update actions where needed#12226
mekarpeles merged 5 commits intointernetarchive:masterfrom
jimchamp:event-names

Conversation

@jimchamp
Copy link
Copy Markdown
Collaborator

Addresses #11955
Supplants #12058

Updates most save, save_many, and Thing._save calls to include a valid and accurate action. Updates to actions in addbook.py are included in #12210.

We may also want to update the default save and save_many values in Infogami. This PR does that. When merged, we can check the /recentchanges views for the default types to determine if any transaction needs an action.

Technical

Testing

Screenshot

Stakeholders

Copilot AI review requested due to automatic review settings March 31, 2026 00:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 many save / save_many / _save calls 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_data to require an action and 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.

Comment thread openlibrary/plugins/openlibrary/lists.py
Comment thread openlibrary/plugins/openlibrary/lists.py Outdated
Comment thread openlibrary/plugins/openlibrary/api.py Outdated
@mekarpeles mekarpeles merged commit e541be4 into internetarchive:master Apr 15, 2026
3 checks passed
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>
@jimchamp jimchamp deleted the event-names branch April 23, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants