Skip to content

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

Merged
Naga Nandyala (naga-nandyala) merged 11 commits into
Azure:devfrom
nasc17:nasc/rdbmsDeploySupport
Nov 10, 2026
Merged

Naga Nandyala (naga-nandyala) merged 11 commits into
Azure:devfrom
nasc17:nasc/rdbmsDeploySupport

Conversation

@nasc17

@nasc17 nasc17 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests Suppressions
️✔️ None ️✔️ 130/130 ️✔️ None

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

Description
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 pytest
src\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.py
src\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 handling


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

Gabriel Lobo and others added 9 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>
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>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 02:17
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

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.

🟡 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

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.

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.

@nasc17 nasc17 changed the title [RDBMS] Fix deployment setup subprocess input handling, Copy [RDBMS] Fix deployment setup subprocess input handling Nov 10, 2026
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

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

@naga-nandyala
Naga Nandyala (naga-nandyala) merged commit 74f7e49 into Azure:dev Nov 10, 2026
52 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants