[00:14] <lifeless> bigjools: ... thunderbird
[00:14] <lifeless> bigjools: it did, then it stopped ;)
[00:14] <bigjools> yeah I just remembered that :)
[00:15] <lifeless> ;)
[01:14] <danilos> wgrant, hi, I wonder what's going on with db-stable r11611 rollout: LPS indicates it's out, but it's not merged yet in stable/devel
[01:15] <StevenK> danilos: It will not be until it's deployed
[01:15] <StevenK> danilos: Let me check
[01:15] <danilos> wgrant, https://wiki.canonical.com/InformationInfrastructure/OSA/LaunchpadProductionStatus lists it in 'past deployments'
[01:17] <StevenK> danilos: Your DB patch is r11610, and the next deployment for tonight is r11615, which includes your patch.
[01:18] <wgrant> danilos: Sorry, I forgot to merge it
[01:18] <wgrant> danilos: Doing now
[01:18] <wgrant> danilos: It was deployed 12 hours ago
[01:18] <danilos> wgrant, ah, ok, that explains it, thanks
[01:18] <StevenK> Ah, so up next is my patch.
[01:18] <danilos> wgrant, no worries, sorry for being pushy :)
[01:18] <wgrant> Thanks for the reminder.
[01:25] <wgrant> danilos: That's landed.
[01:25] <wgrant> danilos: You can now land the code removal
[01:25] <danilos> wgrant, cool, thanks
[01:26] <StevenK> wgrant: I might up put up my builder.description destruction branch then
[01:26] <danilos> wgrant, except that I can't (at least not that I know, if I can, woohoo and "how"), but I can ask someone to do that for me :)
[01:26] <StevenK> danilos: Bug lifeless about emeritus
[01:26] <wgrant> StevenK: Hm?
[01:26] <wgrant> StevenK: Which branch?
[01:27] <lifeless> StevenK: danilos: I think danilos is already in emeritus, isn't he?
[01:27] <lifeless> and yes, emeritus can lnad
[01:27] <lifeless> *land*
[01:27] <StevenK> wgrant: The one that drops builder.description from the code since the DB patch to DROP NOT NULL is up next.
[01:27] <lifeless> while they are still @ canonical
[01:27] <wgrant> Can by policy, but you have to be in the keyring...
[01:27] <wgrant> StevenK: Right, can't land for another 9 hours, though
[01:27] <StevenK> wgrant: Sure, what I meant was "Actually push and put up for review"
[01:28] <wgrant> Right
[01:28] <wgrant> Makes sense
[01:28] <wgrant> Thought that was already done, in fact.
[01:28] <StevenK> steven@undermined:~/launchpad/lp-branches/drop-builder-description% utilities/rocketfuel-mp-status .
[01:28] <StevenK>  * .
[01:29] <StevenK>    - Remote branch is up to date
[01:29] <StevenK> Hm, it seems you're right.
[01:29] <danilos> lifeless, ah, cool, so I have to worry myself about running the full test suite, and then can pqm-submit? (how is ec2 test used these days?)
[01:30] <lifeless> danilos: ec2 land is still used, its unchanged
[01:30] <wgrant> Well
[01:30] <lifeless> danilos: it lives in lp-dev-tools now
[01:30] <wgrant> It's in lp:lp-dev-utils
[01:30] <lifeless> bah utils
[01:30] <wgrant> Rather than utilities/
[01:30] <wgrant> But otherwise the same.
[01:30] <wgrant> In the branch, 'ec2 land'
[01:30] <danilos> ah, ok
[01:33] <StevenK> wgrant: https://code.launchpad.net/~stevenk/launchpad/drop-builder-description/+merge/107698 would enjoy your review
[01:35] <wgrant> StevenK: Can you use the factory to replace most of create_builder?
[01:36] <wgrant> Most or all
[01:36] <StevenK> It would end up looking pretty much the same, and the doctest already wants IBuilderSet
[01:36] <wgrant> factory.makeBuilder(name='hamburger', processor=i386, virtualized=True)
[01:36] <wgrant> No helper required
[01:38] <StevenK> wgrant: Although that points I missed out fixing factory.makeBuilder() :-)
[01:51] <StevenK> wgrant: Diff updated, can you have another look?
[02:44] <lifeless> wgrant: hey, you know what? We don't need that private API for sso anymore
[02:45] <lifeless> wgrant: not with your new regular API method
[03:07] <wgrant> lifeless: For performance I think we do.
[03:08] <lifeless> wgrant: two in-dc calls vs 1 ?
[03:09] <wgrant> lifeless: How do you plan to find all of the relevant team memberships?
[03:09] <lifeless> participation
[03:10] <wgrant> It would require a new call.
[03:10] <wgrant> But could be done.
[03:11] <lifeless> wgrant: super_teams ?
[03:12] <wgrant> lifeless: Is a collection that returns a limited batch of participations.
[03:13] <lifeless> pass a batch in greater than the current high-end, and iterate if needed
[03:14] <lifeless> wgrant: most folk will be <= 1 batch
[03:15] <wgrant> Yeah, multiple 300ms batch loads per authentication attempt isn't high on my list of things that are good ideas :)
[03:17] <lifeless> where are you getting that time from ?
[03:18] <lifeless> wgrant: but looking at it, it includes the whole metacrazydata
[03:18] <lifeless> rather than just providing references.
[03:18] <lifeless> \o/
[03:19] <lifeless> whee
[03:19] <lifeless> person:+contactuser
[03:19] <lifeless> 99% under 32 seconds.
[03:19] <wgrant> Yup
[03:19] <lifeless> +cve is still horrid too
[03:19] <lifeless> 23
[03:20] <wgrant> lifeless: OK, so it looks like without auth you can make an API request in about 100-120ms.
[03:20] <wgrant> auth will increase that a fair bit.
[03:21] <lifeless> wgrant: because?
[03:22] <wgrant> lifeless: Because our auth code is awful
[03:22] <lifeless> fixable or unfixable ?
[03:23] <wgrant> Fixable.
[03:23] <lifeless> there we go then
[03:25] <lifeless> DistroSeries:+builds is heinous
[03:25] <lifeless> ever seen Branch:+try-again ???
[03:26] <wgrant> Yeah
[03:26] <wgrant> It is always either very fast or extremely slow
[03:26] <wgrant> Probably due to lock contention, I guess.
[03:26] <wgrant> But maybe not.
[03:26] <lifeless>  Distribution:+topcontributors is good
[03:27] <wgrant> I'm not sure why that's so bad
[03:27] <wgrant> I haven't looked at a query log.
[03:27] <wgrant> But it doesn't make sense for it to be slow.
[03:27] <wgrant> Unless it's all unindexed, I guess.
[03:31] <lifeless> mhm
[03:31] <lifeless> Unknown
[03:31] <lifeless> 9.5M hits
[03:31] <lifeless> (over a month)
[03:31] <wgrant> 404?
[03:31] <lifeless> not sure
[03:32] <lifeless> need to heckle someone to dig and identify causes
[03:33] <lifeless> ahhaha
[03:33] <lifeless> on https://devpad.canonical.com/~lpqateam/ppr/lpnet/latest-monthly-pageids.html
[03:33] <lifeless> 'SimpleViewClass from /srv/launchpad.net/production/launchpad-rev-15099/lib/lp/bugs/browser/../templates/buglisting-embedded-advanced-search.pt:JsonModelNamespaceView'
[03:33] <lifeless> page it
[03:33] <lifeless> page id
[03:33] <lifeless> it really is
[03:43] <lifeless> I need a guesstimate
[03:43] <lifeless> how long to instantiate 122 feature rules
[03:44] <wgrant> They don't have enumcols, so it should be pretty quick.
[03:44] <lifeless> yah
[03:44] <lifeless> and a linear lookup of simple values is fast, given we cache results
[03:44] <lifeless> so it should be safe
[03:44] <wgrant> Also, where'd you get 122?
[03:44] <wgrant> Oh
[03:45] <lifeless> you should have enough data to infer
[03:45] <wgrant> You want to add 122 exceptions?
[03:45] <wgrant> And lower the timeout?
[03:45] <lifeless> yes
[03:47] <wgrant> I'm not sure that all of them deserve exceptions.
[03:47] <wgrant> But perhaps.
[03:47] <lifeless> it makes reasoning about it easy
[03:47] <wgrant> I prefer reasoning recklessly.
[03:47] <wgrant> It generally gives much better results.
[03:47] <wgrant> More rapidly.
[04:34] <StevenK> wgrant: Can haz review?
[04:39] <wgrant> StevenK: Oh right, it's still trying to submit.
[04:39] <wgrant> I had too many MPs open
[04:39] <wgrant> Done
[04:41] <StevenK> So tempted to put a Portal 2 reference in the commit message.
[04:41] <StevenK> "Delete Builder.description from the code for standing around, smelling and being useless."
[04:44] <StevenK> wgrant: http://pastebin.ubuntu.com/1012579/  is that what you envisioned, or am I on the wrong track?
[04:47] <wgrant> StevenK: Looks like a reasonable start, indeed.
[04:48] <StevenK> Right, excellent.
[04:48] <StevenK> Needs tests for Branch:+edit and then it's done, I think.
[04:49] <StevenK> wgrant: I'm a little unhappy about the IBranch.implementedBy() bit, but that should hopefully be short lived.
[04:49] <wgrant> StevenK: You probably want providedBy, too, but indeed
[04:55] <StevenK> Blink.
[04:55] <StevenK> On Bug:+index the text turns up on page load and then disappears.
[04:55]  * StevenK blames wallyworld_.
[05:53] <wallyworld_> StevenK: what have i done?
[05:56] <StevenK> wallyworld_: I've refactored out the Information Type portlet into a seperate class that is subclassed by BugView. Loading up Bug:+index shows the right text in the portlet for a few seconds which then disappears. I think the JS is to blame.
[05:59] <wallyworld_> StevenK: this isn't on prod is it? seems to work there
[05:59] <StevenK> wallyworld_: It is not on prod, no.
[05:59] <wallyworld_> ok, so only in your local branch
[06:00] <wallyworld_> when you say text, you mean the description that sits below the choice source popup widget?
[06:00] <StevenK> wallyworld_: Nope, everything
[06:01] <wallyworld_> hmmm
[06:03] <StevenK> wallyworld_: Do you want me to commit and push this mess, or you want to mull it over?
[06:03] <wallyworld_> i was going to look at the mp for the branch i recently landed but since it's merged, the diff is no longer available :-(
[06:03] <wallyworld_> so go ahead and commit it
[06:04] <StevenK> wallyworld_: I *HATE* that bug
[06:04] <wallyworld_> i didn't realise it was a bug
[06:04] <wallyworld_> i though it was intended
[06:05] <StevenK> It didn't used to happen, I think.
[06:05] <bigjools> it's when you push new revisions after merge IIRC
[06:05] <wallyworld_> i can't remember
[06:05] <bigjools> or something causes a scan on it
[06:05] <StevenK> bigjools: I thought it was because the destination branch changes
[06:05] <wallyworld_> so why does it discard the diff?
[06:06] <bigjools> I'm not aware that matters
[06:06] <bigjools> it regenerates a diff - which is empty
[06:06] <wallyworld_> hmm. ok.
[06:06] <StevenK> bigjools: Because the target branch now incorporates the changes that in the source branch
[06:07] <wallyworld_> so perhaps it should retain the last diff in that case
[06:07] <bigjools> StevenK: wouldn't that mean all of our diffs, ever, get regenerated?
[06:07] <bigjools> for ever
[06:07] <StevenK> bigjools: That seems to be happening anyway
[06:11] <StevenK> wallyworld_: https://code.launchpad.net/~stevenk/launchpad/branch-information_type-ui
[06:11]  * wallyworld_ looks
[06:23] <wallyworld_> StevenK: the initialise of the InfoTypePort;et is not being called
[06:23] <wallyworld_> stupid python class inheritance stuff
[06:24] <StevenK> Oh, it won't call *all* subclasses that have an initialize() method?
[06:25] <wallyworld_> nope, not unless they call super themselves
[06:25] <wallyworld_> afaiui
[06:25] <StevenK> wallyworld_: But InformationTypePortlet doesn't have a superclass
[06:26] <StevenK> wallyworld_: Do you want to try that? lib/lp/app/browser/information_type.py
[06:26] <wallyworld_> StevenK: i think it's stopping the chain at LaunchpadView
[06:26] <StevenK> LaunchpadView is the first superclass
[06:26] <wallyworld_> since it's initialise() just passes
[06:26] <wallyworld_> and so the other superclasses are nw called
[06:27] <StevenK> Perhaps it will stop after the first one
[06:27] <wallyworld_> StevenK: put LaunchadView last in the inheritance list
[06:28] <wallyworld_> it works then
[06:28] <wallyworld_> StevenK: afaiui, it calls super in order from left->right
[06:28] <wallyworld_> and if one stops, then boom
[06:28] <wallyworld_> they each have to call super to keep it going
[06:29] <StevenK> And BugViewMixin does not?
[06:29] <StevenK> It doesn't have an initialize(), so I guess not
[06:29] <wallyworld_> BVMixin does not implement that method
[06:33] <wallyworld_> bit of a trap that one
[06:33] <wallyworld_> and so of course it was the bugtask_index javascript that didn;t see the expected stuff in the request cache
[06:33] <wallyworld_> so it duely hid the info type stuff
[07:23] <bigjools> ok, how can I convince LP that actually, yes, my GPG signature valid on MP emails
[07:39] <jelmer> bigjools: use MIME?
[07:40]  * bigjools does a Marcel Marceau impression
[07:41] <bigjools> What is mime for fucked?
[07:49]  * stub mimes 'fucked'
[07:50] <adeuring> good morning
[08:03] <czajkowski> aloha
[08:04] <lifeless> bigjools: I think you want the hip thrust for that one
[08:37] <jml> hello
[08:38] <jelmer> ohai
[09:18] <jml> so, to upgrade to pg 9.1 in dev env, I just remove pg 8.4, install 9.1 and then run database-setup?
[09:20] <StevenK> jml: Pretty much
[09:20] <StevenK> jml: Also make sure 9.1 is listening on 5432
[09:25] <mwhudson> i once tried to figure out how the debian packages created clusters listening on different ports
[09:30] <jml> so the metapackages are all broken atm then?
[09:30] <jml> ok, I'm confused.
[09:30] <jml> launchpad-database-setup configures pg to run on 5433
[09:31] <jml> so how can I make sure it's running on 5432
[09:39] <jml> ffs
[09:39] <jml> now I'm getting "invalid data directory"
[09:39] <jml> graet.
[09:55] <jml> http://paste.ubuntu.com/1012845/ what am I doing wrong?
[09:58] <mgz> nothing obvious, tries 5432... what's in /var/run/postgresql actually?
[10:00] <jml> jml@lpdev:/var/run/postgresql$ sudo cat 9.1-main.pid
[10:00] <jml> 7623
[10:00] <jml> just that.
[10:03] <jml> also,
[10:03] <jml> $ ls -a
[10:03] <jml> .  ..  9.1-main.pid  .s.PGSQL.5433  .s.PGSQL.5433.lock
[10:03] <mgz> okay, so it is listening on the wrong port
[10:05] <mgz> change that in the postgre conf and restart?
[10:07] <jml> and then manually run the createuser commands, I guess?
[10:09] <mgz> there's probably a better way, but naturally it just worked for me previously.
[10:10] <jml> psql:launchpad-2209-00-0.sql:17: ERROR:  language "plpgsql" already exists
[10:10] <jml> psql:launchpad-2209-00-0.sql:2646: ERROR:  could not access file "$libdir/plpython": No such file or directory
[10:10] <jml> are they fatal errors?
[10:14] <stub> jml: The second is - postgresql-plpython-9.1 is not installed.
[10:14] <jml> stub: thanks.
[10:15] <jml> stub: Ubuntu says it's already installed though.
[10:15] <stub> jml: If you run 'psql', does it say the server version is 9.1 in the startup banner message?
[10:16] <jml> psql (9.1.3)
[10:16] <jml> Type "help" for help.
[10:16] <jml> yes.
[10:17] <stub> jml: oic. No, that isn't a fatal error. It will go away soon now we are 9.1 everywhere and can clean that up.
[10:17] <jml> stub: cool. thanks.
[10:17] <jml> while you're around...
[10:18] <jml> I'm aiming to rename a DB column. The branch I submit against db-devel needs to update the code for the rename as well as adding the patch that does the rename, right?
[10:19] <StevenK> jml: You can not do that.
[10:20] <jml> StevenK: Do what? Rename a column?
[10:20] <StevenK> jml: You can't change code at the same time
[10:21] <cjwatson> (Because database and appserver rollouts are decoupled.)
[10:22] <jml> hmm.
[10:22] <nigelb> cjwatson: Are you rotating with LP this cycle?
[10:22] <jml> so either I can't do a rename
[10:22] <cjwatson> nigelb: No, I just have a number of LP-related projects
[10:22] <jml> or I have to update the code to somehow work with both naes.
[10:22] <jml> names, rather.
[10:22] <nigelb> cjwatson: Ah, nice. :)
[10:22] <cjwatson> jml: If you figure out a neat approach, I have a low-priority bug that could use it.  IIRC wgrant told me that we haven't renamed any columns since the introduction of fastdowntime.
[10:23] <czajkowski> *grin*
[10:24] <jml> cjwatson: Ah, I see.
[10:24] <cjwatson> jml: In my case (bug 1000570) I renamed the API but left the DB column for "later".
[10:24] <_mup_> Bug #1000570: "Packageset.score" is badly named <qa-untestable> <tech-debt> <trivial> <Launchpad itself:Triaged> < https://launchpad.net/bugs/1000570 >
[10:24] <jml> cjwatson: right, that's what I've done. I'm just making later, now.
[10:25] <cjwatson> William suggested a trigger approach that I'm afraid I didn't understand.
[10:25] <jml> stub: any thoughts on how to do a column rename?
[10:25] <stub> jml: Yes. Ideally, minimize the code using a property or something
[10:25] <stub> jml: Actually, hang on
[10:26]  * jml does so
[10:26] <stub> jml: So code changes and db changes are not synchronized.
[10:26] <stub> jml: Which means first a code change that makes things work with the old column name and the new column name.
[10:27] <stub> jml: Then the db patch doing the rename. Then a cleanup.
[10:27] <stub> jml: Which all sucks.
[10:27] <StevenK> Welcome to FDT.
[10:27] <jml> ok. hmm.
[10:27] <stub> Who asked for this again?
[10:27] <StevenK> And oh, your patch will wait for a week because lifeless lives in 1990.
[10:27] <jml> me.
[10:29] <jml> I'm renaming Archive.commercial to Archive.suppress_subscription_notifications. Have done so in code, using a property.
[10:29] <cjwatson> StevenK: Aren't we almost up to date on DB deployments now
[10:29] <stub> jml: There could be some magic we do with PG, but I think it will end up more complex. Might be necessary if making a Storm class not care which of two column names is in use is a pita.
[10:29] <cjwatson> ?
[10:29] <StevenK> cjwatson: I'm just bitter.
[10:30] <StevenK> cjwatson: It is usually pretty good, stuff has been held up due to 9.1 so we had a two week backlog
[10:31] <cjwatson> I know
[10:31] <stub> (magic being an updatable view, making code use the updatable view, do the rename, make the code use the table again)
[10:31] <StevenK> And that is counting the five or six DB patches Purple wants to land.
[10:39] <jml> stub: Archive inherits from SQLBase and we don't ever query on this column, so I think I can hack something up in Python.
[10:39] <jml> testing will be a pain though.
[10:42] <stub> jml: Or if that code isn't used, extract it, do the rename, put it back + fix.
[10:42] <jml> stub: it is used, I'm afraid.
[10:46] <stub> jml: Just saw your email. Did you fix the PG port issue?
[10:47] <jml> stub: manually. I changed the port again in postgresql.conf; restarted; ran createuser by hand.
[10:47] <stub> jml: I think you might see that if /etc/postgresql/8.4/main/postgresql.conf still exists and specifies port=5432
[10:47] <stub> Can you check? Means there is another step after uninstalling the packages.
[10:47] <jml> stub: make schema seemed to work OK, apart from the errors I mentioned earlier re plpython
[13:33] <james_w> if a test is failing because it is escaping isolation due to a /+branch-id/ path being interpreted by bzr as being a filesystem path, does that mean that the test has to run with more of codehosting working?
[13:34] <james_w> or perhaps it needs more plugins loaded beforehand?
[13:38] <james_w> jml, do you know?
[13:39] <jml> james_w: hi
[13:39] <jml> james_w: plugins, I think.
[13:41] <james_w> thanks
[13:51] <jml> hmm
[13:53] <jml> thinking out loud about column renaming
[13:54] <jml> if we want one code base to work with both column names, then we either need some way of interrogating the schema at class creation time or some way of trapping errors at query time and updating the class then
[13:55] <jml> I'm probably missing other options, but those seem to be it for me
[13:56] <jml> the problem with doing something on class creation is that it will add a query for everything that imports archive.py
[13:56] <jml> which is probably everything
[13:57] <jml> a problem with trapping at query time is that there's no obvious single choke point
[13:58] <cjwatson> Turn the attribute into a @property?
[13:58] <cjwatson> (This may not be the best approach, more an existence proof)
[13:58] <jml> cjwatson: well, that's already been done
[13:59] <jml>     suppress_subscription_notifications = BoolCol(
[13:59] <jml>         dbName='commercial', notNull=True,
[13:59] <jml>         default=False)
[13:59] <jml> in my branch
[13:59] <jml> note that dbName is the old name.
[14:00] <jml> but how do I make something that works both before and after the 'commercial' column gets renamed to 'suppress_...'
[14:00] <jml> storm uses the dbName (somehow) to generate SQL
[14:05] <wgrant> jml: There's probably no feasible way to handle that in the app.
[14:05] <wgrant> jml: We've not done a column rename with fastdowntime before.
[14:05] <wgrant> I would personally duplicate the column on the table and use triggers to keep it up to date while the application is flipped to use the new name.
[14:06] <wgrant> Rather than trying to get Storm to cope, which it won't.
[14:07] <wgrant> (unless you make suppress_subscription_notifications a property that executes manual SQL, rather than using Storm)
[14:07] <sinzui> It's take 1 hour to unsubscribe ~registry for linux/unity bugs reported between 2005 and 2006. We may have another 6 hours of bug mail going to ~registry
[14:07] <wgrant> (which might work in this case, since it's probably not used for filtering or anything)
[14:07] <jml> wgrant: huh, you mean something like this:
[14:07] <jml> @property
[14:08] <jml> def suppress...(self):
[14:08] <jml>   try:
[14:08] <jml>     return do_query('SELECT suppress_... FROM Archive WHERE id = %s' % self.id)
[14:08] <jml>   except ProgrammingError:
[14:08] <jml>   return do_query('SELECT commercial FROM Arch...' % ...)
[14:08] <wgrant> jml: Right
[14:08] <jml> wgrant: interesting.
[14:09] <wgrant> jml: I changed SourcePackageRelease.copyright to use a similar manual SQL approach for performance reasons.
[14:09] <wgrant> But it could also work well here.
[14:10] <jml> wgrant: I have looked pretty thoroughly, and it's not used for WHERE clauses to the best of my knowledge.
[14:10] <wgrant> It obviously doesn't work if the column is involved deeply in queries, but since you're probably only getting/setting it it should be OK
[14:10] <wgrant> Right, it wouldn't make much sense for it to be.
[14:10] <jml> wgrant: I guess that will slow down code that uses the attribute, but maybe we can bear that for a little while.
[14:10] <wgrant> jml: By 1 query for about 48 hours.
[14:10] <wgrant> I think we can live.
[14:12] <jml> wgrant: ok. I'll give that a shot. Thanks.
[14:13] <wgrant> jml: Great.
[14:13]  * wgrant disappears
[14:13] <czajkowski> wgrant: nn
[14:42] <czajkowski> 15:39 < jcastro> czajkowski: do you remember the URL to add bug trackers to lp?
[14:42] <czajkowski> anyone help me out here?
[14:42] <czajkowski> gmb: ^^
[14:44] <gmb> czajkowski, https://bugs.launchpad.net/bugs/bugtrackers/+newbugtracker
[14:44] <czajkowski> gmb: thanks
[15:26] <jml> wgrant: SourcePackageRelease.copyright defaults to Python's copyright if it's not provided as a keyword argument, I think.
[15:45] <jml> how do I get a cursor from a store object?
[15:46] <jml> hmm. just cursor()
[15:46] <jml> ok.
[16:01] <jml> wgrant, stub: https://code.launchpad.net/~jml/launchpad/archive-commercial-rename-support/+merge/107819
[16:01] <jml> gmb also, ^^ (but I talked about it with them)
[16:01]  * jml has to dash.
[16:01] <gmb> jml, k, thx.
[16:02] <gmb> bye
[16:02] <gmb> ... can't believe I just did that.
[16:02] <jml> tee hee
[18:13] <lifeless> morning
[22:02] <Laney> Anyone fancy giving me some light test education? http://paste.ubuntu.com/1013802/
[22:03] <Laney> (AFAICT sourcepackage is a page such as https://launchpad.net/ubuntu/+source/mono)
[22:10] <StevenK> Laney: sourcepackage is a DistributionSourcePackage
[22:11] <Laney> StevenK: yeah, I think that's what I linked to.
[22:11] <Laney> so, assuming that it's right, can I cure the ForbiddenAttribute?
[22:11] <Laney> then I'll get on to figuring out how to make it match the href :-)
[22:12] <Laney> (porting a doctest here)
[22:12] <wgrant> StevenK: Um
[22:12] <wgrant> StevenK: SourcePackage should be named Distro*Series*SourcePackage
[22:13] <wgrant> Ah, but Distribution.getSourcePackage returns a DistributionSourcePackage, indeed.
[22:15] <cjwatson> In any case the forbidden attribute is probably because you're using LaunchpadFunctionalLayer (so including the security model) but your test doesn't log in.
[22:16] <Laney> The security model confuses me very much
[22:16] <Laney> is there any documentation on it?
[22:16] <cjwatson> Don't look at me, I zen it from the surroundings.
[22:17] <cjwatson> And occasionally whine in a confused manner.
[22:17] <wgrant> Well
[22:17] <cjwatson> LaunchpadZopelessLayer avoids the security model for cases where it doesn't matter, but (a) I'm never quite sure how evil it is and (b) I don't know whether it'll work in this case
[22:17] <wgrant> ForbiddenAttribute isn't caused by an incorrect layer
[22:17] <wgrant> Unauthorized can be.
[22:17] <cjwatson> (Real LP devs will now tell me I'm on crack)
[22:17] <wgrant> ForbiddenAttribute means you've used the wrong attribute name.
[22:17] <StevenK> Laney: Distribution.name does not exist.
[22:17] <cjwatson> Ah, doh
[22:18] <cjwatson> Laney's test does not actually mention .name anywhere directly; presumably it's in some tested code
[22:18] <StevenK> Sigh, I should learn to read.
[22:18] <cjwatson> Wait, Distribution.name *should* exist.  It's on IDistributionPublic.
[22:18] <wgrant> Probably trying to set it.
[22:19] <wgrant> WHich isn't allowed.
[22:19] <wgrant> If the attribute is entirely unsettable, setting it will ForbiddenAttribute.
[22:19] <Laney> it comes from the last line there
[22:19] <Laney> view()
[22:19] <wgrant> That is, if there's no permission that can possibly be held to grant write rights.
[22:19] <wgrant> Laney: What's the traceback?
[22:19] <cjwatson> You can figure out the security on any given attribute by looking at lib/lp/*/configure.zcml, sometimes in combination with lib/lp/security.py.
[22:20] <Laney> sec
[22:20] <Laney> wgrant: http://paste.ubuntu.com/1013837/
[22:20] <Laney> 53 is the assertThat line
[22:20] <wgrant> jml: That column workaround is disappointingly unevil.
[22:26] <cjwatson> My queue API branch is getting to the point where it might arguably almost work.
[22:27] <cjwatson> I might split it up, though, since some of the information about binary uploads is done by exporting bits of BPR and I suppose that might be contentious or something.
[22:28] <wgrant> cjwatson: Well
[22:28] <wgrant> cjwatson: Queue overrides are terrible.
[22:29] <cjwatson> The bit about exporting BPR isn't even so much for overrides, just for displaying information on builds.
[22:30] <cjwatson> The way I have it at the moment you'd do something like:
[22:30] <cjwatson> for build in upload.builds:  # probably only ever one of these but the PackageUpload design is weird
[22:30] <cjwatson>     for bpr in build.binary_packages:
[22:30] <cjwatson>         print(bpr.name, bpr.version)
[22:30] <cjwatson> or whatever
[22:31] <wgrant> Ah, yeah.
[22:31] <cjwatson> I could probably land accept/reject in advance of any of this, though, which would be a start.
[22:32] <cjwatson> But I don't see a sensible way to export binary information without at least one new exported object, and BPR seems as good as any.  It's just that the asymmetry with SPR not being exported is a bit odd.
[22:32] <wgrant> I'd personally just ignore the hideous data model and add a method to retrieve a list of all override tuples for the upload, and another which takes a list of tuples to change them.
[22:32] <cjwatson> I guess that's a possibility, though there's quite a lot in each tuple.
[22:33] <cjwatson> It feels better as a proper object so you can have named attributes.
[22:33] <wgrant> We've deliberately avoided exporting BPR/SPR before.
[22:33] <wgrant> Because security, URLs etc. are a bit of a problem.
[22:33] <cjwatson> is_new, name, version, arch_tag, component, section, priority = override  # vomit
[22:34] <cjwatson> URLs are only about as hard as for build, but yeah, not quite trivial.
[22:34] <wgrant> Builds have a context.
[22:34] <wgrant> BPRs do not.
[22:35] <cjwatson> BPRs have a build
[22:35] <wgrant> Ugh, I guess.
[22:35] <wgrant> But ew.
[22:35] <wgrant> Anyway
[22:35] <cjwatson> Is it possible to create new objects just for export that don't correspond to anything much pre-existing in the internal data model?
[22:36] <cjwatson> Basically the equivalent of a namedtuple
[22:36] <wgrant> The fact that PU overrides are done by writing to BPR and SPR is an internal implementation embarassment that it would be nice to avoid exporting.
[22:36] <wgrant> It's possible to do that, but there's a fair bit of code.
[22:37] <wgrant> eg. DSP, SP aren't real.
[22:37] <cjwatson> FWIW my current branch doesn't expose the writing part of that; I just went for overrideBinaries (which isn't lovely, but it fits reasonable CLIs well enough)
[22:37] <cjwatson> PU.overrideBinaries that is
[22:38] <cjwatson> So a new exported interface and everything on it is a property?
[22:39] <wgrant> Basically.
[22:39] <cjwatson> I could just add a load of properties to PackageUploadBuild and export that.
[22:39] <cjwatson> Since it's there.
[22:39] <StevenK> PU is exported over the API?
[22:39] <wgrant> That's another thing that probably shouldn't be exposed.
[22:39] <wgrant> PUB
[22:40] <cjwatson> StevenK: Slightly, right now.  I'm working on extending it enough to be able to kill LP's queue tool.
[22:40] <cjwatson> Oh, PUB is wrong because it's one for the whole build, not one per binary in it.
[22:41] <cjwatson> So OK, PackageUploadBinaryAPIExportOnlyScrewYou or something
[22:41] <wgrant> Another consideration is that API requests are slow, and some packages have a lot of binaries.
[22:42] <wgrant> eg. overriding linux will take minutes over the API if you have separate objects for each binary.
[22:42] <cjwatson> Hm, true
[22:43] <cjwatson> arch_tag is per-build, so it's only six elements per binary override, and I suppose that list hasn't changed in six years.
[22:44] <cjwatson> But ew, I hate unnamed tuples for this kind of thing.
[22:44] <wgrant> Well
[22:44] <wgrant> Could do list-of-dicts instead
[22:44] <wgrant> JSON doesn't do namedtuples, unfortunately.
[22:45] <cjwatson> List of dicts might be OK.
[23:58] <StevenK> wgrant: I thought I could use setUpFields() to fiddle with the schema, but doing so causes KeyError in my tests.