feat(tg): write TG_METADATA_DB_USER/PASSWORD into the compose file - #99
Merged
Merged
Conversation
TestGen's app-side settings are dropping the silent fallback from TG_METADATA_DB_USER/PASSWORD to TESTGEN_USERNAME/PASSWORD (hard cutover, no default). The installer now writes TG_METADATA_DB_USER/PASSWORD explicitly on fresh installs, and backfills it into existing compose files on upgrade, both as copies of the bootstrap TESTGEN_USERNAME/ PASSWORD account (no new Postgres role is created). The upgrade backfill validates the bootstrap credentials are actually present before writing anything, and only inserts whichever half (user/password) is actually missing, to avoid corrupting a hand-edited or partially-migrated compose file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Coverage Report •
|
aarthy-dk
approved these changes
Sep 22, 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.
Summary
tg install --dockernow writesTG_METADATA_DB_USER/PASSWORDinto the generated compose file, as a copy of the bootstrapTESTGEN_USERNAME/PASSWORDaccount — no new Postgres role is created.tg upgradebackfills these vars into existing compose files, since TestGen's app-side settings are dropping the silent fallback fromTG_METADATA_DB_USER/PASSWORDtoTESTGEN_USERNAME/PASSWORD(hard cutover, no default).Release-order dependency
This needs to ship (and reach users) before the TestGen app image that requires
TG_METADATA_DB_USER/PASSWORDwith no fallback gets published — otherwise existing Docker installs that pull that image viatg upgrade's--policy alwayslose their metadata-DB credentials entirely. Coordinating with the TestGen app team, who are holding their release until this is confirmed merged.Test plan
ruff check/ruff format --checkcleanpytestsuite green (269 passed), including 2 new regression tests for the upgrade-backfill edge cases (partial-key repair, abort on missing bootstrap creds)docker compose configand itsTG_METADATA_DB_USER/PASSWORDauthenticate viapsql; upgrade backfill on a legacy file recovers the account already initialized in an existing Postgres volume; abort path leaves a corrupted file untouched🤖 Generated with Claude Code