Closed fmalina closed 2 years ago
@ncrocfer are you able to merge this?
Hi @fmalina,
First of all thank you for this PR and sorry for the delay to review and merge this PR.
Unfortunately we can not approve it for the following reasons:
- even if you change
settings.py
to handle aDIRECTOR_DATABASE_TABLE_PREFIX
variable you don't use it in the rest of the code. Instead you use an environment variable (os.getenv("DIRECTOR_DATABASE_TABLE_PREFIX", "")
) to prefix the tables. You have to useapp.config["DATABASE_TABLE_PREFIX"]
, as the rest of the code does for each configuration property.So the feature is not working as expected:
$ cat .env ... DIRECTOR_DATABASE_URI="postgresql://localhost:5432/director_pr_119" DIRECTOR_DATABASE_TABLE_PREFIX="foobar" ... $ director db upgrade $ psql -h localhost -d director_pr_119 director_pr_119=# \dt List of relations Schema | Name | Type | Owner --------+-----------------+-------+---------- public | alembic_version | table | ncrocfer public | tasks | table | ncrocfer public | users | table | ncrocfer public | workflows | table | ncrocfer
- The
DIRECTOR_DATABASE_TABLE_PREFIX
is not added in the default configuration file (insidecommands/init.py
file)- The
tasks
,users
andworkflows
tables will be changed, but what about thealembic_version
table?- You have too many commits for 2 features, the best is to provide 2 commits using the conventional commit format (https://www.conventionalcommits.org/en/v1.0.0-beta.4/)
- If you can add some tests it will be a great improvement of this PR
When you will be able to fix all these comments we'll be able to review & merge your PR. Thanks again for your contribution.
@fmalina You are welcome to make these changes, but aware you are probably busy with other things mate.
@ncrocfer If not i'll have a look and see If I can pick this up as its something we need internally.
@CodePint I'd welcome you to pick this up yourself, I am fully aware of all these shortcomings myself and undone my changes to fully implement this as I struggled with getting to the app.config in places so stuck to env var
@CodePint I'd welcome you to pick this up yourself, I am fully aware of all these shortcomings myself and undone my changes to fully implement this as I struggled with getting to the app.config in places so stuck to env var
Heya @fmalina thanks for getting back to me, much appreciated Yeah I do remember you mentioning there were some outstanding issues here, I will pick this up and try to finish it off. :)
@fmalina @CodePint I clean the backlog and close this PR, of course you will be able to open another one when you'll be ready.
Signed-off-by: Frantisek Malina fmalina@pm.me