-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Ensure database initialization in test container #17697
Ensure database initialization in test container #17697
Conversation
looks like this PR helps correctly dump the schema! I got Before merging this PR, we should rebuild and push some changes (some formatting/removing unused imports) as well as running the schema dump, since it adds jobs db schema, not that we're adding that db |
I pushed the changes I mentioned in my previous comment. feel free to revert or edit the commits if you think something else should have been done |
@alovew FYI. I think that you ran into this being broken as well. This PR will finally fix the ability to dump the schema using the Gradle tasks. |
@terencecho I don't understand what this check is doing: https://github.com/airbytehq/airbyte/actions/runs/3205588088/jobs/5238324179. Is this actually an issue or is that we have been out of sync for so long that we should just merge to reset what the base schema dump file contains? |
since that test is just running
it's only failing because there is output in |
…vation * master: (98 commits) 🐛 Source Bing Ads - Fix Campaigns stream misses Audience and Shopping (#17873) Source S3 - fix schema inference (#17991) 🎉 JDBC sources: store cursor record count in db state (#15535) Introduce webhook configs into workspace api and persistence (#17950) ci: upload test results to github for analysis (#17953) Trigger the connectors build if there are worker changes. (#17976) Add additional sync timing information (#17643) Use page_token_option instead of page_token (#17892) capture metrics around json messages size (#17973) 🐛 Correct kube annotations variable as per the docs. (#17972) 🪟 🎉 Add /connector-builder page with embedded YAML editor (#17482) fix `est_num_metrics_emitted_by_reporter` not being emitted (#17929) Update schema dumps (#17960) Remove the bump in the value.yml (#17959) Ensure database initialization in test container (#17697) Remove typo line from incremental reads docs (#17920) DocS: Update authentication.md (#17931) Use MessageMigration for Source Connection Check. (#17656) fixed links (#17949) remove usages of YamlSeedConfigPersistence (#17895) ...
* Ensure database initialization in test container * Remove unused import * Update schema dump * Add schema dump Co-authored-by: terencecho <[email protected]>
private static void initializeDatabase(final PostgreSQLContainer container) { | ||
final var containerDelegate = new JdbcDatabaseDelegate(container, ""); | ||
ScriptUtils.runInitScript(containerDelegate, "configs_database/schema.sql"); | ||
ScriptUtils.runInitScript(containerDelegate, "jobs_database/schema.sql"); |
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.
@jdpgrailsdev, I think this is incorrect. Each migration dev center should run specific its own init script, i.e. the config migration dev center should only run the configs initial script.
Currently when I run schema dump for one database, it will include the schemas for both configs and jobs database.
The schema dump is still correct in production because it is updated by ConfigsDatabaseMigratorTest
and JobsDatabaseMigratorTest
, which only does not have this behavior.
I think this diff is the result of running initialization for both databases all the time. That's why the jobs db schema ends up in the configs db dump, and vice versa. |
Added a fix here: #18984 |
What
How
Recommended reading order
MigrationDevCenter.java
Tests
./gradlew :airbyte-db:db-lib:dumpConfigsSchema
./gradlew :airbyte-db:db-lib:dumpJobsSchema