Skip to content

[RDBMS] Fix deployment setup subprocess input handling - #34309

Closed
Gabriel Lobo (thegabrielobo) wants to merge 8 commits into
Azure:devfrom
thegabrielobo:fix-rdbms-deploy-input
Closed

Gabriel Lobo (thegabrielobo) wants to merge 8 commits into
Azure:devfrom
thegabrielobo:fix-rdbms-deploy-input

Conversation

@thegabrielobo

@thegabrielobo Gabriel Lobo (thegabrielobo) commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Tests Suppressions
️✔️ None ️✔️ 130/130 ⚠️ 5 added

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
File Line Kind Code
src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py 178 skipped test @unittest.skipUnless(is_windows(), 'Windows executable lookup')
src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py 188 skipped test @unittest.skipUnless(is_windows(), 'Windows executable lookup')
src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py 196 skipped test @unittest.skipUnless(is_windows(), 'Windows executable lookup')
src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py 204 skipped test @unittest.skipUnless(is_windows(), 'Windows executable lookup')
src/azure-cli/azure/cli/command_modules/postgresql/tests/unit/test_deploy_commands.py 210 skipped test @unittest.skipUnless(is_windows(), 'Windows executable lookup')

Related command

az postgres flexible-server deploy setup
az mysql flexible-server deploy setup

Description

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

Run the following with the checkout's CLI packages available in the development Python environment:

python -m unittest azure.cli.command_modules.rdbms.tests.latest.test_deploy_setup azure.cli.command_modules.mysql.tests.latest.test_mysql_util azure.cli.command_modules.mysql.tests.latest.test_mysql_custom azure.cli.command_modules.postgresql.tests.unit.test_maintenance_event_commands

Result: passed, 49 tests on Windows with Python 3.10.

git diff --check

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 handling


This checklist is used to make sure that common guidelines for a pull request are followed.

Gabriel Lobo and others added 2 commits October 29, 2026 22:24
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>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 04:28
@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 30, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution Gabriel Lobo (@thegabrielobo)! We will review the pull request and get back to you soon.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

nasc17 and others added 6 commits November 9, 2026 13:29
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>

@naga-nandyala Naga Nandyala (naga-nandyala) left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#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.

@nasc17

nasc17 commented Nov 10, 2026

Copy link
Copy Markdown
Member

Naga Nandyala (@naga-nandyala) Gabriel Lobo (@thegabrielobo) started new PR that copies these changes with merge conflict resolved: #34390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants