/srv/irclogs.ubuntu.com/2013/02/27/#launchpad-dev.txt

=== wedgwood is now known as wedgwood_away
cjwatsonwgrant: Well, I flipped the order round in the test as well to match; not sure I can really do better automatically since they're all just passed through as strings00:09
wgrantcjwatson: We don't have some kind of test for the output?00:10
=== sagaci is now known as jpickett
cjwatsonLet me see if I can spot why the tests weren't spotting the "base-files/admin" garbage00:13
wgrantYeah00:14
wgrantI would have expected an integration test of some kind to catch that.00:14
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
=== Ursinha is now known as Ursinha-afk
cjwatsonwgrant: I've pushed an integration test now.  Thanks for the suggestion.01:20
=== Ursinha-afk is now known as Ursinha
wgrantcjwatson: That looks safer, thanks.01:47
wgrantr=me01:47
cjwatsonThanks.  I'll re-QA in the morning.01:48
cjwatson(Also ugh test_ftparchive.py is horrible.)01:48
wgrantYes, yes it is01:48
wgrantStevenK: There's still an awful lot of person queries on qas03:51
StevenK:-(03:52
StevenKYes, I was trying to work it out last night, and didn't get very far03:52
=== Ursinha is now known as Ursinha-afk
StevenKAnd I've been distracted by IBranchMergeProposal being obstreperous today.03:52
=== Ursinha-afk is now known as Ursinha
StevenK    self.assertEqual('flibble', bmp.superseded_by.description)04:19
StevenKAttributeError: 'thread._local' object has no attribute 'interaction'04:19
StevenKAnd I'm using with person_logged_in() :-(04:19
wgrantIt's apparently not logged in04:19
StevenKWhy would person_logged_in uh, not?04:20
StevenKWithout asserting or something04:21
wgrantYou're not doing anything viewish?04:23
* StevenK tries to figure why superseded_by now tosses a KeyError in zope.interface.04:26
StevenKOh. Because I can't read.04:28
StevenKwgrant: So while I have tests running, whyfor does my preloading not love me on qas? :-(04:29
StevenKThe preloading did love me locally04:31
wgrantStevenK: Have you examined the tracebacks?04:33
wgrantYou may want to be in a padded room first04:33
StevenKI thought I did, have you generated an OOPS?04:36
wgranthttps://oops.canonical.com/oops.py/?oopsid=OOPS-1c124234d939329af74ae127df8224c704:37
StevenKwgrant: I don't get it. It loops over view/subscriptions which has the preloading?05:04
wgrantStevenK: I'm tnot seeing that..05:07
StevenKwgrant: lib/lp/code/templates/branch-portlet-subscribers-content.pt and lib/lp/code/browser/branchsubscription.py05:09
wgrantStevenK: How'd you get those from the OOPS?05:10
StevenKGuessing, since the TAL isn't exactly forthcoming05:11
wgrantWhich query are you looking at?05:11
StevenKWHERE Person.id = 3807340 LIMIT 1 near the bottom05:12
wgrantI think you misread the traceback05:12
StevenKOh? I can see TAL is implicated, and IBranch.hasSubscription05:15
wgrantYes05:15
wgrantThere's no lp.code.browser.branchsubscription in there05:16
wgrantNor view/subscriptions05:16
StevenKClearly it was, since the query count did drop; but I'm having trouble seeing which bit of TAL is causing the query05:16
wgrant  File "/srv/qastaging.launchpad.net/qastaging/launchpad-rev-16512/lib/lp/services/webapp/menu.py", line 493, in enable_if_allowed05:17
wgrant    link = func(self)05:17
wgrant  File "/srv/qastaging.launchpad.net/qastaging/launchpad-rev-16512/lib/lp/code/browser/branch.py", line 333, in subscription05:17
wgrant    if self.context.hasSubscription(self.user):05:17
wgrant  File "/srv/qastaging.launchpad.net/qastaging/launchpad-rev-16512/lib/lp/code/browser/decorations.py", line 97, in hasSubscription05:17
wgrant    if sub.person == user:05:17
StevenKAh05:19
StevenKThat's terrible05:22
StevenKwgrant:  4 files changed, 126 insertions(+), 159 deletions(-)05:24
StevenKThat moves as much as I could into lp.View for BMP05:25
wgrantWhat's left?05:25
StevenKid, registrant, source_branchID, prerequisite_branchID, next_preview_diff_job, private, source_branch, target_branch, prerequisite_branch, votes, getUsersVoteReference05:28
wgrantnext_preview_diff_job, votes, getUsersVoteReference sound very excessive05:29
wgrantWhich failures did they cause?05:29
StevenKLet me move them back to View05:29
wgrantAlso, registrant is less bad but I can't see why it's necessary05:29
=== almaisan-away is now known as al-maisan
StevenKwgrant: http://pastebin.ubuntu.com/5569759/06:19
wgrantStevenK: That's not a hugely useful traceback :)06:22
wgrantStevenK: I could tell that code was calling it06:22
wgrantThe question is what code, and why?06:22
wgrantIn the case where it fails.06:23
StevenKwgrant: http://pastebin.ubuntu.com/5569770/06:24
wgrantStevenK: Look at that test06:27
wgrantThink about what it's trying to do :)06:27
StevenKwgrant: I'm concerned about viewing BranchMergeProposal:+index as anoymous06:28
wgrantStevenK: Why?06:28
wgrantStevenK: If I can't see the BMP, I can't see BMP:+index06:29
wgrantSo it's not an issue that not being able to see the BMP prevents me from seeing something that BMP:+index needs to see06:29
StevenKOh, hah06:29
StevenKIt's a silly test06:29
wgrantYes06:29
wgrantThe test attempts to assert that a user who can't see the merge proposal can't see reviews requested from private teams06:30
wgrantSo it's asserting a security hole06:30
wgrantIt shouldn't be possible to tell whether a team is a reviewer for a proposal that you can't see.06:30
StevenKIndeed06:31
=== Ursinha is now known as Ursinha-afk
StevenKwgrant: Right, that's all tests passing with next_preview_diff_job, votes and getUsersVoteReference back in View06:40
wgrantStevenK: Lovely. What was the issue with next_preview_diff_job?06:40
StevenKA doctest using it directly06:40
wgrantAh06:40
StevenKSo I sprayed it with rSP06:40
wgrantez06:40
StevenKwgrant: I can move registrant, or I can push it up06:41
wgrantStevenK: I don't see why registrant would be required (it's not relevant for security), so please move it to launchpad.View and fix the minimal fallout06:42
wgrantIn general, security adapters should be using rSP so basically nothing but id is public, but the pattern today seems to be to keep security-relevant bits public06:43
StevenKsource_branch and friends seem to cause oddness if they're not public06:45
wgrantSure, lots of things will want those06:47
wgrantThey're not completely terrible to have exposed, and there's going to be lots of fallout => probably not worth changing06:47
wgrantRegistrant isn't completely terrible to have exposed either, but there won't be much fallout => change06:48
StevenKRight, and if you can't see either branch, you can't see the MP anyway06:49
wgrantIf you can get the BMP object somehow you might be able to06:50
wgrantThat's why we're moving these to launchpad.View in the first place06:51
StevenKI was considering that, if you can get the BMP object somehow won't the branch security adapters come into play anyway?06:51
wgrantYou won't be able to see details about the branches06:53
wgrantBut that doesn't mean the attributes should be public06:53
wgrantIt just means it's not worth the fallout to make the View afterwards06:53
StevenKMmmm06:53
StevenKHaha07:25
StevenKFallout is one test that wants with person_logged_in(mp.registrant):07:25
wgrantHandy07:25
wgrantStevenK: Looking07:43
StevenKI wasn't fussed, TBH07:44
wgrantStevenK: Why are generateIncrementalDiff/revision_end_date/getIncrementalDiffs still named explicitly and in Public?07:44
StevenKNone of them exist in the interface07:45
wgrantStevenK: Still, no reason for them to be public?07:46
wgrantAlso, that AnyPerson wants to be AnyAllowedPerson07:46
wgrantAnd you'll want to replace the existing duplicatastic AnyAllowedPerson adapters with a single generic one07:46
wgrantWhere checkAuthenticated delegates to View, and checkUnauthenticated returns False07:47
StevenKI think you should put all this on the MP :-)07:47
wgrantShh07:47
StevenKwgrant: I thought AnyPerson was okay because we wanted randoms to be able to comment on MPs?07:49
wgrantStevenK: Not randoms who can't see the MP in the first place07:49
wgrantAnyAllowedPerson is usually View+authenticated07:49
StevenKAh07:49
StevenKRight07:49
wgrantWhereas AnyPerson is just authenticated07:49
StevenKSo it used to be make sense in the public world, but does not in the post-public world07:49
wgrantRight07:49
wgrantAnyPerson doesn't usually make sense for objects that have privacy07:50
wgrant(but I'm pretty sure bugs still use it)07:50
StevenKwgrant: Haha, cheater.07:51
wgrantI try.07:52
* StevenK goes to shoot things in the face in BioShock 207:53
StevenKOh, sorry. Set them on fire, and then shoot them in the face.07:53
czajkowskialoha09:00
=== al-maisan is now known as almaisan-away
=== Ursinha-afk is now known as Ursinha
=== almaisan-away is now known as al-maisan
=== wedgwood_away is now known as wedgwood
=== deryck is now known as deryck[lunch]
=== bac_ is now known as bac
=== deryck[lunch] is now known as deryck
=== matsubara is now known as matsubara-afk
=== al-maisan is now known as almaisan-away

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!