/srv/irclogs.ubuntu.com/2010/01/13/#launchpad-meeting.txt

=== danilo_ is now known as danilos
=== danilo_ is now known as danilos
=== mrevell is now known as mrevell-lunch
=== mrevell-lunch is now known as mrevell
=== salgado is now known as salgado-lunch
bac#startmeeting15:00
MootBotMeeting started at 09:00. The chair is bac.15:00
MootBotCommands Available: [TOPIC], [IDEA], [ACTION], [AGREED], [LINK], [VOTE]15:00
bacwelcome to the AMEU Reviewers meeting.15:00
bacwho's here today?15:01
flacosteme15:01
sinzuime15:01
henningeme15:01
marsmoo15:01
adeuringme15:01
bacEdwinGrubbs, deryck, gmb, BjornT: ping15:02
EdwinGrubbsme15:02
gmbme15:02
gmbErk15:02
deryckme15:02
bacgary_poster: ping15:02
gary_posterbac: thank you, me15:02
bacteam leads ping your peeps15:03
gary_posterdone.  May not get too many from my team.15:03
danilosme15:03
baci know we have a lot of people missing today due to sprints, so let's move on.15:04
henningebac: jtv is sprinting15:04
bac[topic] agenda15:04
MootBotNew Topic:  agenda15:04
bacyay, mootbot is not case sensitive!15:04
gary_posterheh15:04
bac * Roll call15:04
bac * Action items15:04
bac * Limit doctests to 200 lines [allenap]15:04
bac * Security checks: ``try:...except UnauthorizedError:...`` vs. canView [gary]15:04
bac * Cleaning up ImportFascist warnings [bac,sinzui]15:04
bac * Peanut gallery (anything not on the agenda)15:04
allenapme15:04
intellectronicame15:04
danilosallenap, (a nice trick to get pinged through agenda ;)15:05
bac[topic] outstanding actions15:05
MootBotNew Topic:  outstanding actions15:05
bac[topic] * intellectronica to draft guidelines for drive-by cleanups15:05
MootBotNew Topic:  * intellectronica to draft guidelines for drive-by cleanups15:05
intellectronicasorry, haven't done that. please keep it on the list and i'll get it for our next meeting15:06
bacintellectronica: excellent, thanks!15:06
bac[topic] invite other teams to do lazr-js code reviews? (See if this was sent to the ML.) [mars/bac]15:06
MootBotNew Topic:  invite other teams to do lazr-js code reviews? (See if this was sent to the ML.) [mars/bac]15:06
baci searched through the ML's and did not see it had been discussed15:06
bacmars did you have some thoughts on the topic?15:06
marsbac, I'm going to add it to the agenda for the lazr-js taskforce call tomorrow15:07
bacmars: ok, so you can report back here next week.15:07
marsbac, you can keep it on the list here if you would like to see a wrapup item next week15:07
bac[action] mars to report on outcome of lazr-js review discussion15:07
MootBotACTION received:  mars to report on outcome of lazr-js review discussion15:07
marsyeah :)15:07
bacgreat, moving on to new items15:07
bac[topic] Limit doctests to 200 lines [allenap]15:08
MootBotNew Topic:  Limit doctests to 200 lines [allenap]15:08
bacgavin, take it away15:08
allenapRight,15:09
allenapBecause of the accumulation of state in doctests15:09
allenapI think it would be good to limit new doctests to 200 lines or less.15:09
allenapgmb wrote a new doctest last week of just under 200 lines and it was still perfectly comprehensible.15:10
allenapSo that's where the number comes from.15:10
* gmb notes that it got changed into a unittest anyway during the review process...15:10
danilosI don't think that'd be right for large classes and corresponding doctests, 200 sounds as artificially low limit15:10
allenapAlthough manuel (?) adds a reset-globs directive whihc might make this moot.15:11
flacosteand there is an alternative to the state problem15:11
danilosperhaps large classes are the problem, but we do have them15:11
flacosteexactly, reset-globs in manuel15:11
gary_posteragree with danilos.  Also, agree with allenap's observation of manuel15:11
sinzuiallenap: I have thought about breaking many registry doctests into smaller themes15:11
flacostemanuel also adds the option of running specific section of a doctest15:11
sinzuiallenap: but my motivation it to control the layer the test is run on.15:11
intellectronicai think limiting the length is not the best way to handle this. instead i suggest dividing tests thematically15:12
marsI agree, I don't see the problem as much with larger narratives as it is with naughty test code state.15:12
danilossinzui, I think the problem with existing doctests is that we don't have a good structure of tests in general (oh, I'd like to clean most of translations ones as well)15:12
intellectronicathat is, stop and start a new file when you're really testing something new (with new state and so on)15:12
bacintellectronica: i agree15:12
allenapThe main problem I have is trying to understand the object and database state by the end of the test. That can't really be fixed by reset-globs or manuel as I understand it.15:13
danilosintellectronica, +1, basic doctests (those which are usually large) should be basic class documentation; specific tests should be unit test15:13
allenapintellectronica: The limit is an incentive to split :)15:13
allenapintellectronica: But I agree.15:14
danilosallenap, I see the point, but artificial limit would have to be broken in so many valid cases15:14
intellectronicaallenap: yes, i understand that, but somehow it feels a bit too artificial to me. are you concerned that without a hard limit developers/reviewers won't bother?15:14
bacallenap: it is a good point but i'd rather see us have smaller, more themed tests as a guide rather than adopting a limit15:14
gary_posterWe do have a "800 line limit for reviews" that is a guideline but often breached15:14
intellectronicaalso, i'll play sinzui and ask: who's going to split all the existing test? ;)15:15
daniloshow about instead spreading a rule "enforce corner-case testing through unit tests" among reviewers instead? those tend to make doctests harder to read15:15
marsinstead of a hard limit, can we call it a "refactor point"?  As in, over X lines, the reviewer should look for a possible refactoring15:15
allenapOkay, sounds good. Is there a way to measure or have more concrete guidelines, or is it at developer/reviewer discretion?15:15
marsit's ok if they do not find such a point15:15
marskind of like review lint15:15
intellectronicaallenap: there is a measure. variables shouldn't be recycled15:16
danilosmars, I still believe that those complex doctests should really be turned into unittests, and that's exactly where you can't reuse variables :)15:16
allenapintellectronica: I don't think we should split the existing tests... until it is no longer possible to not split them.15:16
allenapintellectronica: I like that :)15:16
allenapintellectronica: There's still a problem of db state.15:16
marsdanilos, well, if they are over 800 lines, then you would recommend the refactoring, wouldn't you? :)15:16
intellectronicaallenap: if we adopt this as a policy we will eventually have to split the tests, if only so that they don't serve as a negative example for new contributors15:17
allenapdanilos: +115:17
marsdanilos, or 400, or whatever15:17
sinzuiintellectronica: One line that creates a file or email message requires that the test be run on a different layer. In many cases the test is actually moving to a new theme and I think it is easier to read the that aspect of the test separately.15:17
allenapintellectronica: Good point.15:17
intellectronicaallenap: i guess it's the same for db state. don't rely on db state unless it's either set in the sample data or in the prologue to your test15:17
danilosmars, well, reviewers should always look for points of refactoring, so I just feel such "rule" wouldn't really make any difference, but sure :)15:18
allenapintellectronica: I agree, and I don't know of a way to make it less vague than that. I suppose that's what I was looking for.15:18
gary_posterI find the stories that doctests tell valuable.  The stories are often long--and in fact, I often wish they were *better* connected, not less, from a narrative standpoint.  That viewpoint would make me want to see manuel a preferred option, or perhaps Sphinx involved for tying together story chunks, but that is maybe herder.15:18
intellectronicasinzui: so what you're saying is that we should split tests if we're required to run the test in a lower layer because of a change in the middle of the test?15:18
danilosmars, even when the diff you are looking at is 10 lines, as a reviewer, you should wonder if the code is sitting in the right place15:18
gary_posterand means that it doesn't help for reading text files, only processed files15:19
marsdanilos, well, I don't think of it as a rule, just a recommendation for reviewers.  Kind of a warning, or code advice.15:19
gary_posters/herder/harder/15:19
marsdanilos, right15:19
danilosanyway, it seems this is a hot topic15:19
danilosallenap, bac, shall we move it to the mailing list or try to come up with a conclusion here?15:20
gary_posterI think a lot of people talking about dividing things up are coming from the perspective of (1) expertise and (2) testing.15:20
sinzuiintellectronica: yes. In the exampled I am thinking about, registiry object deletion, email notification, these themes are different from the core uses of the object.15:20
allenapdanilos: Mailing list I think. There are many threads of conversation and this isn't going to end here anyway ;)15:20
gary_posterthey are valuable, but these are narratives.15:21
intellectronicasinzui: yes, i think that's a good guideline15:21
danilosallenap, right, I think the general consensus is that we don't want 200 as the limit, so it's best to discuss other solutions to the problem you observe on list15:21
bacdanilos: yes, let's move the discussion to the mailing list.  allenap will you start the discussion there?15:21
allenapbac: Sure.15:21
marsgary_poster, good point15:21
gary_poster:-) thank you mars15:21
bac[action] allenap to start discussion on the ML about doctest size, refactoring, moving corner cases to unittests, etc15:21
MootBotACTION received:  allenap to start discussion on the ML about doctest size, refactoring, moving corner cases to unittests, etc15:21
bac[topic] Security checks: ``try:...except UnauthorizedError:...`` vs. canView [gary]15:22
MootBotNew Topic:  Security checks: ``try:...except UnauthorizedError:...`` vs. canView [gary]15:22
gary_posterOK I almost have the conversation pastable but not quite.15:22
gary_posterI was talking with EdwinGrubbs about a security check.  He was checking whether a user had a specific permission on an object.  He was using a utility in the LP tree that I forget.15:22
gary_posterI said that my top preference would be try:...except UnauthorizedError:... and my next preference would be canAccess and canWrite from zope.security.checker.15:22
gary_postercanView is nicer because you do not specify the permission, which is fragile.15:22
gary_posterThe try/except approach uses the basic security machinery directly.  It is of course the basic mechanism that Zope provides.15:22
gary_posterEdwin pointed out that this was not a pattern in the LP tree.  He was also afraid it would be slower.15:22
gary_posterI'm pretty sure it will not be slower than calling a Python function, but can verify with a timeit test.15:22
gary_posterSo, I suppose I have these thoughts:15:23
gary_poster1) I'd like to make sure that we generally agree that we don't want to specify permissions unless we have to15:23
gary_poster(that is, my main suggestion from the story above)15:23
gary_poster2) I'd like people to consider using the try/except approach, and for it to be a reasonable/approved one.  If we want me to construct a timeit test to verify I can.15:24
gary_posterThat's it.15:24
gary_posters/conversation pastable/introduction pastable/ ;-)15:25
* danilos reads15:25
intellectronicagary_poster: i also think that using try/except is clearer15:25
gary_postercool15:25
baci think a lot of us have heard the "wisdom" that try/except is slower.  i think a timeit test to disprove that would be useful.15:26
danilosI know we are using checkPermission for these things15:26
gary_posterEdwinGrubbs: are you around to say remind me what the utility was that you used at first?15:26
gary_posterMaybe it is checkPermission15:26
EdwinGrubbsyes, it was check_permission()15:26
danilosfrom canonical.launchpad.webapp.authorization import check_permission15:27
gary_posterah ok, looking15:27
danilosbac, +115:27
flacosteit's a wrapper around checkPermission15:27
intellectronicabac: why is performance an issue here? usually you don't call these in loops15:27
gary_posterflacoste: oh ok15:27
danilosexample: check_permission('launchpad.Edit', pofile)15:27
flacosteand i think actually the try: except: is what is used under the hood by check_permission anyway15:27
EdwinGrubbsyou do call them in loops if you are displaying a list of objects15:27
gary_posterso generally, I don'y think we should use check_permission (or checkPermission) again, if at all possible.  That's my #1,15:27
gary_postercanAccess and canWrite are less fragile15:28
gary_posterI'm happy to do the timeit check.  I still think that try/except will be faster than a Python function, but I think that's interesting information, so I can do that and report back to the list.15:28
henningegary_poster: Is this in view or in model code?15:28
EdwinGrubbsview code15:29
bacintellectronica: it may be in a loop.  if some timing tests can show it is a myth then i think that's useful.15:29
henningegood15:29
intellectronicabac: knowing is definitely useful, but i think that even if we find that it is slower, we should still consider using try/except in cases where it doesn't affect performance _drastically_15:30
flacostehmm, right15:30
flacostecanAcess / canWrite uses try: except15:30
flacostewhereas checkPermission uses the checker information15:30
bacintellectronica: well, a lot of these cases are in vocabularies, IIRC.  many of those do have performance issues15:30
intellectronicabac: yes, where we do it iteratively we definitely should optimize for performance15:31
danilosthe reason I don't like try...except is that (especially with API), we will get a lot of cases where we'll have multiple conditions we are checking for15:32
danilosso, nested try..excepts sound ugly to me15:32
gary_posterIf try:except is faster, as I suspect, then we do not have to have the theoretical discussion.  suggested resolution for now: I'll do the timeit test and report back to the list.  If there is a clear answer in favor of try/except for performance as well, then that's easy.  ...except for danilo's case...15:32
gary_posterdanilo, can you send me an example to look at?15:33
danilosgary_poster, I am not even sure it's a valid example, but there are cases where we do an OR of multiple permission checks15:33
gary_posterdanilos: right, I'd like to see if it is valid; if it is not, we should know what a preferred spelling us15:34
danilosbut that's probably just bad design where objects are not properly security-wrapped15:34
bac[action] gary to do timing tests for try/except, examine current usage of check_permission, and we'll discuss again next week.15:34
gary_posteris15:34
MootBotACTION received:  gary to do timing tests for try/except, examine current usage of check_permission, and we'll discuss again next week.15:34
gary_postercool thanks15:34
bacthanks for bringing it up gary15:34
bac[topic] Cleaning up ImportFascist warnings [bac,sinzui]15:35
MootBotNew Topic:  Cleaning up ImportFascist warnings [bac,sinzui]15:35
bacjml's fix to the import fascist revealed lots of places where we have problems15:35
bacwe need to drive those warnings back to zero or we'll continue to expand the problem15:36
danilosgary_poster, sure, why don't you ping me later and we can take a look (basically, lp.translations.browser.distroseries.DistroSeriesLanguagePackView has an example)15:36
bacsinzui has a branch that accomplishes a lot of it but has reported new code is  introducing more problems15:36
bacsinzui where did you find the bulk of the offenders to be?15:36
gary_posterdanilos: awesome thank you15:36
sinzuiMost were explicit import from _schema_circular_imports which were not needed15:37
sinzuiThey were easy to remove15:37
bacsinzui: does your branch solve the problem for LP or just registry?15:37
sinzuiLP, but there are two new ones in the last 12 hours15:37
bacah, cool.  so once this branch lands we can go back to zero tolerance as reviewers, no?15:38
sinzuiBranchJobDerived BranchJobType are not in BranchJob.__all__, but are imported by translationtemplatesbuildjob and translationtemplatesbuildjob15:38
gary_postershould we make them errors?15:38
gary_posterI thought that was an option15:39
sinzuiI could add these two classes to __all__, but I think the code team and translations team need to coordinate15:39
danilossinzui, if it has happened during last 12h, it's something that's happening during a sprint in Wellington15:39
sinzuicorrect15:40
danilossinzui, and I don't really overlap with them, so I'd appreciate if you mention it to jtv when he shows up and I am sure he'll be happy to fix the issue or find someone who will :)15:40
sinzuiI will15:40
danilossinzui, thanks15:40
bacso we're in agreement to get this cleaned up over the next week and then keep it under control?15:41
danilossinzui, and thanks for spending the effort to fix it everywhere else as well, I hope we didn't have many issues in translations since we shouldn't be able to import stuff if we do (because we are not using global imports either)15:41
danilosbac, +115:41
bac[action] sinzui to land a import cleanup branch and then reviewers will enforce zero tolerance for introducing new issues.15:42
MootBotACTION received:  sinzui to land a import cleanup branch and then reviewers will enforce zero tolerance for introducing new issues.15:42
bacthat's it for agenda items15:42
danilossinzui, bac: just to confirm, this will also be part of lint checks?15:42
bac[topic] peanut gallery15:42
MootBotNew Topic:  peanut gallery15:42
sinzuilanding is challenging since we are in phantom testfix15:42
danilos(i.e. easy to spot)15:42
danilossinzui, js buildbot?15:43
bacdanilos: i'm not sure.  sinzuie?15:43
bacer, sinzui?15:43
sinzuidanilos: importfacist has never been a part of lint since the testrunner has alwyas reported them15:43
bacthanks15:43
sinzuidanilos: I thought I saw rockstar land a reversion to get us out of testfix15:43
flacostesinzui: it's not phantom15:44
flacostedb_lp has three failures15:44
bacmoving on, does anyone have an issue that is not on the agenda?15:44
flacosterelated to code hosting15:44
flacostei have15:44
bacflacoste: go15:44
flacostebut it's not related to reviewers :-)15:44
bachmm15:44
flacostebut would like the opportunity that we have a lot of attention :-)15:44
flacostewe need a volunteer to fix the db_lp failures15:44
bacflacoste: ok, reminding you we're at 45 minutes15:44
flacostethat's all15:45
flacostebac: you can cloase the meeting15:46
bacflacoste: let's try to resolve that outside the meeting15:46
bac#endmeeting15:46
MootBotMeeting finished at 09:46.15:46
bacthanks everyone for coming15:46
gary_posterthanks bac15:46
marsthanks bac15:47
flacostethese are the errors:15:47
flacosteTests with errors:15:47
flacoste   lp.code.model.tests.test_branchjob.TestRevisionsAddedJob.test_getMergedRevisionIDs15:47
flacoste   lib/canonical/launchpad/ftests/../../../lp/bugs/doc/bug-set-status.txt15:47
danilosthanks bac15:47
flacoste   lp.code.model.tests.test_codeimport.TestCodeImportDeletion.test_deleteIncludesJob15:47
bacflacoste: what about the other two?15:47
sinzuiLayerIsolationError15:47
bacoh, nm15:47
sinzuifor all of them15:47
flacosteindeed15:48
sinzuiI suspect the test env, not the test15:48
flacostewell15:48
flacostetest_deleteIncludesJob15:48
flacosteis an Unauthorized error15:48
sinzuisorry, I did not see that15:49
flacostewell, no15:49
flacostelayerIsolationError are problems with the test15:49
flacosteit means that an object created by the test cannot be garbaged collected15:49
sinzuiThe bug test has not change in 6 months, and before that 2 years ago15:51
flacosteright15:53
flacostethe problem is that these layerIsolation might not be directly associated with the test15:53
flacostebut it sure comes from some kind of changes15:53
flacostelooking at the garbage left, it seems to be bzrlib objects15:54
sinzuiI saw this happen when the order of tests changed15:54
sinzuiI had to set the dirty db flag in some tests to fix the issue15:54
flacostewas the garbage related to bzr in that case?15:55
flacosteshould we simply revert these revisions?15:56
sinzuiNo. two or three years ago I discovered that many unit tests were creating objects. I had to modify the tearDown(). The error was only observed by testing the layer15:56
flacosteis the Unauthorized error reproducible locally at least?15:56
=== deryck is now known as deryck[lunch]
sinzuiNo it does not fail16:01
=== salgado-lunch is now known as salgado
flacostesinzui: should we simply trigger a rebuild?16:13
sinzuiflacoste: I was tempted.16:15
=== deryck[lunch] is now known as deryck
sinzuimars: do you have a script that scores new users yet?17:24
=== gary_poster is now known as gary-lunch
=== danilos is now known as daniloff
=== gary-lunch is now known as gary_poster
=== salgado is now known as salgado-afk
sinzuilosas ping21:46
jmlsinzui, what's your boggle?21:56

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