qwat / qwat-data-model

TEKSI Water module (project QWAT) - PostgreSQL / postgis Datamodel
https://www.teksi.ch
23 stars 24 forks source link

Pum integration2 #205

Closed sylvainbeo closed 6 years ago

sylvainbeo commented 6 years ago

@m-kuhn @haubourg Hi, have a look to this PR. I've added pre and post-all delta file + a pre for 1.2.8.

Please comment.

3nids commented 6 years ago

is that a green light ???? haven't seen one for quite a while around here... good job to all of you!!!

m-kuhn commented 6 years ago

Great stuff, that's good to see.

@marioba any feedback from your side concerning the use of os.system? Alternatively there would be the subprocess module which could also intercept stdout and stderr, should that be sent back to Pum, and of course psycopg. Not sure how you envisioned this.

marioba commented 6 years ago

👍for the green light...

In the DeltaPy abstract class, there is the write_message method designed to write the subclass outputs. Currently, the method doesn't make much more than a simple print() but I think it would be good to have a centralized output so, if we want to manage it differently in the future, it's easy to modify it. And maybe it would be also a good idea to define some exception types that the subclasses can raise in the run method...

m-kuhn commented 6 years ago

Thinking about this again, it might be nice to send all sql through psycopg2. At least from a transaction perspective it would be nice to send everything through the same interface and have total control to commit or rollback.

sylvainbeo commented 6 years ago

Ok all, we wait for @haubourg to have a look, and we merge.

ponceta commented 6 years ago

Thanks for the good work, this will be great to have this!

There's a small error here :

https://travis-ci.org/qwat/qwat-data-model/builds/293131379#L2870

Probably linked to SRID not beeing initialized somehow?

Il like the green tick but having errors and still been green can be a false positive for me.

The auth token is not working too?

https://travis-ci.org/qwat/qwat-data-model/builds/293131268#L5398

sylvainbeo commented 6 years ago

@ponceta Ah oups. did not see this one, because travis was collapsing the lines. Yes indeed, it is because of the missing SRID. I have a look.

m-kuhn commented 6 years ago

Can someone check if the GH_TOKEN has the public_repo permission set?

m-kuhn commented 6 years ago

@sylvainbeo I guess you need to check the return value of the psql call.

sylvainbeo commented 6 years ago

@m-kuhn The problem is on the post-all process. No sql is launched directly, just .sh I have a look.

sylvainbeo commented 6 years ago

SRID problem seems to be solved.

Now i see another one 'schema "qwat_od" does not exist'

sylvainbeo commented 6 years ago

Traceback (most recent call last): File "./.deploy/create_release.py", line 154, in main() File "./.deploy/create_release.py", line 144, in main url='{release_url}?name={filename}'.format(release_url=release['upload_url'][:-13], filename=filename) KeyError: 'upload_url'

m-kuhn commented 6 years ago

@sylvainbeo , that normally happens when there's something broken with the api token

Can someone check if the GH_TOKEN has the public_repo permission set?

m-kuhn commented 6 years ago

That should give better output: https://github.com/qwat/qwat-data-model/pull/206

sylvainbeo commented 6 years ago

I'm not a GH_TOKEN expert. here is the configuration for the tken (qwat_admin user)

image

m-kuhn commented 6 years ago

Looks good I think

m-kuhn commented 6 years ago

Ah wait... Actually deploy should only happen on tags... We didn't have a tag here, right?

sylvainbeo commented 6 years ago

@m-kuhn Indeed no tag.

sylvainbeo commented 6 years ago

Anyone has an idea on " schema "qwat_od" does not exist"..very weird.

sylvainbeo commented 6 years ago

mmmm... i have one. Maybe the .sh scripts are not launched on the right DATABASE.

sylvainbeo commented 6 years ago

Fixed !

sylvainbeo commented 6 years ago

Question: in the post-all.py file, i specify qwat_test as the output DB... maybe this should be a param.

haubourg commented 6 years ago

Merging that at last!

m-kuhn commented 6 years ago

:tada: