+initseries calls deriveDistroSeries() with incorrect arguments
Bug #753249 reported by
Steve Kowalik
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Gavin Panella |
Bug Description
While testing +initseries on dogfood, I noticed the JSON encoded data passed to DistributionJob was incorrect.
packagesets and arches are treated specially and need to be passed to deriveDistroSeries as tuples. For example: arches=('i386', 'amd64'), packagesets=().
Related branches
lp:~allenap/launchpad/deriveDistroSeries-json-weirdness-bug-753249
- Gary Poster (community): Approve
-
Diff: 117 lines (+51/-22)2 files modifiedlib/lp/app/javascript/client.js (+12/-8)
lib/lp/app/javascript/tests/test_lp_client.js (+39/-14)
Changed in launchpad: | |
assignee: | nobody → Gavin Panella (allenap) |
status: | Triaged → In Progress |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Locally, I applied the following patch to devel:
{{{ registry/ javascript/ distroseries. js' registry/ javascript/ distroseries. js 2011-03-29 20:13:28 +0000 registry/ javascript/ distroseries. js 2011-04-07 10:01:44 +0000
"Copy Source and Rebuild") JSON.stringify( config, null, 4)); Choice. get("value" );
this. client. named_post(
parent, "deriveDistroSe ries", config);
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -716,6 +716,7 @@
}
};
+ alert(Y.
var parent = this.deriveFrom
=== modified file 'lib/lp/ registry/ model/distroser ies.py' registry/ model/distroser ies.py 2011-04-04 01:42:16 +0000 registry/ model/distroser ies.py 2011-04-07 10:09:34 +0000
description= None, version=None,
architectures= (), packagesets=(), rebuild=False):
--- lib/lp/
+++ lib/lp/
@@ -1939,6 +1939,8 @@
"""See `IDistroSeries`."""
+ from pprint import pprint
+ pprint(vars())
# XXX StevenK bug=643369 This should be in the security adapter
# This should be allowed if the user is a driver for self.parent
# or the child.parent's drivers.
}}}
I added a few packagesets:
{{{ Distribution, name=u' ubuntu' ).one() u"warty" ) makePackageset( u"britney" , distroseries=ds) makePackageset( u"spears" , distroseries=ds) commit( )
$ bin/harness
>>> d = store.find(
>>> ds = d.getSeries(
>>> factory.
>>> factory.
>>> transaction.
}}}
Then, on https:/ /launchpad. dev/deribuntu/ deriwarty/ +initseries, I
chose to derive from ubuntu/warty and selected all the available
architectures and packagesets. I got the following JSON from both
Firefox 4 and Chromium:
{
"distribution" : "https:/ /launchpad. dev/api/ devel/deribuntu",
"architectures ": [
"packagesets" : [
"britney" ,
"spears"
"on": {},
"parameters": {
"name": "deriwarty",
"hppa",
"i386"
],
],
"rebuild": false
}
}
Server-side, at the top of deriveDistroSeries, vars() gives (slightly
edited):
{'architectures': [u'hppa,i386'], spears' ],
'description': None,
'displayname': None,
'distribution': <Distribution 'Deribuntu' (deribuntu)>,
'name': u'deriwarty',
'packagesets': [u'britney,
'rebuild': False,
'self': <DistroSeries u'warty'>,
'summary': None,
'title': None,
'user': <Person at 0xb60d0d0 name16 (Foo Bar)>,
'version': None}
Then I tried again, with no architectures or packagesets selected, and
got:
{
"distribution" : "https:/ /launchpad. dev/api/ devel/deribuntu",
"architectures ": [],
"packagesets" : [],
"on": {},
"parameters": {
"name": "deriwarty",
"rebuild": false
}
}
Server-side:
{'architectures': [u''],
'description': None,
'displayname': None,
'distribution': <Distribution 'Deribuntu' (deribuntu)>,
'name': u'deriwarty',
'packagesets': [u''],
'rebuild': False,
'self': <DistroSeries u'warty'>,
'summary': None,
'title': None,
'user': <Person at 0x9203e50 name16 (Foo Bar)>,
'version': None}
I'm not sure what is causing that empty string to be added. My
suspicious is that it's lazr.restf...