Repository navigation
[RDBMS] Fix deployment setup subprocess input handling - #34309
Gabriel Lobo (thegabrielobo) wants to merge 8 commits into
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>
|
Thank you for your contribution Gabriel Lobo (@thegabrielobo)! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the secret-input handling changes.
No open issues 🎉
What changed in this PR
This PR fixes GitHub CLI secret input handling for PostgreSQL and MySQL deployment setup, including the shared RDBMS helpers.
Changes:
- Pass secrets through standard input and serialize credentials with JSON instead of writing temporary files.
- Stop setup when secret uploads fail and report success only after completion, while preserving behavior for commands without input.
- Add regression tests for input handling, serialization, failure paths, and MySQL executable resolution.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/rdbms/tests/latest/test_deploy_setup.py |
Adds cross-module deployment setup regression tests. |
src/azure-cli/azure/cli/command_modules/rdbms/_flexible_server_util.py |
Updates shared secret uploads to use standard input and propagate failures. |
src/azure-cli/azure/cli/command_modules/postgresql/utils/_flexible_server_util.py |
Applies the input and error-handling fixes to PostgreSQL setup. |
src/azure-cli/azure/cli/command_modules/mysql/_util.py |
Applies the fixes to MySQL while retaining executable resolution. |
Review effort: Balanced
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
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>
There was a problem hiding this comment.
#34308 is merged, and this PR now has merge conflicts. Please update against dev, preserving the executable-resolution fixes from #34308.
When resolving, please retain the actionable AZURE_CREDENTIALS failure message and recommendation rather than replacing them with the generic “Command '…' failed with exit code N”. Keep credential values and subprocess output out of the error.
The stdin change itself looks good. Please rerun the PostgreSQL/MySQL/RDBMS deployment regression tests after resolving the conflicts.
|
Naga Nandyala (@naga-nandyala) Gabriel Lobo (@thegabrielobo) started new PR that copies these changes with merge conflict resolved: #34390 |
🤖 PR Validation —⚠️ Review suggested
This PR adds warning or check suppressions. Fix the underlying warning where possible and justify each remaining suppression in a code comment or the PR description.
5 added suppressions
src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py@unittest.skipUnless(is_windows(), 'Windows executable lookup')src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py@unittest.skipUnless(is_windows(), 'Windows executable lookup')src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py@unittest.skipUnless(is_windows(), 'Windows executable lookup')src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py@unittest.skipUnless(is_windows(), 'Windows executable lookup')src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py@unittest.skipUnless(is_windows(), 'Windows executable lookup')Related command
az postgres flexible-server deploy setupaz mysql flexible-server deploy setupDescription
Standardize GitHub CLI input handling across the PostgreSQL, MySQL, and shared RDBMS deployment setup helpers.
Testing Guide
Run the following with the checkout's CLI packages available in the development Python environment:
Result: passed, 49 tests on Windows with Python 3.10.
Result: passed.
The tests use mocked Azure/GitHub operations and a local Python subprocess for the standard-input round trip. Live Azure/GitHub deployment, the full test suite, and lint checks were not run.
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.