Skip to content

[RDBMS] az postgres flexible-server replica create/promote: Enable replica operations for elastic cluster operations#31705

Merged
evelyn-ys merged 32 commits intoAzure:devfrom
mattboentoro:mattboentoro/cof-replica-enable-2
Jul 28, 2025
Merged

[RDBMS] az postgres flexible-server replica create/promote: Enable replica operations for elastic cluster operations#31705
evelyn-ys merged 32 commits intoAzure:devfrom
mattboentoro:mattboentoro/cof-replica-enable-2

Conversation

@mattboentoro
Copy link
Copy Markdown
Member

Related command
az postgres flexible-server replica create
az postgres flexible-server replica promote

Description
Enable replica operations for elastic cluster operations

Testing Guide
Manual testing

History Notes

[RDBMS] az postgres flexible-server replica create/promote: Enable replica operations for elastic cluster operations


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

Copilot AI review requested due to automatic review settings June 24, 2025 18:54
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Jun 24, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️latest
️✔️3.12
️✔️3.9

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Jun 24, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Jun 24, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enables replica operations for elastic cluster operations by updating the validation logic in the PostgreSQL flexible-server commands.

  • Added ValidationError to handle elastic cluster-specific validation errors.
  • Removed the direct citus cluster check in replica creation and replaced it with elastic cluster–specific validations in the replica promotion command.
Comments suppressed due to low confidence (3)

src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py:599

  • [nitpick] The removal of the citus cluster validation call for replica creation should be accompanied by an inline comment explaining the rationale for its removal to aid in future maintainability.
    source_server_id_parts = parse_resource_id(source_server_id)

src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py:826

  • [nitpick] Consider adding an inline comment clarifying why the standalone promotion mode is disallowed for elastic clusters to improve readability and maintainability of the validation logic.
        if promote_mode.lower() == 'standalone':

src/azure-cli/azure/cli/command_modules/rdbms/flexible_server_custom_postgres.py:828

  • [nitpick] Consider adding an inline comment explaining why the planned promotion option is disallowed for elastic clusters to enhance clarity for future maintainers.
        if promote_option.lower() == 'planned':

@nasc17
Copy link
Copy Markdown
Member

nasc17 commented Jun 25, 2025

@evelyn-ys trying to rerun one of the tests locally and getting failure: ERROR cli.azure.cli.core.azclierror:azlogging.py:212 'VCRHTTPResponse' object has no attribute 'version_string'
ERROR az_command_data_logger:azlogging.py:213 'VCRHTTPResponse' object has no attribute 'version_string'
ERROR cli.azure.cli.core.azclierror:azlogging.py:212 'VCRHTTPResponse' object has no attribute 'version_string'
ERROR az_command_data_logger:azlogging.py:213 'VCRHTTPResponse' object has no attribute 'version_string'

Could you help share how to resolve this?

@evelyn-ys
Copy link
Copy Markdown
Member

@nasc17 It seems like your local development env issue. Maybe check the VCR version used? Or try azdev setup again?

@evelyn-ys
Copy link
Copy Markdown
Member

@mattboentoro Pls fix CI failure

@mattboentoro
Copy link
Copy Markdown
Member Author

@evelyn-ys test passed already, do you mind reviewing this PR?

@evelyn-ys evelyn-ys merged commit b71e202 into Azure:dev Jul 28, 2025
48 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.

5 participants