[VM] Fix #34063: az vmss update: Clear the opposite zone placement filter when switching filters - #34164
Conversation
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
|
@Azure/x-engineering-agent Please fix the PR-induced playback regression: the new |
There was a problem hiding this comment.
Review
Correct the PR-induced playback regression before making this draft ready. At head ae90ef5a871d098d3df4f17cc047a0312c8437a1, the newly added filter-switch commands in src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py issue HTTP requests that the unchanged tests/latest/recordings/test_vmss_update_zone_placement_policy.yaml cassette cannot satisfy. Both affected full-test shards report that matching requests have already been consumed.
Restore the pre-existing recorded scenario unless a complete successful replacement recording is obtained through the authorized live-test workflow. Preserve the opposite-filter cleanup in vm/custom.py and the new TestVMSSUpdateZonePlacement unit tests, including both transition directions, full VMSSCreate(command_args=...) assertions, omitted/null placement, unchanged filters, unrelated updates, and dual-flag rejection. This also addresses the explicit reporter feedback.
Upstream CI
azdev-style
- Result: failure
- Relevance: Not PR-related
- Evidence: Task log: acs/custom.py:1087,2946,2964 W0718; acs/azurecontainerstorage/_validators.py:361 R0916; sql/custom.py:1779 W0613; azure-cli-core/azure/cli/core/commands/arm.py:178 W0622; Pylint: FAILED; Flake8: PASSED; exit code 12.
- Suggested fix: All reported files are outside this VM-only diff. No source change is requested for this failure; rerun the workflow or escalate the existing ACS/SQL/core diagnostics to their owners.
- Verify: Rerun azdev-style on the corrected head.
Azure.azure-cli Full Test
- Result: failure
- Included checks:
Azure.azure-cli Full Test (Automation Full Test Python312 Profile Latest instance2),Azure.azure-cli Full Test (Automation Full Test Python314 Profile Latest instance2) - Failure details:
- Automation Full Test Python312 Profile Latest instance2 / azdev test (PR-related)
- Evidence: self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0
self.output = stdout_buf.getvalue()
self.applog = logging_buf.getvalue()
except CannotOverwriteExistingCassetteException as ex:
- Evidence: self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0
- Automation Full Test Python312 Profile Latest instance2 / azdev test (PR-related)
raise AssertionError(ex)
E AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_update_zone_placement_policy.yaml') in your current record mode (<RecordMode.ONCE: 'once'>).
E No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_update_zone_placement_000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss-update-include-zones?api-version=2026-04-01>) was found.
E Found 3 recorded request(s) matching (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_update_zone_placement_000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss-update-include-zones?api-version=2026-04-01>) but they have already been consumed.
src/azure-cli-testsdk/azure/cli/testsdk/base.py:308: AssertionError
- Next action: The added VMSS filter-switch requests exhaust the unchanged test_vmss_update_zone_placement_policy.yaml cassette. Restore the pre-existing recorded scenario while retaining the new deterministic unit tests, unless the authorized live workflow can produce a complete successful replacement recording.
- Verify: Run azdev test vm.test_custom_vm_commands vm.test_vmss_update_zone_placement_policy, then rerun the Python 3.12 and 3.14 instance2 full-test jobs.
- Automation Full Test Python314 Profile Latest instance2 / azdev test (PR-related)
- Evidence: self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0
self.output = stdout_buf.getvalue()
self.applog = logging_buf.getvalue()
except CannotOverwriteExistingCassetteException as ex:
- Evidence: self.exit_code = cli_ctx.invoke(shlex.split(command), out_file=stdout_buf) or 0
raise AssertionError(ex)
E AssertionError: Can't overwrite existing cassette ('/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_update_zone_placement_policy.yaml') in your current record mode (<RecordMode.ONCE: 'once'>).
E No match for the request (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_update_zone_placement_000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss-update-include-zones?api-version=2026-04-01>) was found.
E Found 3 recorded request(s) matching (<Request (GET) https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vmss_update_zone_placement_000001/providers/Microsoft.Compute/virtualMachineScaleSets/vmss-update-include-zones?api-version=2026-04-01>) but they have already been consumed.
src/azure-cli-testsdk/azure/cli/testsdk/base.py:308: AssertionError
- Next action: The added VMSS filter-switch requests exhaust the unchanged test_vmss_update_zone_placement_policy.yaml cassette. Restore the pre-existing recorded scenario while retaining the new deterministic unit tests, unless the authorized live workflow can produce a complete successful replacement recording.
- Verify: Run azdev test vm.test_custom_vm_commands vm.test_vmss_update_zone_placement_policy, then rerun the Python 3.12 and 3.14 instance2 full-test jobs.
Azure.azure-cli
- Result: failure
- Included checks:
Azure.azure-cli (Check CLI Style) - Failure details:
- Check CLI Style / Bash (Not PR-related)
- Evidence: src/azure-cli/azure/cli/command_modules/acs/custom.py:2946:11: W0718: Catching too general exception Exception (broad-exception-caught)
src/azure-cli/azure/cli/command_modules/acs/custom.py:2964:11: W0718: Catching too general exception Exception (broad-exception-caught)
************* Module azure.cli.command_modules.acs.azurecontainerstorage._validators
src/azure-cli/azure/cli/command_modules/acs/azurecontainerstorage/_validators.py:361:19: R0916: Too many boolean expressions in if statement (6/5) (too-many-boolean-expressions)
- Evidence: src/azure-cli/azure/cli/command_modules/acs/custom.py:2946:11: W0718: Catching too general exception Exception (broad-exception-caught)
- Check CLI Style / Bash (Not PR-related)
Your code has been rated at 10.00/10
ERROR: Pylint: FAILED
Running flake8 on modules...
Flake8: PASSED
- Next action: The quoted ACS files are not changed by this VM PR. No unrelated source change is requested; rerun Check CLI Style or escalate these existing diagnostics to the owning component.
- Verify: Rerun Azure.azure-cli / Check CLI Style on the corrected head.
Test validation
- Live test: Failed with conclusion
failure. Workflow run - Regression coverage: For
vm: 2 focused test file(s) changed. Scenario coverage is unverified; review the issue's required conditions, test setup, and assertions before approval. Changed tests invokeaz vmss update, but invocation alone does not verify the required scenario or output. No linked issue was found in the PR timeline; inspect the source issue and its required scenario manually.
The existing Agent live-test result is not PR-related (environment): Compute returned Setting Placement on Virtual Machine Scale Sets is only allowed for preview customers. The failure occurs during the initial vmss create at test_vm_commands.py:15262, before either new transition. The run reports 16 passed and 1 failed; it does not establish successful live transition coverage.
Do not change shared subscription configuration, synthesize cassette interactions, or publish the incomplete recording from live-test-pr-34164. Successful live recording requires an already-authorized preview-enabled environment; otherwise retain the existing recorded scenario and validate the new deterministic tests through upstream CI.
I inspected the source issue directly despite the timeline lookup above finding no link. The unit tests exercise the actual update handler with persisted camelCase filters and assert the complete outgoing arguments in both directions. The changed scenario also asserts the surviving filter and absence of the opposite filter, but it lacks a successful recording of those added interactions. No additional semantic defect was confirmed in the production cleanup. The PR's testing guide is author-provided guidance, not evidence of another completed Agent live run.
Risk assessment
16/100 · Low · High confidence
The Low rating is driven by public CLI behavior.
- Change scope: 3 changed files, 184 changed lines (
+181/-3), including 1 production file. - Affected components:
vm - Risk drivers: public CLI behavior (+18)
- Regression evidence: Changed regression tests are included, reducing risk.
- Confidence: High because changed-line patches were available for every production file.
- Required review: Owning-squad review is recommended for
vmbefore merge.
Posted by x-engineering-agent (Reviewer)
…ment filter when switching filters
ae90ef5 to
56dde0c
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Live test results —
|
Related command
az vmss updateDescription
Fixes #34063.
Clear the opposite zone placement filter when switching filters.
Testing Guide
az vmss update.src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_custom_vm_commands.py,src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py.History Notes
[VM]
az vmss update: Clear the opposite zone placement filter when switching filtersThis 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.