-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(db): use Flyway migration to set up discovery plugins #614
chore(db): use Flyway migration to set up discovery plugins #614
Conversation
/build_test |
Workflow started at 8/21/2024, 4:14:10 PM. View Actions Run. |
No OpenAPI schema changes detected. |
No GraphQL schema changes detected. |
CI build and push: All tests pass ✅ |
/build_test |
Workflow started at 8/21/2024, 4:40:11 PM. View Actions Run. |
No OpenAPI schema changes detected. |
No GraphQL schema changes detected. |
CI build and push: All tests pass ✅ |
0b3d38c
to
e2c6ca0
Compare
/build_test |
Workflow started at 8/22/2024, 4:14:01 PM. View Actions Run. |
No GraphQL schema changes detected. |
No OpenAPI schema changes detected. |
CI build and push: All tests pass ✅ |
e2c6ca0
to
43ad1fa
Compare
/build_test |
Workflow started at 8/26/2024, 12:50:21 PM. View Actions Run. |
No GraphQL schema changes detected. |
No OpenAPI schema changes detected. |
CI build and push: All tests pass ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
To recreate commits with GPG signature
git fetch upstream && git rebase --force --gpg-sign upstream/main
See #590
Fixes #549
Description of the change:
Removes the Quarkus-level startup check and lazy initialization of builtin discovery plugins, replacing these with eager initialization within the database migration scripts handled by Flyway.
Motivation for the change:
This ensures that discovery nodes and plugins creation is correctly tied to the database schema, and that the expected nodes and plugins are seeded in the database prior to application startup. This allows for cleaner application restart on an existing database instance, since the node creation/removal logic is no longer tied to the application lifecycle - no need for a startup check for node records existing, and if not to lazily initialize them.
This also opens up a nice unit testing possibility, where unit tests can
@Inject Flyway flyway
and then@AfterEach void cleanup() { flyway.clean(); }
, which has the effect of resetting the database after each test. Without this change, this hook won't work as expected because the discovery nodes/plugins will be wiped from the database too, leaving the application in a bad state for the next tests.Testing
quarkus dev
, then in another terminalhttp :8080/api/v3/discovery
andhttp :8080/api/v3/discovery_plugins
./mvnw clean package ; podman image prune -f
./smoketest.bash -Okt
http
commands above