-
Notifications
You must be signed in to change notification settings - Fork 8
Alert handing changes: #168
Alert handing changes: #168
Conversation
42370b3
to
25a93d4
Compare
@oguzcankirmemis I streamlined the createDB script to make it succeding (I need it for the Helm Hook PR in Platformlauncher). But I think there is some rework needed, especially on the testdb usage and creation. |
@oguzcankirmemis dont merge it -- I found an issue with it. |
25a93d4
to
f371440
Compare
@wagmarcel there is a small thing I noticed in the createDB script: If I am not mistaken, with superuser account the initial database is created and then the superuser that is already there is created again. Is this intended? Here is the line where it is happening. I could also see that the script trying to grant permission to normal user before it is ever created. Normally what should happen is:
|
@wagmarcel Sequelize cannot take model definitions from postgres or migration files and migration files can't take vice versa (here is the issue). The best solution that comes to my mind:
If frontend version is newer or older than migration, then it should fail and crash. So we only have to make sure that each frontend version is consistent in terms of its model definitions and migration files. |
We should actually also remove admin/createDB entirely, and use updateDB for database creation and updates, because it does not make any sense if we have the initial migration file. The resetDB should delete the whole database and use updateDB afterwards to create and bring the database up to date. |
f371440
to
8b467c7
Compare
@oguzcankirmemis: not sure about skipping createDB. Then we need to differentiate whether updateDB is creating from scratch or only apply migration scripts. The way it is done in this PR (actually with the related PR in platform-launcher) is that helm install is applying createDB and updateDB and help upgrade is only applying the migration scripts. |
@wagmarcel Seems reasonable, but then createDB still should not depend on models and only apply the initial migration. Otherwise we would have problems. |
46a1b2f
to
ea90d5f
Compare
@oguzcankirmemis: The PR is now ready for review. Besides the Alert changes, the db migrations works now as follows: createDB is using the "base" Alerts model (migrations/models). The updates are in migrations/migrations. With that, the install can be done by using createDB && updateDB. The upgrade can be done by only using updateDB. |
* Alerts are ignored if the related rule is not active * Alerts of resetType "Manual" trigger only actions if there is no existing unsuppressed alert with state "New" * If Alerts are not triggering but valid, they are stored in DB as suppressed events * GUI is only showing active, i.e. non-suppressed event * URI parameter "active=true" can be used to get only non-suppressed event. Default behavior is to provide all events. * First draft of DB migrations for Alerts: - Introduced new DB upgrade logic with sequelize migrations - Updated createDB script to terminate correctly - Added updateDB script which can be used by Helm to upgrade DB - Added revertDB script to revert most recent migration - Added revertAllDB script to revert all migrations - Now the base model for Alerts is stored in migrations/models to make sure that createDB is using the base model. This allows seamless upgrades with the migrations scripts. Signed-off-by: Marcel Wagner <wagmarcel@web.de>
ea90d5f
to
2ff3d8f
Compare
Signed-off-by: Marcel Wagner wagmarcel@web.de