fix(infra): start postgres before sbt build in local-dev up/auto#6008
Merged
Conversation
common/dao's jooqGenerate sourceGenerator connects to postgres at sbt-compile time. cmd_up ran build_all before infra_up + schema bootstrap, and cmd_auto ran sbt dist with no postgres at all -- on fresh checkouts (generated jooq dir is not git-tracked) the compile fails on missing Tables/Keys/etc. cmd_up now runs the Infra section before Build; cmd_auto calls a new ensure_postgres_for_build helper (postgres-only, schema bootstrap) right before the sbt step. Static regression assertion added to test_local_dev_sh.sh. Closes apache#6007
Contributor
Automated Reviewer SuggestionsBased on the
|
bobbai00
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
bin/local-dev.sh up/autowere runningsbt distbefore postgres was reachable.common/dao'sjooqGeneratesourceGenerator connects to postgres via JDBC at compile time; with no postgres the catch block incommon/dao/build.sbtlogsContinuing compilation with existing generated files...and returnsSeq.empty. Because the generated jOOQ dir is not git-tracked, fresh checkouts have no fallback and the downstream Scala compile fails on missingTables/Keys/ etc.cmd_upinfra_up+infra_ensure_db_schema) → Servicescmd_autoensure_postgres_for_build) → Bounceensure_postgres_for_buildis a new helper that starts only thepostgrescontainer (if it isn't already running) and applies the schema — minimal blast radius forcmd_auto, which by contract only touches what its scan flagged dirty.Any related issues, documentation, discussions?
Closes #6007.
How was this PR tested?
bash bin/local-dev/tests/test_local_dev_sh.sh— 12/12 pass; added a static regression assertion Add Jinggang's HelloWorld file. #11 that scanscmd_upandcmd_autoand fails if any postgres-ready step (infra_ensure_db_schema/ensure_postgres_for_build) does not precede the firstbuild_all/sbt -no-colors distinvocation. Verified red-then-green: before the source change the new assertion reportsschema_at=1935 build_at=1903forcmd_upandschema_at=0 build_at=2062forcmd_auto.bash -n bin/local-dev/main.sh— clean.bin/local-dev.sh --help— unchanged usage.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.7