chore(api): transfer Alembic object ownership#1671
Merged
Conversation
bea58d6 to
b13547d
Compare
b13547d to
46ca976
Compare
|
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
This is an SRE initiative that came from the security team around Cloud SQL IAM/service account ownership.
I lined this up with Andriy's Alembic IAM migration flow from the other apps. The important bit is the same pattern used in PPR/Search: read DATABASE_OWNER_ROLE, escape quotes, run SET ROLE before Alembic runs, then commit so migrations create objects as that DB role.
So the short explanation is: I basically copied the migration ownership approach Andriy used there and adapted it to STRR's standalone env.py.
What changed
Testing
Note: I also reran the full integration suite. The Alembic test passed, but two existing NOC tests failed on nocSentDate being null. I reran those exact two tests and they still failed, so I’m treating that as unrelated to this migration-role change.