Skip to content

[POSTGRESQL] az postgres flexible-server upgrade: Introduced --validate-only param for PVC - #33683

Merged
Qi Pan (Pan-Qi) merged 5 commits into
Azure:devfrom
mattboentoro:mattboentoro/pvc-cli
Jul 16, 2026
Merged

Qi Pan (Pan-Qi) merged 5 commits into
Azure:devfrom
mattboentoro:mattboentoro/pvc-cli

Conversation

@mattboentoro

@mattboentoro Matthew Boentoro (mattboentoro) commented Jun 30, 2026

Copy link
Copy Markdown
Member

Related command
az postgres flexible-server upgrade

Description
Introduced --validate-only param for PVC

Testing Guide
Manual testing

History Notes

[POSTGRESQL] az postgres flexible-server upgrade: Introduced --validate-only param for PVC

image

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 30, 2026 21:27
@mattboentoro
Matthew Boentoro (mattboentoro) requested a review from a team as a code owner June 30, 2026 21:27
@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 30, 2026

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

@azure-client-tools-bot-prd

azure-client-tools-bot-prd Bot commented Jun 30, 2026

Copy link
Copy Markdown
⚠️AzureCLI-BreakingChangeTest
⚠️postgresql
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd postgres flexible-server upgrade cmd postgres flexible-server upgrade added parameter validate

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread src/azure-cli/azure/cli/command_modules/postgresql/commands/upgrade_commands.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/postgresql/_help.py Outdated
Comment thread src/azure-cli/azure/cli/command_modules/postgresql/_params.py Outdated

@nasc17 nasc17 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you include screenshot of how results of the command would appear

- upgrade_commands.py: run RG and Citus cluster validations
  before short-circuiting on --validate-only so both flows
  share the same preconditions
- _help.py: reword pre-upgrade validation example name per
  reviewer suggestion
- _params.py: tighten --validate-only help text per reviewer
  suggestion

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yonzhan

Copy link
Copy Markdown
Collaborator

POSTGRESQL

@Pan-Qi

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

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

@mattboentoro Matthew Boentoro (mattboentoro) changed the title [POSTGRESQL] az postgres flexible-server upgrade: Introduced --validate-only param for PVC [POSTGRESQL] az postgres flexible-server upgrade: Introduced --validate-only param for PVC Jul 7, 2026
@Sebby37

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.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

Comment on lines +7 to +15
from knack.log import get_logger
from knack.util import CLIError
from .._client_factory import cf_postgres_flexible_replica
from azure.cli.core.util import user_confirmation
from .._client_factory import cf_postgres_flexible_replica, cf_postgres_flexible_major_version_upgrade_precheck
from ..utils._flexible_server_location_capabilities_util import get_postgres_server_capability_info
from ..utils._flexible_server_util import resolve_poller
from ..utils.validators import pg_version_validator, validate_citus_cluster, validate_resource_group

logger = get_logger(__name__)
Comment on lines +18 to +24
def flexible_server_version_upgrade(cmd, client, resource_group_name, server_name, version, validate=None, yes=None):
validate_resource_group(resource_group_name)
validate_citus_cluster(cmd, resource_group_name, server_name)

if validate:
return _flexible_server_version_upgrade_validate(cmd, client, resource_group_name, server_name, version)

Comment on lines +92 to +95
precheck_validation_id = _get_attr_or_key(start_response, 'name')
if not precheck_validation_id:
raise CLIError('Failed to retrieve precheck validation id from the upgrade precheck response.')

Comment on lines +118 to +123
def _get_status(obj):
status = _get_attr_or_key(obj, 'status')
if status is None:
return None
# Some SDK enums expose .value
return getattr(status, 'value', status)
Comment on lines +271 to +276
pg_version_upgrade_validate_arg_type = CLIArgumentType(
options_list=['--validate-only'],
action='store_true',
help='Run a pre-upgrade validation against the server without performing major version upgrade on resource. '
'Returns the prevalidation check result.'
)
@Pan-Qi
Qi Pan (Pan-Qi) merged commit 78de370 into Azure:dev Jul 16, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants