Repository navigation
Move strr-api deployed DB access to Cloud SQL IAM auth - #1763
Open
Jacky-Pham wants to merge 9 commits into
Open
Jacky-Pham wants to merge 9 commits into
Jacky-Pham wants to merge 9 commits into
Conversation
Jacky-Pham
requested review from
JazzarKarim,
dimak1,
jimmypalelil and
thorwolpert
as code owners
July 8, 2026 22:00
Collaborator
|
Temporary Url for review: https://strr-hosts-dev--pr-1763-ciu8zc70.web.app |
Jacky-Pham
force-pushed
the
Jacky/alembic-service-account-ownership
branch
2 times, most recently
from
July 8, 2026 22:10
bc568e9 to
1834cc0
Compare
Jacky-Pham
force-pushed
the
Jacky/alembic-service-account-ownership
branch
from
July 8, 2026 22:20
1834cc0 to
16ef0a0
Compare
|
This branch has not been deployed
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.



Move
strr-apito the shared Cloud SQL Python Connector and pg8000 for deployed IAM authentication, while retaining password/TCP/socket configuration for local development. Migration mode selectsDATABASE_MIGRATION_USERNAMEand retainsSET ROLEownership of schema objects.The refreshed branch includes current main
6c02d3ceand pins the same tested common #77 candidate (395a3bdd402d918f2ba3df6d6cf26a629872a121) as #1764. The lock preserves all 160 existing main package versions and sources; only the helper and its required dependencies are added.Migration fix
Testing the actual pg8000 migration path exposed a failure hidden by the previous psycopg2-only ownership test: Alembic commits before entering an autocommit block, then reads the isolation level. With the installed pg8000/SQLAlchemy combination, that query opens a DBAPI transaction invisible to SQLAlchemy, so
CREATE INDEX CONCURRENTLYfails.A listener scoped to pg8000 migration connections ends that isolation-query transaction before an explicit AUTOCOMMIT transition, only when SQLAlchemy has no active transaction. It does not make the whole migration or API engine autocommit. Regression tests migrate through standalone Alembic and the actual Flask-Migrate configuration using a non-superuser login, verify all four concurrent indexes and object ownership, and confirm a failed ordinary migration rolls back.
Validation
07183914CI is green: eleven successful checks and five neutral frontend checks. API run35920064868 passes setup, linting, production image build, unit tests (576 passed/six skipped) and coverage; CodeQL and Sonar pass. This run resolves SRE workflow196c16c5, which selects the image namedpostgres15-postgis-anon. Its recorded digestsha256:8ea288e1f1dce2e8e2024a594c018d8e77dfa3b984bbb13125c0e3cc92ac12faactually starts PostgreSQL 18.6, despite its name. The repository test containers still default to PG16; CI uses Python 3.14.7. The separate local result above establishes actual PG18 coverage.Before merge / rollout
Merging to main starts deployment. These gates remain:
sa-job, referencesupdate_db.sh, uses the mutablestrr-api:devimage and lacks the IAM instance, migration username and owner role.update_db.shitself selects migration mode. The shared deployment template describes/executes the existing job; it does not configure these properties. A dedicated migration-stage image is not currently defined by this API Dockerfile; verify the chosen API image and entrypoint instead of assuming one was built.SET ROLE strr. Draft test: add protected DEV IAM catalog verification #1854 prepares a read-only DEV API/job catalog verifier; it has not run and does not verify the migration identity/owner-role path or final consumers.bcrbk9-dev; TEST/UATbcrbk9-test; sandboxbcrbk9-tools; PRODbcrbk9-prod.No cloud migration, application deployment, database mutation, vault edit or IAM change was performed during this refresh. Local test databases were disposable.