/srv/irclogs.ubuntu.com/2008/07/09/#launchpad-meeting.txt

=== mwhudson_ is now known as mwhudson
=== rockstar` is now known as rockstar
=== bac|away is now known as bac
=== bac is now known as bac|away
=== bac|away is now known as bac
=== bac is now known as bac|away
=== bac is now known as bac|away
=== bac|away is now known as bac
=== EdwinGrub is now known as EdwinGrubbs
=== bigjools_ is now known as bigjools
intellectronicame15:00
barry#startmeeting15:00
MootBotMeeting started at 09:02. The chair is barry.15:00
MootBotCommands Available: [TOPIC], [IDEA], [ACTION], [AGREED], [LINK], [VOTE]15:00
barrywelcome everyone to this week's ameu reviewer's meeting.  who's here today?15:01
bigjoolsme15:01
sinzuime15:01
BjornTme15:01
gmbme15:01
allenapme15:01
bacme15:01
EdwinGrubbsme15:01
schwukme15:01
flacosteme15:02
flacostesalgado is on holiday15:02
barrycprov: ping15:02
cprovme15:03
barry[TOPIC] agenda15:04
MootBotNew Topic:  agenda15:04
barry== Agenda ==15:04
barry * Roll call15:04
barry * Next meeting15:04
barry * Action items15:04
barry * Queue status15:04
barry * Mentoring update15:04
barry * Review process15:04
barry  * Ensure in database code that non-DB state is reset at transaction15:04
barry  boundaries (flacoste)15:04
barry  * Security checks (should usually be avoided) in view code (intellectronica)15:04
barry[TOPIC]  * Next meeting15:04
MootBotNew Topic:   * Next meeting15:04
barrysame time and place next week?  anybody know they will not be here?15:04
bigjoolscprov and I are sprinting, so may or may not make it15:05
intellectronicai may be busy with the ubuntu sprint. don't know yet, but will update when i know the schedule for sure15:05
abentleyThat would be fine with me.15:05
barrycool.  if you're going to be away, please update the wiki page w/ apologies15:05
cprovbigjools: we will have 30 minutes for the meeting, I'm sure.15:06
barry[TOPIC]  * Action items15:06
MootBotNew Topic:   * Action items15:06
bigjoolscprov: almost certainly, but I am warning just in case!15:06
barry * barry to ask lifeless to summarize what he knows about the PQM Mysteries (e.g. autopacking bug losing branches)15:06
barrydone15:06
barry * barry to ask losas and devs to update LaunchpadProductionDocumentation on operation details of machines for devs15:07
barrydone15:07
barrythe other action items are for asiapacsters15:07
barry[TOPIC]  * Queue status15:07
MootBotNew Topic:   * Queue status15:07
barryeverything looks fine to me.  any comments from y'all?15:08
sinzuischwuk: intellectronica: bugtarget-hasbugs-1 is mege-conditional isn't it?15:08
schwuksinzui: that's how it was left.15:08
barryleonardr: i'll note that pending-reviews has 55 conflicts (!) on your integration branch15:08
intellectronicasinzui: it is, but i'm only going to land it when another branch is prepared. that's why i haven't removed it yet15:08
sinzuisomeone, (schwuk) should update PR15:09
schwuksinzui: done15:10
barrythanks15:10
bacduring my on-call shift i've started reminding people by name to clean up PendingReviews.  seems effective and well received.  perhaps others can do the same.15:10
barrybac: +115:10
barry[TOPIC]  * Mentoring update15:11
MootBotNew Topic:   * Mentoring update15:11
barrynothing from me here.  any comments?15:11
barry[TOPIC]  * Review process15:12
MootBotNew Topic:   * Review process15:12
barry  * Ensure in database code that non-DB state is reset at transaction15:13
barry  boundaries (flacoste)15:13
barryflacoste: the floor is yours15:13
flacosteok15:13
flacosteso our move to storm changed a subtle semantic in the ORM15:13
flacosteStorm does reuse instances across transactions15:13
flacosteso a .get() after a transaction.commit() or abort() will return the same instance than previously15:14
flacostethat wasn't the case with SQLObject15:14
flacostethe instance is marked in a special way though so that all DB attributes will be fetched again15:14
flacostebut non-DB attributes will hold the values from the last transaction15:14
flacosteso be mindful of any non-DB attributes used on database objects15:15
flacostecachedproperty is an example of that15:15
flacostebut there are other examples15:15
flacosteobjects that use non-DB attributes should provide a __storm_invalidate__ method15:15
flacosteto reset these attributes15:16
flacoste(it's called by storm on transaction boundaries)15:16
barryflacoste: has cachedproperty been "fixed" to clear its cache on txn boundaries?15:16
flacostebarry: no15:16
flacostei think i filed a bug about that, but i have to check15:16
flacostebut iirc15:16
flacostewe never used cachedproperty on DB object15:16
allenapDoes Storm do this as a performance optimisation?15:16
flacosteyes15:17
barryflacoste: thanks15:17
flacosteand also as a convenience to the developer15:17
BjornTflacoste: we do use cachedproperty on db objects15:17
flacostewe do15:17
flacosteok15:17
barryfind lib/canonical/launchpad/database -name \*.py | xargs grep cachedproperty | wc -l15:17
barry5715:17
flacostewow15:17
flacosteok, i'll make sure to report and fix cachedproperty then15:17
flacosteand maybe offer a wrapper for storm to easily create transaction-aware attribuets15:18
barry[ACTION] flacoste to submit bug report on cachedproperty needing to __storm_invalidate__15:18
MootBotACTION received:  flacoste to submit bug report on cachedproperty needing to __storm_invalidate__15:18
flacostei'll also update the checklist with that info15:18
barryflacoste: excellent, thanks15:18
flacosteany questions? comments?15:18
barry  * Security checks (should usually be avoided) in view code (intellectronica)15:19
barryintellectronica: the floor is yours15:20
intellectronicawhen we spot security checks in view code, it's a good idea to ask whether they really belong there15:20
flacosteintellectronica: what kind of security checks are you talking about?15:21
flacostecheck_permission call?15:21
intellectronicain most cases, it would be code to have them condified in the content object, and only called from the view15:21
flacosteor security logic?15:21
intellectronicaflacoste: yes - stuff that relies on check_permission, and especially stuff the does more logic than that, for example by combining several calls to check_permission15:21
intellectronicaor a call to check_permission with some other stuff15:22
intellectronicathere are several reasons why i think this is important:15:22
flacostei can see several good reasons to call check_permission() in view code (to inform users or other forms of conditional action/display)15:22
abentleyAn example of where I think it makes sense to check permission in view code is on the branch deletion page, where we show users what needs to be changed, and whether they can do it.15:22
bigjoolscheck_permission is already done in lots of browser code15:22
intellectronicaflacoste: true, but if the security check gets complicated, it would be good to have it in the content object and call it from there15:23
intellectronicait's easier to test and easier to maintain when the predicate changes15:23
barryintellectronica: maybe instead of adding these to content objects, we should register securitycheck adapters for them, and use that wherever it's necessary (e.g. browser code)?15:24
intellectronicaand most importantly, if we need to expose it from a different layer (the api, or a script, or whatever), we can reuse it15:24
intellectronicabarry: in some cases that's appropriate, in others less15:24
barryi like keeping database code free from security checks because in some of my cases, what's appropriate in the browser isn't appropriate (or different) in the xmlrpc layer or web services layer15:25
intellectronicai don't think that there's a rule that can be formulated. just that since i had to deal with this recently it opened my eyes and all of a sudden i see lots of places where this could become a problem15:25
intellectronicabarry: can you give an example?15:25
intellectronicai'm asking, because i think that this it's quite rare for this to happen15:26
barryintellectronica: i'd have to think of a specific example, sorry15:27
* barry could be misremembering too15:27
barryintellectronica: could you outline the specific case where this came up?15:27
bigjoolsdon't the bug scripts already cope with lack of a user in zopeless mode?15:28
intellectronicathe case i've been dealing with is a check on setting various attributes of IBugTask (importance, for example), which was restricted using the browser15:28
allenapSo all the restrictions were worthless when you exposed IBugTask.importance in the API15:29
intellectronicaafter moving this check to the content object (so that i can expose this object using the API safely) i discovered lots of places where we relied on ignoring the security check15:29
intellectronicai'm sure that there are other cases, where restrictions hold in the browser code, but are being ignored elsewhere, and we just don't realise15:30
intellectronicathat's the main reason i think this is important15:30
bigjoolsmaybe we need another layer of code?  I'm not convinced that polluting content classes is right.15:31
BjornTintellectronica: iirc, that was a bit different, though. the check was only done in browser code, and you needed to do the same check in the security checker, and from within the content class.15:31
intellectronicain addition, it's much easier to check a security constraint or a method on a content object independently, than check through the view code15:31
barrybigjools: hence my suggestion of adapters15:31
intellectronicaBjornT: indeed, but there are many cases like this, where we compound several predicates for the security check15:31
flacosteok, this is very particular15:32
bigjoolsintellectronica: what places rely on ignoring the security check?15:32
intellectronicaBjornT: and i think this should be encapsulated somehow. in a security checker or if necessary, in the content class15:32
flacosteand i agree with intellectronica that it is misplaced15:32
BjornTright. but if you don't need to re-use the check from within the content class, you don't win much by adding an extra method.15:32
flacostebut it's because the view is handling the mutation logic15:32
flacostethat's not the place for that15:32
intellectronicabigjools: i only know about the once pertaining to this change, and there are heaps of them. many scripts, for example15:33
bigjoolsare the scripts able to log in as the right user?15:33
barrydo we usually have "a view" for whatever channel we're accessing/mutating the object through?  (i.e. xmlrpc, api, browser)?  if so, i wonder if the publishers could be hooked to provide that security checker adapter automatically15:34
cprovbigjools: login(xxx)15:34
bigjoolscprov: exactly15:34
bigjoolsso if we define the zope security adapter properly, is this moot?15:35
cprovbigjools: as a predefined celebrity, though, not the right user in most of the cases15:35
flacosteanother difference15:35
BjornTbarry: well, we have the security policies15:35
flacosteis that scripts usually use the PermissiveSecurityPolicy15:35
flacostewhich bypass all security checks15:35
bigjoolsew!15:36
barryso.  intellectronica, what's the plan?  how do we resolve this?15:37
intellectronicaas i said, i don't think there's a rule hiding here, just something to pay attention to15:38
intellectronicaif you see check_permission(this) and check_permission(that) in browser code, ask whether this belongs elsewhere, for example15:38
barryintellectronica: okay, but i think we need guidelines in the wiki so devs and reviewers can answer this question15:39
intellectronicai can try to come up with something, but obviously it will need to be reviewed by more people15:40
intellectronicai can add that and ask for comments15:40
barryintellectronica: definitely... and thanks!15:40
barry[ACTION] intellectronica to write up guidelines on check_permission in the wiki and email the ml for additional input15:41
MootBotACTION received:  intellectronica to write up guidelines on check_permission in the wiki and email the ml for additional input15:41
barryanything else on this, or any other topic?  we have 4 minutes left15:41
barryokay, thanks everybody15:42
barry#endmeeting15:42
MootBotMeeting finished at 09:43.15:42
bigjoolscheers all15:42
abentleytx15:42
=== bac is now known as bac|away
=== bac|away is now known as bac
=== Moot2 is now known as MootBot
=== bac is now known as bac|away
=== bac|away is now known as bac

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