[POSTGRESQL] az postgres flexible-server upgrade: Introduced --validate-only param for PVC - #33683
Merged
Merged
Conversation
…date-only param for PVC
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| postgres flexible-server upgrade | cmd postgres flexible-server upgrade added parameter validate |
Copilot started reviewing on behalf of
Matthew Boentoro (mattboentoro)
June 30, 2026 21:29
View session
…mattboentoro/pvc-cli
nasc17
reviewed
Jun 30, 2026
nasc17
reviewed
Jun 30, 2026
nasc17
reviewed
Jun 30, 2026
nasc17
suggested changes
Jun 30, 2026
nasc17
left a comment
Member
There was a problem hiding this comment.
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>
Collaborator
|
POSTGRESQL |
nasc17
approved these changes
Jul 1, 2026
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
az postgres flexible-server upgrade: Introduced --validate-only param for PVCaz postgres flexible-server upgrade: Introduced --validate-only param for PVC
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
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.' | ||
| ) |
Qi Pan (Pan-Qi)
approved these changes
Jul 16, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-onlyparam for PVCThis 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.