Wednesday, 2017-02-01

*** diablo_rojo has joined #storyboard00:50
*** diablo_rojo has quit IRC01:14
*** diablo_rojo_phon has quit IRC02:20
*** zara_the_lemur__ has quit IRC03:45
*** yarkot has quit IRC06:06
*** yarkot has joined #storyboard06:31
*** Bluebell- has joined #storyboard07:07
*** Bluebell- has left #storyboard07:17
openstackgerritAndreas Jaeger proposed openstack-infra/storyboard: Prepare for using standard python tests  https://review.openstack.org/42758908:58
persiaFor launchpad questions, there is also #launchpad.  Best earlier in the day (AU/UK timezones)09:16
*** fay has joined #storyboard10:30
*** fay is now known as Guest4793310:31
*** faybrocklebank has quit IRC10:32
*** odyssey4me has left #storyboard11:18
Zaraback to these enums...11:32
Zaraso far the only difference I've found between that code and the 012 one is that the 012 one returns more than one key-value pair in the object11:37
Zarathat seems like a bizarre reason for things to break, though11:37
Zaraso https://github.com/openstack-infra/storyboard/blob/master/storyboard/db/migration/alembic_migrations/versions/012_task_states.py is fine11:46
Zarahttps://github.com/openstack-infra/storyboard/blob/master/storyboard/db/migration/alembic_migrations/versions/018_task_priority.py fails11:46
Zarawith sqlalchemy.exc.ProgrammingError: (ProgrammingError) type "task_priority" does not exist11:46
ZaraLINE 1: ALTER TABLE tasks ADD COLUMN task_priority task_priority11:46
Zara                                                   ^11:46
Zara 'ALTER TABLE tasks ADD COLUMN task_priority task_priority' {}11:46
SotKwhy is it trying to add a column named task_priority?11:48
Zaraoh I might've changed that while hacking around, should be priority task_priority11:49
Zarasame error though11:49
Zarasqlalchemy.exc.ProgrammingError: (ProgrammingError) type "task_priority" does not exist11:49
ZaraLINE 1: ALTER TABLE tasks ADD COLUMN priority task_priority11:49
Zara                                              ^11:49
Zara 'ALTER TABLE tasks ADD COLUMN priority task_priority' {}11:49
Zarathere11:49
Zarathat's what I get with the actual code, sorry11:49
ZaraI even started changing indentation to see if that helped; nothing11:56
Zaraif I can't get this to work, are there other options?12:57
SotKmaybe13:15
SotKyou can create an empty database, and then make alembic generate one giant migration to set it up according to the current schema13:15
* SotK will find docs13:15
SotKI suspect that just https://github.com/openstack-infra/storyboard/blob/master/storyboard/db/migration/README#L60-L61 will be enough, if you move `storyboard/db/migration/alembic_migrations/*` out of the way13:18
Zaraah, right, I could try that13:20
* Zara will spend a bit longer on this since she figures problems here will indicate issues elsewhere13:21
ZaraI am veering toward 'this is the only place where a new column is created using enums and is not created as part of a new table' (012 uses task statuses which have already been created, even if it then drops them)13:27
SotKmaybe alembic/sqlalchemy doesn't know it needs to create an enum if it is only adding a column or something when using postgresql13:30
Zarayep, I think so13:30
* Zara peers at https://bitbucket.org/zzzeek/alembic/issues/89/opadd_column-and-opdrop_column-should13:37
ZaraI wonder why postgresql uses 'typname' and 'rolname' instead of 'typename' and 'rolename'. guessing a character-limit somewhere?13:41
* SotK has no idea13:52
openstackgerritAndreas Jaeger proposed openstack-infra/storyboard: Prepare for using standard python tests  https://review.openstack.org/42758914:45
*** Guest47933 has quit IRC15:14
ZaraI tried the workaround suggested but I get a syntax error if I include a name for the enum, and a 'no name' error if I don't15:42
* Zara is not confident she knows what's going on in the workaround15:43
*** fay has joined #storyboard15:44
*** fay is now known as Guest2220315:44
SotKdoes the workaround further down the page do the same thing?15:46
ZaraI couldn't get it working but I'm going to come back to it15:49
Zaracurrently trying the 'create a migration from current setup approach)15:49
Zaraokay, that has made a thing at least15:54
Zara(I had some fun because I accidentally deleted the env.py the first time)15:55
Zaramade a migration script, tried to run the upgrade command, first got error because 'storyboard' was not found, imported storyboard, now getting another error... (will paste various things)15:59
Zaramy migration script: http://paste.openstack.org/show/597218/16:03
Zara(might be a bit weird; pasting from vm was not fun)16:03
Zaraand current error: http://paste.openstack.org/show/597219/16:04
Zaraso it's just for comment fields that I think are populated in a mysql-specific way16:10
Zarafor comment content and comment content history16:11
* Zara wonders what will happen if she just changes it to UnicodeText16:12
Zarasqlalchemy.exc.CompileError: Postgresql ENUM type requires a name.16:15
Zarawhen running line 124 of my migration script, going from the trace16:16
Zarawhich is weird since it looks a lot like other lines before it16:17
SotKbut the sa.Enum on line 122 doesn't have a name16:18
Zaraahh, right16:19
Zarait's the first enum from the looks of it16:19
Zaraand none of them have names16:20
Zara(recorded there, anyway16:20
SotK\o/16:20
SotKmanual editing time!16:20
Zara:D I think you mean *more* manual editing time! :D16:20
Zarathis script will be the snowflakeiest snowflake ever to have snowflaked16:20
Zaralooks like there are 7 of them16:21
ZaraI bet I get the same syntax error as before when I name them16:21
Zarahm, now I'm wondering what the name should be (column name or table name (or am I totally confused))16:22
SotK$tablename_$columnname probably makes sense16:22
Zarafair enough16:23
*** diablo_rojo_phon has joined #storyboard16:24
ZaraSotK: huh it actually worked16:25
Zaratime to see what's going on inside16:27
SotK\o/16:27
Zarahttp://paste.openstack.org/show/597225/16:28
Zaraor better http://paste.openstack.org/show/597226/16:28
Zaraprojects and project groups seem to be okay (none in the db yet though)16:29
* Zara goes to make herself an admin and realises she doesn't know how in postgres xD16:30
Zarawell I finally worked out how to connect to the right db16:45
Zarabut after logging in...16:45
Zara(well, connecting to the right db...)16:45
Zarastoryboard=# \du16:45
Zara                              List of roles16:45
Zara Role name  |                   Attributes                   | Member of16:45
Zara------------+------------------------------------------------+-----------16:45
Zara postgres   | Superuser, Create role, Create DB, Replication | {}16:45
Zara root       |                                                | {}16:45
Zara storyboard | Superuser                                      | {root}16:46
Zarawhere is Zara16:46
Zarawhere has she gone16:46
Zarait is showing the right tables16:52
Zaraoh okay guessing that's db  users and I need things in the users table of the db16:54
*** diablo_rojo has joined #storyboard16:59
Zarasuccessfully managed it, anyway :)17:00
SotK\o/17:01
Zaraonce I create a project, I get a nice error message17:01
SotKwhat is it?17:02
Zarasame one as before, I think17:02
Zarahttp://paste.openstack.org/show/597239/17:02
Zaraand I think same again once I add that project to a project group17:03
SotKhm17:04
Zaraif I try to create a story17:04
Zara400: POST /api/v1/stories: Foreign key error. Error in object 'Story'. Field 'story_type_id' value 'stories_story_type_id_fkey' is invalid.17:04
* SotK makes sad faces in the direction of sqlalchemy17:05
Zaraa glance suggests we don't have any Foreign Keys for story types...17:08
Zaraat least, this is what we have in models.py http://paste.openstack.org/show/597244/17:08
Zaraoh, but the teams stuff17:10
Zaraand stories themselves17:10
Zarahttp://paste.openstack.org/show/597246/17:13
Zaraso I guess one thing it doesn't like is             [(func.sum(Task.status.in_(17:23
Zara                ['todo', 'inprogress', 'review'])) > 0,17:23
Zara              'active'),17:23
Zara(from the bigger error message17:23
Zara             ((func.sum(Task.status == 'merged')) > 0, 'merged')],17:23
Zaraand that 400 might be a different thing17:23
Zarahttp://paste.openstack.org/show/597250/ is the code17:23
Zarafor the stuff like DBError: (ProgrammingError) function sum(boolean) does not exist17:24
ZaraLINE 2: ...AS is_bug, stories.private AS private, CASE WHEN (sum(tasks....17:24
Zara                                                             ^17:24
ZaraHINT:  No function matches the given name and argument types. You might need to add explicit type casts.17:24
SotKmaybe sqlalchemy doesn't know how to make postgresql understand that for some reason17:29
* SotK thought this is what sqlalchemy is *for* tbh17:29
ZaraI'm wondering if my manual-naming of enums could possibly cause this, but seems unrelated17:30
Zarait does not help that I have roughly the understanding of an actual lemur17:34
ZaraI definitely need to do more work around talking to databases, so this is good for me17:36
ZaraI'll just tell myself that17:36
* Zara hasn't found any docs suggesting others have had this trouble, yet17:40
Zaraso it might also be reporting the issue in the wrong place17:40
* Zara finds http://stackoverflow.com/questions/24134266/error-function-sumcharacter-varying-does-not-exist-using-sum-with-sql-alchem17:41
Zaraso... something isn't treated as an int. when it should be. maybe.17:42
* SotK shrugs17:45
* Zara finds https://bugzilla.mozilla.org/show_bug.cgi?id=28412517:45
openstackMozilla bug 284125 in Query/Bug List "PostgreSQL cannot call SUM on a boolean (Boolean Charts)" [Normal,Resolved: fixed] - Assigned to Tomas.Kopal17:45
Zarahuh, never knew about that bot17:46
Zarahello bot17:46
Zaraanyway, my brain is fried; will look more tomorrow18:10
Zarathough reminder: storyboard meeting in 50 minutes!18:10
*** diablo_rojo has quit IRC18:21
*** diablo_rojo has joined #storyboard18:24
*** zara_the_lemur__ has joined #storyboard18:36
zara_the_lemur__meeting in 1 min!18:59
openstackgerritMerged openstack-infra/storyboard: Remove contentless operator manual  https://review.openstack.org/41812219:38
zara_the_lemur__thanks, SotK!19:42
*** diablo_rojo has quit IRC19:54
*** Guest22203 has quit IRC20:01
*** diablo_rojo_phon has quit IRC20:20
*** diablo_rojo has joined #storyboard20:55
*** diablo_rojo has quit IRC21:11
*** diablo_rojo_phon has joined #storyboard22:01

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