-
Notifications
You must be signed in to change notification settings - Fork 552
Log name|summary changes in more detail #23725
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
Log name|summary changes in more detail #23725
Conversation
50dddd8
to
4a6c0ac
Compare
FYI you can link directly to the swagger and API calls can be made easily via the browser. http://olympia.test/api/v5/swagger/#/addons/addons_addon_partial_update |
This also works in dev (soon prod) |
It's not easy to tell where one screenshot ends and another starts - some text labels would help break the images. But I think from what I see it's because you're trying to update a field that requires a object with a string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've verified the main flow, we can verify further on stage if we want to.
What is the "main flow"? Do you mean you've verified it works, with both the API and devhub? |
Responded offline. I was able to verify the patch according to the steps. I only ran into issues inspecting the activity logs via the djshell. I was able to see the first log for an addon, but after making further changes to name/description I still only saw the one log. |
it's |
* Log name|summary changes in more detail * fix tests for nondeterministic ordering * store removed, added strings in arguments instead
* Log name|summary changes in more detail * fix tests for nondeterministic ordering * store removed, added strings in arguments instead
Fixes: mozilla/addons#15742
Description
Name and summary addon metadata changes create
EDIT_ADDON_PROPERTY
activity logs, with the added and removed localized strings in a json blob in the arguments (not displayed).A simple name change from
en-US
:good add-on
toen-US
:bad add-on
would result in the following activity log record:action =
amo.LOG.EDIT_ADDON_PROPERTY.id
arguments =
[<Addon: id>, 'name', '{"added": ["bad add-on"], "removed": ["good add-on"]}']
or in the database:
action =
208
arguments =
'[{"addons.addon": 1}, {"str": "name"}, {"str": "{\\"added\\": [\\"bad add-on\\"], \\"removed\\": [\\"good add-on\\"]}"}]
Added and removed are de-duplicated lists, and if a localized string hasn't changed it won't be included.
Context
I originally intended to replace
EDIT_PROPERTIES
everywhere, and create seperateEDIT_ADDON_PROPERTY
logs for each property change but ran into some difficulties with the devhub form (localized fields weren't being returned in changed_fields property) so, given the priority on the issue, limited the change toname
andsummary
- and added the same limitation toAddonSerializer
for consistency.Testing
In devhub, edit the name (or summary) of an add-on with listed versions in en-US locale and save the form
check:
details
json blob contains the old and new names (or summaries) for theEDIT_ADDON_PROPERTY
activityrepeat via the API, by submitting a PATCH to the addon endpoint, changing the name (or summary)
repeat the checks:
details
json blob contains the old and new names (or summaries)Optional further testing:
EDIT_PROPERTIES
is used for other properties, and name/summary in add-ons without listed versions.Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.