-
Notifications
You must be signed in to change notification settings - Fork 22
Move remaining STRR services and jobs to Cloud SQL IAM auth #1764
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
Open
Jacky-Pham
wants to merge
14
commits into
main
Choose a base branch
from
Jacky/iam-auth-remaining-services
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3948d5b
chore: move remaining STRR db clients to IAM auth
Jacky-Pham 7a1ca2f
chore: fix IAM auth lint formatting
Jacky-Pham 36b03d5
chore: fix queue service IAM lint
Jacky-Pham adde7e5
chore: address SonarCloud IAM findings
Jacky-Pham 432b8db
chore: merge main into IAM auth services
Jacky-Pham 43f72c9
refactor: centralize Cloud SQL IAM connections
Jacky-Pham 7cf048e
refactor: centralize Cloud SQL environment config
Jacky-Pham 21cd93f
style: format centralized database config
Jacky-Pham d6c08c0
chore: sort email config test imports
Jacky-Pham a08dbc4
fix: use reachable shared connector revision
Jacky-Pham bb944f7
fix: align Cloud SQL IAM configuration
Jacky-Pham c6568be
chore: satisfy IAM deployment quality gates
Jacky-Pham 1aef365
test: strengthen IAM deployment contracts
Jacky-Pham 9438ff5
chore: refresh cloud sql connector dependencies
Jacky-Pham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
.github/workflows/strr-gcp-iam-deployment-contracts-ci.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: STRR GCP IAM deployment contracts | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, develop] | ||
| paths: | ||
| - ".github/workflows/strr-gcp-iam-deployment-contracts-ci.yaml" | ||
| - "tests/deployment/test_gcp_iam_vaults.py" | ||
| - "queue_services/strr-*/devops/vaults.gcp.env" | ||
| - "queue_services/strr-*/devops/gcp/clouddeploy.yaml" | ||
| - "jobs/*/devops/vaults.gcp.env" | ||
| - "jobs/*/devops/gcp/clouddeploy.yaml" | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - ".github/workflows/strr-gcp-iam-deployment-contracts-ci.yaml" | ||
| - "tests/deployment/test_gcp_iam_vaults.py" | ||
| - "queue_services/strr-*/devops/vaults.gcp.env" | ||
| - "queue_services/strr-*/devops/gcp/clouddeploy.yaml" | ||
| - "jobs/*/devops/vaults.gcp.env" | ||
| - "jobs/*/devops/gcp/clouddeploy.yaml" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| deployment-contracts: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Check Cloud SQL IAM deployment contracts | ||
| run: python tests/deployment/test_gcp_iam_vaults.py | ||
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| """Tests for auto-approval Cloud SQL configuration wiring.""" | ||
|
|
||
| import runpy | ||
| from pathlib import Path | ||
| from unittest.mock import patch, sentinel | ||
|
|
||
| CONFIG_PATH = Path(__file__).resolve().parents[2] / "src/auto_approval/config.py" | ||
|
|
||
|
|
||
| def test_config_uses_shared_sqlalchemy_settings(): | ||
| with ( | ||
| patch("dotenv.load_dotenv"), | ||
| patch( | ||
| "cloud_sql_connector.sqlalchemy_settings_from_env", | ||
| return_value=(sentinel.database_uri, sentinel.engine_options), | ||
| ) as settings_from_env, | ||
| ): | ||
| config_module = runpy.run_path(str(CONFIG_PATH)) | ||
|
|
||
| settings_from_env.assert_called_once_with() | ||
| assert config_module["_Config"].SQLALCHEMY_DATABASE_URI is sentinel.database_uri | ||
| assert config_module["_Config"].SQLALCHEMY_ENGINE_OPTIONS is sentinel.engine_options |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.