Tuesday, 2017-02-07

*** pleia2_ is now known as pleia201:04
*** zara_the_lemur__ has quit IRC03:45
*** diablo_rojo has quit IRC04:01
*** AJaeger has left #storyboard07:34
*** bethwhite has joined #storyboard10:43
Zarashort of other ideas, I tried making a fresh db for mysql with the same migration script I'm using for postgres. I don't get the 500 error, so I'm fairly sure it's not getting a 500 from struggling to parse anything in the database.12:12
SotKis the 500 just from stories or does it happen with tasks too?12:28
Zarait's actually the tasks (but it shows up when posting a story since it automatically creates tasks)12:28
Zarathe stories do post12:28
SotKoh yeah, your paste says that, sorry :)12:29
SotKcan you GET a story that you've created?12:31
Zarawell I've left walls of text in here, so easy to miss a detail like that12:31
Zaraistr I could but I'll check12:31
Zaraah, okay, so I can get the list of stories, but not any specific story12:33
ZaraI get the same error when I try to browse to a specific story12:33
Zaraand get sent back to the dashboard12:33
SotKI thought you might12:33
SotKif you comment out the if statement in storyboard/db/api/stories.py at line 50 to 52, does it work?12:34
SotKin fact, not there12:35
SotKlines 63 and 64 are the relevant bit12:35
Zaraconfirmed that line 50-52 doesn't do it :P12:35
Zaraooh, now I get a different error12:36
* Zara goes to paste12:37
Zarahttp://paste.openstack.org/show/597940/12:38
openstackgerritMerged openstack-infra/storyboard master: Prepare for using standard python tests  https://review.openstack.org/42758912:40
SotK\o/12:41
* SotK thinks that http://stackoverflow.com/a/25193282 could be related to the first problem12:42
SotKwe do a union when checking the story permissions12:42
SotKhttps://github.com/openstack-infra/storyboard/blob/master/storyboard/db/api/base.py#L43712:42
Zaraahh, okay. I thought something needed casting but had no idea what or where12:42
Zaraor if it only thought something needed casting because it was misinterpreting a different instruction12:43
SotKthat stackoverflow problem looks similar, but I'm not sure how we'd implement the casting it seems to expect12:43
Zarapostgres fork where we comment out everything and there are no permissions =D12:44
Zarathe second one is weird12:45
ZaraDBError: (ProgrammingError) operator does not exist: subscriptions_target_type ~~ unknown12:45
ZaraLINE 8: ...iptions.user_id = 1 AND subscriptions.target_type LIKE '%wor...12:45
Zara                                                             ^12:45
ZaraHINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.12:45
Zarasince 'like' is a thing12:45
ZaraI'm guessing it's the enums that are confusing it12:45
Zarasa.Column('target_type', sa.Enum('task', 'story', 'project', 'project_group', 'worklist', name='subscriptions_target_type'), nullable=True),12:46
SotKseems like a sensible guess12:48
Zaraand so then this isn't working right: http://paste.openstack.org/show/597944/12:48
Zara(I think that's the relevant code anyway)12:48
Zarasupported types are a dict12:49
ZaraSUPPORTED_TYPES = {12:49
Zara    'project': models.Project,12:49
Zara    'project_group': models.ProjectGroup,12:49
Zara    'story': models.Story,12:49
Zara    'task': models.Task,12:49
Zara    'worklist': models.Worklist12:49
Zara}12:49
Zaramaybe it just hates all dicts12:49
ZaraI'm happy, anyway, there's something to work with now12:52
Zarathank you :)12:52
SotKlooking at the endpoint it shouldn't use the dict there though, since I assume that part of the query is caused by https://github.com/openstack-infra/storyboard/blob/master/storyboard/db/api/worklists.py#L10612:55
SotKI think the "LIKE" must be coming from https://github.com/openstack-infra/storyboard/blob/master/storyboard/db/api/base.py#L7712:57
Zaraoh, I wonder if it wants a 'WHERE' first12:59
ZaraLINE 8: ...iptions.user_id = 1 AND subscriptions.target_type LIKE '%wor...12:59
Zaraso AND WHERE12:59
ZaraI think it might be treating 'subscriptions.target_type' as the operator12:59
SotKthe WHERE is earlier in the query12:59
Zarahm, I wonder if it's still counting it.13:00
ZaraDBError: (ProgrammingError) operator does not exist: subscriptions_target_type ~~ unknown13:00
SotKthe ~~ operator there is LIKE aiui, and it is saying it doesn't have a LIKE operator for the two types13:01
SotKmaybe only the unknown thing on the rhs needs to have an explicit cast13:02
Zaraoh, right, I hadn't seen the tilde notation for that before13:02
Zara\nWHERE subscriptions.user_id = %(user_id_1)s AND subscriptions.target_type LIKE %(target_type_1)s)13:03
Zarais a bit more context for that bit13:03
Zarahuh, this also seems to start stories at id 1014:24
Zara(instead of 1 or 01)14:24
Zarajust noting it in case it hints at anything else14:25
*** diablo_rojo has joined #storyboard16:10
*** openstackgerrit has quit IRC16:35
*** diablo_rojo has quit IRC16:38
* Zara wonders why theres cast_value in user preferences17:08
Zara*there's17:08
Zaraor rather, trying to work out exactly how it works17:11
*** Guest34099 has quit IRC17:32
ZaraI think I did it18:07
* Zara dies18:07
Zaranot working out how that bit works, I gave up on that, but how to do a cast for this code in a way that postgres understands in sqlalchemy18:07
Zarawill send a wip patch shortly18:10
*** diablo_rojo has joined #storyboard18:15
Zarahm I don't think my workaround is quite right. it lets me create a story but then I can't view it, though I can view others that I couldn't view before. maybe I've got the wrong type.18:17
Zara(I'm getting 500: GET /api/v1/worklists: 'FullText' object has no attribute '_has_bind_expression'  after casting to FullText)18:18
Zarabut it's getting further now, and does POST the task, it just then can't GET the task (so I can GET only the stories with no tasks)18:24
Zara(this is with the 'comment out permissions query' workaround)18:25
SotKoh dear18:26
SotKdoes our fulltext thing have mysql specific stuff in?18:27
*** openstackgerrit has joined #storyboard18:29
openstackgerritZara proposed openstack-infra/storyboard master: Hacky WIP to provide postgresl support for StoryBoard  https://review.openstack.org/43039518:29
Zarathis is imported from sqlalchemy so shouldn't, but we do have a mysql specific text type somewhere as well18:30
Zarathere's the patch, anyway.18:30
Zarawith a long commit message...18:30
ZaraI've kept it as one commit so it's easier to see everything in one place while it's all so hacky.18:30
Zara(once it's all split out nicely, sotk should be coauthor for the models.py change, haha )18:34
* Zara disappears for a bit18:34
ZaraI'm not sure if it should be FullText, that was just the one that worked the most of the things I tried18:57
Zaraso maybe I'm just casting to the wrong type18:58
Zara(I also tried String and UnicodeText since they seemed text-y)18:58
Zarathose didn't work.18:59
Zaramaybe this is a thing that should be used: https://www.postgresql.org/docs/8.3/static/datatype-textsearch.html19:01
*** zara_the_lemur__ has joined #storyboard19:16
diablo_rojoSotK, where is that migration repo? I was going to try to make headway on the mapping branches to tags today19:42
SotKdiablo_rojo: http://git.openstack.org/cgit/openstack-infra/storyboard/tree/storyboard/migrate19:43
SotKI sent a patch which just adds every task to the master branch, https://review.openstack.org/#/c/423877/19:44
SotKthat isn't good enough though, since some tasks are in other branches too on LP aiui19:44
SotKin that case we need to add a task to each branch in SB too, creating the branches if need be19:45
diablo_rojoOkay so my patch will be dependent on that one then?19:46
SotKdependent on it, or you can just take over it if you like19:47
diablo_rojoIf your patch works and all that I can just modify it :)19:49

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