Roundup Tracker - Issues

Message7907

Author ivanov
Recipients ivanov, rouilj
Date 2023-12-20.04:44:52
Message-id <99ecbcba791279a9ae9a3438a3417e90@riseup.net>
In-reply-to <20231219222511.3615B6A01F3@pe15.cs.umb.edu>
> You don't need to migrate if you haven't run initialization. 

I just tried a few options to make sure none of them worked :3

> I understand your use case better now. You are not running initialize
> multiple times on a tracker. You have an existing db (that is empty,
> no tables or anything else).

Exactly. Usually web applications requires pre-installed database, so I
have Ansible role that creates databases for virtual hosts, configures
webserver containers, etc. Also I use Buildbot to deploy applications
from Git and perform migrations.

I was a little confused when I saw that the database was supposed to be
created by Roundup :3

> What happens if you do this:
> 
>   start with an installed and configured (in config.ini) tracker and
>   an empty database (as above).
> 
>   run 'roundup-admin -i tracker-home list user' 
> 
> I think this should create all the tables but not create any rows in
> the tables.

Yes, it creates tables as expected. But what's the difference with
performing a migration?

> I'm not sure if you can use roundup-admin to create the admin and
> anonymous users manually (because the admin user in the db isn't
> defined). However you can use psql to set the admin id=1,
> username=admin and roles=Admin. Then once that is present for the
> admin user, you can set the admin password using roundup-admin, create
> the anonymous user etc.

Hmm... If I run this command after the migration is done:

  roundup-admin create user username="admin" roles="Admin"

it creates 'admin' user with id 1.

> I would have to check but I think a change to create an:
> 
>   init --nocreatedb
> 
> that just loads initial_data.py would be relatively
> easy. Alternatively we can add a 'pragma nocreatedb=true'. (We can
> create a new ticket for this).

Both look interesting. As I understand it, pragmas are permanent
settings for Roundup admin commands. Is it correct? On the one hand, it
is better to be able to permanently disable database creation. On the
other hand, the ability to temporarily disable this feature may also be
important, and in my case I could just as easily use a flag.

I think it would also be useful to have an option to read admin's
password from a file. This will avoid calling the shell to execute the
command using CI. But I don't want to ask for too much.

> The user and other data is installed by running initial_data.py during
> init. Trackers can be written to use specific items in the db. For
> example the classic template statusauditor.py needs the chatting status.
> Without it it won't operate correctly. So correctly creating these
> entries could be tricky.

Indeed. I didn't think about that. In this case, the only option is to
add a flag or pragma.

I think we could close this issue since Roundup can now work with
postgresql services and also supports the non-public schemas. There is
still an issue with getting database/schema names when there is no
successful connection. But it seems that we can't solve this now. 

Since the database creation bypass is not specific to postgresql, I
think it would be better to create a new issue.

Thank you very much.
History
Date User Action Args
2023-12-20 04:44:52ivanovsetrecipients: + ivanov, rouilj
2023-12-20 04:44:52ivanovlinkissue2551299 messages
2023-12-20 04:44:52ivanovcreate