/srv/irclogs.ubuntu.com/2020/04/20/#launchpad-dev.txt

cjwatsonCould I have a review of https://code.launchpad.net/~cjwatson/lp-signing/+git/lp-signing/+merge/382431 (Run migrations in charm), please?09:56
tomwardillcjwatson: you have migrations happening before service.configured, is that the right order?10:00
cjwatsontomwardill: I think so - doesn't seem like a good idea to claim that the app is up before its DB schema is up to date10:01
tomwardillfair10:01
tomwardillhave a +1 :)10:01
cjwatson(In fact, gunicorn starts on service.configured, so we definitely need to avoid doing that early.)10:03
cjwatsonThere is a certain amount of puzzle-box programming here to figure out exactly how to avoid tickling the OLS layers in the wrong way.10:03
cjwatsonThanks10:03
* tomwardill fetches more coffee10:05
tomwardilldo we want users to be able to create credenti'als with the same url and username?10:58
tomwardillI'm leaning towards we should check for that10:58
cjwatsonIt seems likely to be confusing11:00
* tomwardill adds the check11:00
tomwardillbut first, lunch11:00
cjwatsonAh that's right, didn't add a DB constraint because we weren't really sure enough of what form creds would take I think11:01
tomwardillYeah, still not sure. The first set is obviously going to be username and password, but tokens are a possibility later.11:44
tomwardillDoing code checks for it makes the most sense, as we’ll need to change the push code to handle anything other than None and username/password11:44
cjwatsonNot to mention the UI.11:46
tomwardillOh yes, that too.11:46
cjwatsonhttps://code.launchpad.net/~cjwatson/lp-signing/+git/lp-signing/+merge/382581   brown-paper-bag fix to DB setup, please review12:23
tomwardillcjwatson: +112:34
tomwardillcjwatson: do we have any precedence for a 'createOrExisting' type method?14:30
tomwardillI'm thinking Registry Credentials could use that14:31
tomwardillmaybe get_or_create is a better description14:31
cjwatsontomwardill: Yeah, there are various14:37
cjwatsontomwardill: Several getOrCreateFoo14:37
cjwatsontomwardill: ensureFoo is also an option14:37
tomwardillah, excellent14:38
tomwardillI shall try some variant of that14:38
* tomwardill blergs at the web service15:42
tomwardillgetting a 401 when I try to call my new method, when I am definitely the owner15:44
pappacenaIs there anything on the response's body?15:45
tomwardill"(<lp.oci.model.ocirecipe.OCIRecipe object at 0x7f3fa1f8c250>, 'createPushRule', 'launchpad.Edit')"15:45
pappacenastrange... did you try `user.isOwner(the_oci_recipe_object)`, just to make sure?15:47
cjwatsonI usually find that some bit of ownership is not what I think it is ...15:47
tomwardillis there a way to debug this?15:47
pappacenaOn security.py, put a breaking point at EditOCIRecipe.checkAuthenticated15:48
cjwatsonYep15:49
cjwatsonAlternatively, breakpoint on zope.publisher.publish.mapply is a bigger hammer if you need it15:49
cjwatsonThat should be shortly before the traversed-to method is entered15:49
tomwardilloh, maybe I'm doing a silly15:49
cjwatson(But EditOCIRecipe.checkAuthenticated is an easier place to start, probably)15:50
tomwardillnarrator: he was doing a silly.15:50
tomwardill(forgot the owner= on factory.makeOCIRecipe)15:50
cjwatson16:47 <cjwatson> I usually find that some bit of ownership is not what I think it is ...15:50
cjwatson:-)15:50
pappacenahahaha! Been there, done that...15:51
tomwardillNoCanonicalUrl: No url for <lp.oci.model.ocipushrule.OCIPushRule object at15:51
tomwardillah, yes15:51
tomwardillthat15:51
cjwatsonpappacena: Could you have a quick look at https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/382592 ?15:51
* pappacena sure!15:52
cjwatsonShould fix an OOPS I hit on dogfood15:52
pappacenaTom, URL tag on zcml... export the new entity on webservice.py...15:52
pappacenaAhm... I didn't realise the signing process uses a different db user. Thanks for the MP, cjwatson15:53
cjwatsonEasy to miss15:55
cjwatsonpappacena: Did you notice http://lpbuildbot.canonical.com/builders/lp-devel-xenial/builds/1192/steps/shell_9/logs/summary ?16:06
pappacenaNo... let me check16:06
cjwatsonand/or do you need help debugging it?16:07
cjwatsonUgh, passes for me locally16:08
pappacenaI'll try to reproduce... but I don't recognize those tests...16:08
pappacenauhm...16:09
pappacenathere was a timeout trying to start rabbitmq at the begining... could that be the cause?16:09
cjwatsonpappacena: Ah, the patch that triggered this was just adding DB tables, so buildbot is probably unfairly blaming you16:10
cjwatsonIt's possible16:10
pappacenaLet me force build it again16:10
cjwatsonI've just retried, sorry for the noise16:10
pappacenaNo problem :)16:10
tomwardilltesttools.matchers._impl.MismatchError: 200 != 404: Object: <lp.oci.model.ocirecipe.OCIRecipe object at 0x7f8c1bebfe10>, name: u'string:distribution-100004'16:21
tomwardillyou're not wrong there testtools, you're not wrong16:21
cjwatsonThat string: is slightly suspicious16:22
cjwatsonFeels like a buggy <browser:url/>16:22
tomwardillyeah, that would make sense16:22
tomwardillI'm failing to define the correct url for a pushrule, apparently16:23
tomwardillany ideas why "path_expression="string:+pushrule/${id}" is producing: 'http://api.launchpad.test/devel/~person-name-100000/distribution-100004/+oci/oci-project-name-100017/+recipe/oci-recipe-name-100018/+pushrule/None'16:38
tomwardillthe None there isn't exactly right...16:38
pappacenaStrange. Is it really commited to database? Did you check if the OCIPushRule object actually has an ID at that point?16:41
cjwatsonids are typically serials which are generated by the DB in the process of adding the row, so you may need to flush after adding the object to the store in order to get the id back16:42
cjwatson(commit would do it too but is overkill)16:42
cjwatsonAnother small fix found while QAing the signing service: https://code.launchpad.net/~cjwatson/lp-signing/+git/lp-signing/+merge/38259816:50
pappacenaI'll check16:50
tomwardillokay, that fixed my id, now to work out why I'm getting a 404 :)16:51
pappacenaNew @stepthrough method on OCIRecipeNavigation ?16:56
tomwardillyep, that's the one. Ta pappacena :)17:02
* pappacena Good! :)17:02
tomwardillTotal: 217 tests, 0 failures, 0 errors, 0 skipped in 2 minutes 55.683 seconds.17:14
tomwardillwell, that'll do. Cleaning up the mess I've made along the way is a job for FutureTom17:14
* tomwardill -> EOD :)17:14
cjwatsonhttps://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/382606 (Add UI for editing Distribution.oci_project_admin)19:52
* pappacena I'll check19:59
cjwatsonI've done a bunch of QA and intend to do a rollout tonight; we need to get it out this week, but rollouts for the next few days will have to be extra-careful to avoid disrupting the Ubuntu release, so it has to be now20:02
cjwatson(Not ideal timing, but there you go)20:03
cjwatsonShout if you know of anything wrong20:03
pappacenaOk... let me know if something doesn't work properly...20:03
cjwatsonActually ... bother, I just realised that the comment about bug contacts in https://bugs.launchpad.net/launchpad/+bug/117752 still stands20:07
mupBug #117752: Any logged in user can delete any attachments <lp-bugs> <Launchpad itself:In Progress by pappacena> <https://launchpad.net/bugs/117752>20:07
cjwatsonWhich we discussed briefly in the MP, but I'd missed that comment about retracers deleting attachments20:08
pappacenaretracers?20:08
cjwatsonUbuntu has an automatic crash reporting system which in some cases creates bugs with core dumps attached, but those have to be private since they often contain lots of confidential information; there's a service that goes through core dumps attached to bugs in this way and extracts tracebacks from them, then deletes the core dumps, which makes it less of a privacy minefield20:10
cjwatsonBut the "deletes the core dumps" bit is kind of crucial20:10
cjwatsonSorry, I should have thought of that wrinkle earlier20:11
pappacenaAhh... what permission should we use to allow them to delete too?20:11
cjwatsonbug_supervisor, but it involves looking at bug tasks20:11
cjwatsonBecause that's on the pillar20:11
cjwatsonBut then we have to take more care about performance because bugs might have lots of bug tasks20:12
cjwatsonEditBug._hasAnyRole is similar and would probably do20:13
cjwatsonLet me think for a bit about whether we can get away with taking that slow approach20:13
pappacenaOk...20:14
cjwatsonpappacena: I think we can.  Mind if I take this?  We're in a bit of a rush and I think I can do it faster than I can explain it :)20:16
pappacenaSure, no problem! :-)20:17
cjwatsonpappacena: https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/38260820:35
* pappacena checking20:39
cjwatsonThanks, landing20:49
cjwatsonpappacena: Before I forget - nice work on the lp-signing integration so far.  Once I fixed all the things that were essentially my fault (charm bugs, incorrect firewall rule, missing escaping in openssl's command line), it all seems to work just fine.20:54
cjwatsonThough I don't think we should actually attempt to enable it until after the Ubuntu release, even if we have a production environment by then :-)20:55
pappacenaThanks, cjwatson! And actually, thanks for all the reviews and the work on the infrastructure... my part was actually quite small compared to this.21:06
pappacenaAnd I agree to play it safe and wait for Ubuntu release before we enable this in production.21:06

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