Closed Bug 880188 Opened 11 years ago Closed 11 years ago

Parse existing apps manifests to fill developer name field in the app

Categories

(Marketplace Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED
2013-06-13

People

(Reporter: mat, Assigned: mat)

References

Details

In bug 785125 we are going to add a new field to the addon model, which contains the developer name. It will be pulled from the manifest during submission / manifest refresh.

We need to take care of existing apps after bug 785125 is done, and we're doing this here.

Quoting Wil, what we need to do is:
- Writing a script to parse all existing manifests looking for a "developer" field and copying it to our database
Assignee: nobody → mpillard
Depends on: 785125
Priority: -- → P2
Does this need to be a separate script?  If the developer name is pulled from the manifest during a refresh like you said (which it should) then we just need to do a force-refresh on all manifests (there is a button for it in /admin) and they will update?
(In reply to Andrew Williamson [:eviljeff] from comment #1)
> Does this need to be a separate script?  If the developer name is pulled
> from the manifest during a refresh like you said (which it should) then we
> just need to do a force-refresh on all manifests (there is a button for it
> in /admin) and they will update?

That's a good point. Does the force refresh also works on packaged apps though? If it does, then yes, I think we don't need that extra script.
(In reply to Mathieu Pillard [:mat] from comment #2)
> (In reply to Andrew Williamson [:eviljeff] from comment #1)
> > Does this need to be a separate script?  If the developer name is pulled
> > from the manifest during a refresh like you said (which it should) then we
> > just need to do a force-refresh on all manifests (there is a button for it
> > in /admin) and they will update?
> 
> That's a good point. Does the force refresh also works on packaged apps
> though? If it does, then yes, I think we don't need that extra script.

Just hosted.  So I suppose this is script would just be for packaged apps then.
We have a similar script we wrote for "update_features" you can steal from to make it easier if you'd like.

The management command and query:
https://github.com/mozilla/zamboni/blob/master/apps/addons/management/commands/process_addons.py#L54-L59

The task:
https://github.com/mozilla/zamboni/blob/master/mkt/webapps/tasks.py#L353

Except you'll need to get the manifest from the zip file. An example of that is done in the supported locales script here:
https://github.com/mozilla/zamboni/blob/master/mkt/webapps/tasks.py#L248
and
https://github.com/mozilla/zamboni/blob/master/mkt/webapps/models.py#L823
okay, from talking on irc...
* packaged apps need to migrated with this script
* hosted apps will be also need to migrated with a script because the normal refresh method would re-review flag *every* app because they would all have an empty name.
* Once the migration has taken place an sql script will be run to get a dump of all apps to sense check their developer names look valid, and to investigate further any suspicious ones.  The output will contain (id, app slug, app name, developer name, first listing owner's email address)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
link to the commit?
Flags: needinfo?(mpillard)
https://github.com/mozilla/zamboni/commit/2bacd206deee3c8f1ccacd1a1f5d9e038b364ffa

We ran it on -dev and it seemed to work.
Flags: needinfo?(mpillard)
Target Milestone: --- → 2013-06-13
I can confirm that the script changed developer names for all existing apps. See https://marketplace-dev.allizom.org/app/test-app-baubau2?src=search
Status: RESOLVED → VERIFIED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.