/srv/irclogs.ubuntu.com/2013/01/10/#launchpad-dev.txt

StevenKwgrant: https://bugs.qastaging.launchpad.net/prop-auditorclient/+bug/939660 with a Proprietary project, and soyuz-team subscribed to the bug.00:07
_mup_Bug #939660: globally-installed GIMP python plugins are not accessible <amd64> <apport-bug> <oneiric> <running-unity> <The Gimp:New> <gimp-plugin-registry (Ubuntu):New> < https://launchpad.net/bugs/939660 >00:07
wgrantStevenK: It'll need to be some other team, or I'll need to steal the project from you00:08
wgrantSince I'm a commercial admin00:08
wgrantActually00:09
wgrantYou can test this yourself00:09
wgrantStevenK: https://qastaging.launchpad.net/~stevenk00:09
wgrantHmm00:10
wgrantMight need to be a team, actually00:10
wgrantStevenK: Can you see https://qastaging.launchpad.net/~soyuz-team, with the project listed?00:11
StevenKYes00:11
wgrantStevenK: How about now?00:12
StevenKwgrant: I can see the page, but the project disappeared00:13
wgrantStevenK: And now?00:14
wgrant(I've just added a team grant)00:14
StevenKwgrant: The project is back00:14
wgrantSounds qa-ok, then00:15
wgrantOh00:15
wgrantNo, that was an APG, oops00:15
StevenKHaha00:15
wgrantAnd now?00:16
StevenKwgrant: The page loads and the project is there.00:16
wgrantGreat00:18
wgrantThat's an AAG00:18
StevenKI shall mark the bug as qa-ok, then00:19
wgrantSounds good00:24
=== slank is now known as slank_away
StevenKwgrant: We want to link the identifier in the case that there is an known email, but the identifer is not known about?00:49
wgrantStevenK: Right. If the identifier is known then the identifier wins, otherwise we fall back to the email address and link the identifier for the future.00:52
wgrantCurrently if the identifier is known and the email is unknown, we add the email address. But we want to stop doing that.00:53
StevenKwgrant: http://pastebin.ubuntu.com/1515303/ Am I on the right track?01:29
wgrantStevenK: We want to at most warn if the accounts differ -- certainly not crash01:31
wgrantAnd we don't even attempt to add the address if it's missing01:31
wgrantAgain, we would at most warn about it01:31
StevenKwgrant: Right, I wasn't certain how to warn. Add an exception like TeamEmailAddressError?01:32
wgrantThat sounds like an error, not a warning.01:33
wgrantWe don't have to do a warning initially. Just ignore it for now.01:33
wgrantIt also looks like you removed the account creation bit01:34
StevenKYes, since that calls createPersonAndEmail01:34
StevenKNote that paste is WIP, I've not even looked at tests.01:34
wgrantcreatePersonAndEmail is one of the places that must obviously continue to create addresses01:35
wgranthttps://bugs.launchpad.net/canonical-identity-provider/+bug/556680/comments/501:35
_mup_Bug #556680: attempting to create a new account with an existing team email address at login.ubuntu.com oopses <isd-logging-sprint> <lp-foundations> <openid> <Canonical SSO provider:Confirmed> <Canonical ISD QA:New> <Launchpad itself:Triaged> < https://launchpad.net/bugs/556680 >01:36
wgrantThat's the sort of algorithm we want.01:36
StevenKSo I want to resurrect that code, it's sane?01:36
wgrantBut now I must go out for an hour01:36
wgrantYes01:36
wgrantStevenK: How goes?02:21
StevenKwgrant: http://pastebin.ubuntu.com/1515579/02:46
wgrant+            create_email_token = False02:51
wgrantwhy does that still exist?02:51
StevenKwgrant: Because I don't want to assert for personless account twice03:17
wgrantStevenK: But don't you only ever need to create an address if you end up calling createPersonAndEmail?03:34
wgrantRemember that we no longer want to create missing addresses03:36
wgrantThat method only adds an address if the entire person is new03:36
StevenKwgrant: create_email_token will call into getUtility(ILoginTokenSet).new(), which requires the person, and at the point I set create_email_token, I only have the account03:36
wgrantStevenK: But why are you ever calling that method?03:37
wgrantIn what situation do you need to create an email address for an existing person?03:37
StevenKwgrant: Where the OpenID identifier exists, but the address does not.03:38
wgrantStevenK: We are making this change precisely so that that no longer happens03:38
wgrantThat's the entire point of this branch :)03:38
StevenK* If the OpenID identifier has a person, and the e-mail address isn't known,03:39
StevenKcreate a LoginToken, and no e-mail address, and then when the LoginToken is03:39
StevenKconsumed, we create the e-mail address as VALIDATED.03:39
StevenKFrom my notes I made on the call03:39
wgrantAh03:39
wgrantThat bit was a misunderstanding, clearly03:39
wgrantIf the email address isn't known, we do nothing, except maybe eventually warn03:40
wgrantThat's the entire point of the change03:40
StevenKI'm not sure how to warn :-(03:40
StevenKWe can't toss exceptions03:40
wgrant"eventually"03:40
wgrantSo do nothing03:40
wgrantSure03:40
wgrantAn exception from a login method is not a warning :)03:41
wgrantHow do we normally present non-fatal warnings?03:41
StevenKUsing addNotification03:41
wgrantPrecisely.03:41
wgrant(well, addWarningNotification)03:42
StevenKRight, which means returning a 3-tuple and ugh03:42
wgrantThat's why I said eventually03:42
wgrantGet it working first03:42
wgrantMaybe even land it03:42
wgrantThen work out how to do warnings03:42
wgrantThe key thing for now is to stop the destructive rampage03:42
StevenKWorking through test failures03:43
StevenK  File "/home/steven/launchpad/lp-branches/openid-identifier-is-the-new-black/lib/lp/registry/tests/test_personset.py", line 818, in testNewEmailAddress03:43
StevenK    self.assertIs(True, updated)03:43
StevenKWell, about that ... :-)03:43
StevenKMismatchError: True is not False03:43
StevenKI guess that test is now bong with this change?03:44
wgrantIt certainly sounds like it's testing a piece of functionality that we're deliberately removing, so removing the test sounds sensible03:44
StevenKAnd testMovedEmailAddress -- like you say, the whole point is to stop doing that03:46
wgrantNot quite03:47
wgrantThe case it gives there is still valid03:47
wgrantBut our behaviour is different03:47
wgrantThe test name and result are no longer correct, but the scenario must continue to be tested03:47
StevenKwgrant: This test pulls an account by using store.find(), I guess I need another DB query to find it's person?03:58
wgrantits04:00
wgrantYou can adapt an Account to IPerson04:00
StevenKwgrant: The only thing I'm tripping over is testNoAccount. It forces self.email.account and self.person.account to None and then calls into getOrCreateByOpenIDIdentifier()04:13
wgrantStevenK: Is that a problem?04:16
StevenKwgrant: Well, the test fails due to the assert in getOrCreateByOpenIDIdentifier()04:16
wgrantWhich assert?04:17
StevenK            person = IPerson(account, None)04:17
StevenK            assert person is not None, ('Received a personless account.')04:17
wgrantAh04:18
wgrantSo if you just blank out person.account without deleting the account then you'll end up with a personless account, which is illegal.04:18
wgrantThat same assertion was there before04:19
wgrantWhy did it work?04:19
StevenK-                    # The Email Address does not exist in the database,04:19
StevenK-                    # but the OpenId Identifier does. Create the Email04:19
StevenK-                    # Address and link it to the person.04:19
StevenKIt was in that block04:19
wgrantSo, that test is crap04:20
wgrantIt creates an illegal state which happened to work before04:20
StevenKHaha04:20
wgrantAdjust it to remove the account, or at least remove its OpenID identifier04:20
StevenKDestroy?04:20
StevenKAw04:20
wgrantOh, but it uses its own identifier?04:20
wgrantThen how does it find the old account at all?04:21
StevenKNow?04:21
wgrantWhen it fails04:21
StevenKRunning the test under pdb so I can see what's what.04:22
wgrant(note that self.email.account = None is effectively a no-op; the column hasn't existed for 12 months so that just creates a new unused attribute, but I clearly didn't catch all the callsites)04:22
StevenKHah04:22
StevenKRight, so the case is OpenID == None, and email == <address>04:23
StevenKAnd email.person.account is None04:23
wgrantRight04:24
wgrantSo it should create an account04:24
wgrantHow does it end up with a personless one?04:24
StevenKI think the error is misleading04:24
wgrantIs the account itself None?04:24
StevenKIt should assert "Could not find Person from account" or something04:24
wgrantNo04:24
StevenK(Pdb) p email.person04:24
StevenK<Person at 0x10133110 acc2436244 (Displayname)>04:24
wgrantIf an account doesn't have a person, it's personless04:24
StevenK(Pdb) p email.person.account04:24
StevenKNone04:24
wgrantThe error is correct04:24
wgrantSure04:24
wgrantBut what is "account" in "person = IPerson(account, None)"?04:25
StevenKaccount will be set to email.person.account04:25
wgrantIn the latest diff I have, you've removed the account creation code04:25
StevenKIn this case04:25
wgrantSo account may be None04:25
StevenKSo None04:25
wgrantRight04:25
wgrantThere's your problem04:25
StevenKwgrant: http://pastebin.ubuntu.com/1515737/04:26
wgrantRight04:26
wgrantNote the suspiciously deleted AccountSet.new, with no replacement04:26
StevenKRight, now resurrected04:28
wgrant(an accountless person is probably inactive, so it's covered by the "if person is not active" block in my pseudocode)04:29
wgrantIn fact, I think an accountless person must be inactive04:29
* wgrant checks04:29
wgrantWell04:30
wgrantyes04:30
wgrantThey have to be04:30
wgrantSince activeness is defined by account.status :)04:30
StevenKHaha04:30
StevenKNow I get IntegrityError: null value in column "account" violates not-null constraint04:31
wgrantlaunchpad_dogfood=# SELECT COUNT(*) FROM person WHERE teamowner IS NULL AND account IS NULL AND EXISTS (SELECT 1 FROM emailaddress WHERE status = 4 AND person = person.id);04:31
wgrant count04:31
wgrant-------04:31
wgrant     004:31
wgrant(1 row)04:31
wgrantStevenK: That sounds like it's talking about OpenIDIdentifier.account?04:31
StevenKAh, yeah. I can't create the account that late.04:32
wgrantNote also that my pseudocode assumes that account has ceased to exist, so it might need some adjustment04:32
wgrantI had planned to destroy Account by last March, but that didn't eventuate04:32
wgrantDue to SSO04:32
StevenKRight, and OpenIDIdentifier.account is NOT NULL, so that is fine04:32
StevenKBleh, stop erroring, I create a account04:35
StevenKAnd it should be added to the store by IAccountSet.new, so I'm not sure why that assert trips04:36
StevenKBleh, the account isn't added to the store in IAccountSet.new04:47
StevenKwgrant: Right, I have the test_personset tests passing04:58
wgrantGreat05:00
StevenKThat's ... comforting. No logintoken failures, even though I removed 70 lines of code.05:01
wgrantWasn't most of that from the browser code, though?05:02
wgrantIt's probably in the OpenPGP validation workflow tests05:02
StevenK+14/-97 including browser code05:03
StevenKHmm, bin/test -vvt openpgp has no love05:04
wgrantThey'll be named gpg, I suspect05:04
StevenKYeah, -t gpg running now05:04
StevenKlib/lp/registry/stories/gpg-coc/xx-gpg-coc.txt is the failure05:05
StevenKwgrant: http://pastebin.ubuntu.com/1515800/05:20
wgrantStevenK: Why don't you use AccountSet.new/05:30
wgrantAlso, now that we don't attempt to move email addresses around the team ownership check can be just before the person creation bit05:31
StevenKwgrant: The comment before explains it:05:31
StevenK                        # IAccountSet.new() creates an OpenIdIdentifier, which05:31
StevenK                        # we do below.05:31
wgrantStevenK: It's an optional argument05:31
StevenKOh, I misread it as 'is None'05:32
wgrantSo yeah, I'd move the team address check into the same place it is in my pseudocode05:33
wgrantThat is, the 'if email is not None' becomes 'if email is not None and not email.person.is_team'05:33
wgrantAnd then a new elif after that which rejects login if the address is team-owned05:33
StevenKYes, just wrote that05:34
wgrantAlso, we might as well make that whole thing identifier-driven05:34
wgrantSo the 'if identifier is not None' bit goes away05:35
StevenKHm?05:36
StevenKNot sure I understand what you mean05:36
wgrantI was a little unclear05:36
wgrantBut basically I don't think the 'account' local var is valuable05:36
wgrantperson = IPerson(account, None) should be05:36
wgrantperson = IPerson(identifier.account, None)05:36
wgrantThat is, before then you just ensure that identifier is set properly05:36
wgrantIf identifier is not None then you don't have to do anything05:36
wgrantIf identifier *is* None, then you have to go through the email address check05:37
wgrantSo all the email stuff can be inside an 'if identifier is None' block05:37
wgrantTo make it clearer that the identifier completely wins if it exists.05:37
StevenKJust running tests, and I can post a new diff05:39
StevenKwgrant: http://pastebin.ubuntu.com/1515818/05:40
wgrantStevenK: I reworked it to hopefully be a bit clearer. What do you think? http://pastebin.ubuntu.com/1515824/05:52
StevenKLooks good05:54
wgrant(this method has a hilarious history of bugs and misreadings, so I think we should make this rewrite as understandable as we can)05:54
StevenKwgrant: So, looks good enough to propose, or we should go further?05:57
wgranthttp://pastebin.ubuntu.com/1515841/05:59
wgrantNow it's much more understandable, I think05:59
wgrantSo propose away :)06:01
StevenKwgrant: https://code.launchpad.net/~stevenk/launchpad/openid-identifier-is-the-new-black/+merge/14264106:28
wgrantStevenK: In testEmailAddressAccountAndOpenIDAccountAreDifferent can you check that the email account is unchanged?06:36
StevenKwgrant: http://pastebin.ubuntu.com/1515904/06:41
wgrantStevenK: Sounds reasonable.06:46
StevenKIt even passes06:46
StevenKwgrant: Any other issues?06:46
wgrantNope06:46
StevenKHmm, can we actually QA this without going insane?06:47
wgrantTo some extent06:47
wgrantI'll do it, because I have lots of accounts that I'm not too afraid of breaking06:47
wgrantAnd I know all too well how to break this :)06:48
StevenK 16415. By Steve Kowalik 2 minutes ago06:49
StevenK    Assert the e-mail account is unmolested in testEmailAddressAccountAndOpenIDAccountAreDifferent.06:49
=== almaisan-away is now known as al-maisan
StevenKDear lp-land, why is the private bug in the commit message, but the public one isn't?06:50
wgrantBecause I unlinked the public one, because it doesn't fix it06:51
wgrant:)06:51
StevenKThanks for the lack of warning :-P06:51
wgrantI try06:52
StevenKwgrant: Warning if the accounts are different will fix it?06:54
wgrantStevenK: That bug sort of encompasses the weaknesses in our workflow that I identify in my rather large comment06:55
wgrantIt includes more than just email conflicts.06:55
StevenKRight.06:55
StevenKSo this branch fixes *part* of it06:55
wgrantUm06:56
wgrantSort of06:56
wgrantNot reallty06:56
* StevenK glares at the test failure07:30
StevenKwgrant: Hmmm07:39
StevenKwgrant: I think the test fails because we only croak if there is no OpenID identifier07:40
StevenKWe pass one, get an account, login_called is True, test goes bang07:40
wgrantStevenK: Right, the test probably assumes that we won't allow login with a team address at all, whereas we've now relaxed that to just failing the account creation case07:45
wgrantAdjust the test to use a new OpenID identifier07:45
StevenKI've been trying to work out where we even pass in the identifier07:47
wgrantStevenK: _createViewWithResponse gets it from the provided account07:48
StevenKPassing None as the account is probably a silly idea?07:49
wgrantWell, it won't work07:51
StevenKIndeed, it doesn't07:52
wgrantYou'll need to alter _createViewWithResponse to alternatively take an identifier string07:52
StevenKAnd that's the first argument to FakeOpenIDResponse?07:52
wgrant        openid_response = FakeOpenIDResponse(07:53
wgrant            ITestOpenIDPersistentIdentity(account).openid_identity_url,07:53
wgrant            status=response_status, message=response_msg,07:53
wgrant            email=email, full_name='Foo User')07:53
wgrantIt would certainly seem to be07:53
StevenKwgrant: http://pastebin.ubuntu.com/1516114/07:56
StevenKI'll land it when I get home07:56
wgrantStevenK: Right08:01
adeuringgood morning08:50
=== yofel_ is now known as yofel
=== Ursinha is now known as Ursinha-afk
=== al-maisan is now known as almaisan-away
=== slank_away is now known as slank
=== Ursinha-afk is now known as Ursinha
=== mbarnett` is now known as mbarnett
=== slank is now known as slank_away
=== slank_away is now known as slank
=== slank is now known as slank_away
=== slank_away is now known as slank
=== slank is now known as slank_away
=== gary_poster is now known as gary_poster|away
=== gary_poster|away is now known as gary_poster
=== deryck is now known as deryck[lunch]
=== slank_away is now known as slank
=== deryck[lunch] is now known as deryck
=== slank is now known as slank_away
=== Tribaal_ is now known as Tribaal
=== slank_away is now known as slank
=== olli_ is now known as olli
=== slank is now known as slank_away
=== slank_away is now known as slank
=== slank is now known as slank_away

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