fmeringdal / nettu-scheduler

A self-hosted calendar and scheduler server.
MIT License
535 stars 27 forks source link

Project Status #38

Open theAkito opened 1 year ago

theAkito commented 1 year ago

Is this project still alive?

Are contributions still welcome i.e. would they be possibly merged?

fmeringdal commented 1 year ago

I don't actively add code to this repo anymore as you might have guessed from the commit history. What did you have in mind to contribute?

theAkito commented 1 year ago

Since issues like #16, #23, #37 pretty much break the entire Docker setup, this project is currently unusable in a Docker only setup. Trying to get it to run since a while, but these one in a kind compile time SQL checks really make the deployment very hard.

Compile time checked sql queries are extremely useful for catching very common bugs, so that will not be disabled.

Source

I see the point of this, but if one is doing crazy safety/integrity stuff like this, one ought to also put in the effort to make it actually work. One safe broken program is more useless than a running one without the safety. & not being able to run this on Docker basically means you are excluding it from any meaningful use, besides a one-man local server for testing or something. (There also could've just been a switch to disable it temporarily, until the feature is fixed.) The (new) migration is also not included in the Alpine image, which should actually be the default. The libc dependent images are actually secondary, when using Docker.

Soo, my status quo is now, that I finally fixed the issue of not being able to connect to PostgreSQL during build. At first, I did not understand the error, because I couldn't believe, that the app is connecting to a database during build. Only the aforementioned Github issues had the power to enlighten my poor mind. Experiences like this are usually a sign of bad and/or inaccessible documentation. At second, the actual SQL query tests aren't running, because I'm now not sure, whether the database needs the new migration or something. Not sure, how to populate the database, just to make the tests work. Do I really need to manually populate the database somehow or do I need to run the migration locally as mentioned in one of the issues or what should be done here? Again, a big documentation issue.

If I'm going to make this run, I'd be willing to present it as a contribution to this project. 🙂

fmeringdal commented 1 year ago

Compile time checked sql queries are extremely useful for catching very common bugs, so that will not be disabled.

I have somewhat changed my mind on this since then. A proper test suite for the DB queries are much more useful than just syntax checking the queries.

Any contribution would certainly be welcome to improve the status quo of the repo!

theAkito commented 1 year ago

I have somewhat changed my mind on this since then. A proper test suite for the DB queries are much more useful than just syntax checking the queries.

Ah, I see. Good to know. Does that still imply a working PostgreSQL connection during build time, which includes supposedly(?) tests?

Any contribution would certainly be welcome to improve the status quo of the repo!

Nice. So, could you please tell me whether I need to populate the database, to make the build work or what else I would need to do, to make the SQL related checks pass? 🙂

fmeringdal commented 1 year ago

Ah, I see. Good to know. Does that still imply a working PostgreSQL connection during build time, which includes supposedly(?) tests?

I don't think it needs to connect to psql at all during compilation. A separate test phase should check for DB failures or sql syntax issues and so on.

Nice. So, could you please tell me whether I need to populate the database, to make the build work or what else I would need to do, to make the SQL related checks pass? 🙂

Are you asking for what is required to build the current repo? Then I believe the issue you linked to describes a way to do it by running the migration with sqlx cli before starting the app. To be fair, I haven't started this app in at least a year, so not completely sure. Feel free to experiment and implement a better approach here!

theAkito commented 1 year ago

I don't think it needs to connect to psql at all during compilation.

I could never get it to finish compiling, because connection to the PostgreSQL database timed out during compilation. 😀

Then, I provided the connection and the SQL tests started failing...

Then I believe the issue you linked to describes a way to do it by running the migration with sqlx cli before starting the app.

The way I understood this, the database had be working & then you apply the migration utility to "upgrade" the existing, working database, so it keeps working. Since I am attempting to run the whole thing for the first time, I do not have any data in the database. It's empty. So, technically, nothing to "migrate" there.

Feel free to experiment and implement a better approach here!

Thanks. I'll contribute my improvements, once I have it all running. Although, we need to figure out the database stuff, first. 😁