Repository navigation
[RDBMS] Fix deployment setup subprocess input handling - #34390
Conversation
Reuse executable lookup and retain resolved Git and GitHub CLI paths throughout deployment operations. Preserve arguments containing spaces and cover the deployment flows with unit tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sc/rdbmsDeploySupport
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
🟡 Changes recommended
Critical issues remain because the generated connection strings still send a masked password, making the GitHub secrets unusable, while the new regression assertion contradicts the current implementations.
3 open issues
What changed in this PR
This pull request standardizes GitHub CLI input handling for PostgreSQL, MySQL, and shared RDBMS deployment setup commands. Sensitive values are passed through standard input, credentials are serialized as JSON, and setup stops when secret registration fails.
Changes:
- Added stdin-based GitHub secret registration with subprocess failure handling.
- Preserved argument-list execution and executable resolution for non-secret commands.
- Added regression coverage for serialization, subprocess failures, executable resolution, and setup flow control.
| File | Summary |
|---|---|
src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_deploy_setup.py |
Adds regression coverage for secret uploads, subprocess behavior, executable resolution, and setup failures. The password assertion currently conflicts with implementations that send a masked value. |
src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_common.py |
Updates shared GitHub workflow and login commands to use argument lists. The new error message should use the official GitHub spelling. |
src/azure-cli/azure/cli/command_modules/rdbms/_flexible_server_util.py |
Adds executable resolution, stdin-based secret uploads, JSON serialization, and upload failure handling. The connection string currently sends a masked password, making the generated secret unusable. |
src/azure-cli/azure/cli/command_modules/postgresql/utils/_flexible_server_util.py |
Applies stdin-based uploads and input subprocess error handling to PostgreSQL deployment secrets. The connection string currently sends a masked password, making the generated secret unusable. |
src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py |
Updates unit expectations for stdin uploads and subprocess ordering. |
src/azure-cli/azure/cli/command_modules/postgresql/tests/latest/test_deploy_commands.py |
Updates PostgreSQL deployment setup tests for the new subprocess interface and failure reporting. |
src/azure-cli/azure/cli/command_modules/mysql/_util.py |
Applies stdin-based uploads, JSON serialization, and input subprocess failure handling to MySQL deployment secrets. |
Review effort: Lite
Naga Nandyala (naga-nandyala)
left a comment
There was a problem hiding this comment.
Thanks for recreating the PR. The conflicts are resolved correctly, the executable-resolution changes from #34308 are preserved, and the stdin changes look good.
Before merge:
Please update the title (drop ", Copy") and fill in the description, noting that this supersedes #34309. We'll close #34309 once this merges.
Please document the exact regression-test commands and results, including the PostgreSQL latest/unit deployment tests and MySQL/RDBMS deployment coverage.
Also, please restore the existing actionable AZURE_CREDENTIALS failure message and recommendation, without exposing credential values or subprocess output. If you'd prefer not to hold this PR for it, a follow-up is fine.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |

🤖 PR Validation — ️✔️ All clear
Related command
az postgres flexible-server deploy setupaz mysql flexible-server deploy setupDescription
Supersedes #34309
Standardize GitHub CLI input handling across the PostgreSQL, MySQL, and shared RDBMS deployment setup helpers.
Use standard input for GitHub CLI values and JSON serialization for generated configuration.
Stop workflow generation when an input-bearing subprocess fails, and report successful registration only after the subprocess completes successfully.
Preserve existing behavior for subprocesses without input, including MySQL executable resolution.
Add regression coverage for input handling, serialization, and setup failure paths.
Testing Guide
Exact regression command:
python -m pytestsrc\azure-cli\azure\cli\command_modules\postgresql\tests\latest\test_deploy_commands.py
src\azure-cli\azure\cli\command_modules\postgresql\tests\unit\test_deploy_commands.pysrc\azure-cli\azure\cli\command_modules\mysql\tests\latest\test_mysql_util.py
src\azure-cli\azure\cli\command_modules\rdbms\tests\latest\test_deploy_setup.py--import-mode=importlib --noconftest -q --tb=short`
Result: 67 tests and 129 subtests passed. The RDBMS suite covers stdin uploads and failure handling across all three modules. No live deployments ran.
Additional checks—all passed:
azdev style postgresql --pep8 --pylint
python -m flake8 src\azure-cli\azure\cli\command_modules\postgresql\tests\latest\test_deploy_commands.py
git --no-pager diff --check
History Notes
[PostgreSQL]
az postgres flexible-server deploy setup: Fix GitHub Actions setup input and error handling[MySQL]
az mysql flexible-server deploy setup: Fix GitHub Actions setup input and error handlingThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.