Repository navigation
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
Please fix CI issues |
Production MI validation — 2026-10-12Validated commit
The dropped test backups remain under their configured retention; they were not purged. Use the original textual Still blocked: this MI reports immutability These were live smoke checks, not newly captured/re-recorded scenario cassettes. Existing recording refresh and standard full-module validation remain outstanding; keep this PR in draft. No implementation changes were required by the supported-path checks. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 34207 in repo Azure/azure-cli |
|
🔔 Routing this PR to @Azure/act-observability-squad. |
|
🔔 Routing this PR to @Azure/act-codegen-extensibility-squad. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
X Engineering Agent ReportReview — Comments SQL STR reviewCI passed (52 checks), with no confirmed semantic defect across the eight review lenses. Issue-scenario regression coverage remains unverified; this is an evidence limitation, not a demonstrated code defect. The custom wrappers preserve conditional irreversible-action confirmation, reject either lock value for dropped MI databases before HTTP, and omit unspecified settings. The generated-command adapters preserve integer differential-interval requests and use the final policy resource for async SET output. Focused tests exercise cancellation, request omission, polling failures, flattened status output, nested systemData, IDs and wait compatibility. No unresolved Copilot feedback was supplied. Test validation
There is no module-level coverage gap. The author reports 53 offline tests and later live integer-interval checks; those are author evidence, distinct from this review and upstream CI. The five October 13 recordings exercise preview requests, successful async SET followed by policy GET, locking, rejection paths and live/dropped MI behavior. They predate the integer-serialization correction and latest adapter refactor; recordings alone do not establish execution of the current adapter. Preview API availability beyond the recorded regions/cloud remains unverified, as already noted in the PR. Before merge, attach or identify head-pinned focused regression results for Paths below are relative to
Focused replay in a configured developer checkout, with live-target flags unset: Risk assessment — 55/100 · HighThe High rating is driven by public CLI behavior, failure-handling behavior, generated output.
Posted by x-engineering-agent (Reviewer) |
|
🔔 Routing this PR to @Azure/act-observability-squad. |
|
🔔 Routing this PR to @Azure/act-codegen-extensibility-squad. |
Generate SQL DB, live MI database, and dropped MI database STR GET/PUT command bases. Preserve existing custom command surfaces and ARM final-policy polling, and expand offline regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep generated examples aligned with the existing public wrappers, which supply the default policy name internally, and exercise all four examples through the CLI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Normalize the SQL Database differential interval in the custom operation adapter without editing generated code. Add exact JSON type and fractional-input regressions. Verified 50 offline tests and eight live interval updates on retained disposable databases with settings restored. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Review outcome
One confirmed test-resource cleanup defect remains at 03307dd24188df4fce24d1223c51430d19eb144f. No production defect was confirmed in the bounded STR mapping review. COMMENT only; not approval or merge readiness.
Confirmed semantic finding
P2 — Mark the managed database as owned before checking create output.
src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_mi_str_policy.py:135-137 passes name/status checks into self.cmd(...) before setting database_created=True. src/azure-cli-testsdk/azure/cli/testsdk/base.py:175-177,268-278 executes checks before returning. If creation succeeds but an assertion fails, cleanup at lines 140-144 sees false and leaves a billable database behind. This confirms the existing Copilot comment. Separate creation from checks, set ownership immediately after successful creation, then assert output. Verify with a mocked successful create/failing assertion that registered cleanup deletes once; a failed create must not authorize deletion. No feedback-dismissal, dispatch or source change was performed.
Upstream CI succeeded
Already-read snapshot: 52/52 completed and passed; 0 failed, pending or cancelled validations. Latest completion: 2026-10-16T17:35:55Z. CI was not re-polled. Required scenario regression remains unverified; no Agent tests or live validation ran.
Request, response and scenario evidence
_str_policy.py:20-25,45-59drops only omitted (None) arguments, retaining false/zero and defaulting the policy name. The DB adapter emits integer differential intervals without inserting omitted settings. Generated DB/MI PUT schemas mapproperties.retentionDaysandproperties.lockImmutability; DB also mapsdiffBackupIntervalInHours. Immutable-backup state is returned asimmutabilityStatus(Disabled/Enabled/Locked), not animmutableBackupsrequest field. GET/SET output flattens policy properties.- Custom handlers confirm only true locking and reject either lock value for dropped MI databases before HTTP. Polling preserves the final policy GET; no status is synthesized.
- DB tests wait for Enabled; MI locking asserts Enabled. Both assert SET output and independent GET state after locking/increasing retention, then rejected decreases/unlocking with preserved Locked state. The recordings show matching payloads and Enabled-to-Locked responses, not merely setup/URI evidence: DB immutability cassette lines 2584/2759 and MI lines 792/917 show lock requests and Locked responses. Omission/false and no-wait have separate assertions. DB lock-only service success is explicitly NOT proved; those scenarios include retention.
- Metadata identifies upstream AAZ model PR #1130; the tests README describes generation from 2026-08-01-preview plus compatibility adapters. This supports provenance, not independent regeneration verification.
Focused verification targets (not run)
Tests:
src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.pysrc/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_str_policy.pysrc/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_db_str_policy.pysrc/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_mi_str_policy.py
Recordings:src/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_db_existing_policy_immutability.yamlsrc/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_db_short_term_retention.yamlsrc/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_db_short_term_retention_immutability.yamlsrc/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_managed_db_short_retention.yamlsrc/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_managed_db_short_retention_immutability.yaml
After fixing cleanup, rerun focused offline STR adapter/safety tests and these five scenario playbacks. Map required conditions to setup and returned-output assertions before approval; changed files/recordings alone are not coverage all-clear.
Test validation
- Agent live test: Not run; this is a review-only PR. Check author-provided test evidence and upstream CI separately.
- Regression coverage: For
sql: 4 focused test file(s) and 5 recording file(s) changed. Scenario coverage is unverified; review the issue's required conditions, test setup, and assertions before approval. No linked issue was found in the PR timeline; inspect the source issue and its required scenario manually.
Risk assessment
83/100 · Critical
The Critical rating is driven by security-sensitive behavior, public CLI behavior, failure-handling behavior and 1 additional signal(s).
- Change scope: 31 changed files, 38940 changed lines (
+12734/-26206), including 21 production files. - Affected components:
sql - Risk drivers: security-sensitive behavior (+28); public CLI behavior (+18); failure-handling behavior (+12); generated output (+12)
- 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 required for
sqlbefore merge.
Posted by x-engineering-agent (Reviewer)
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
🤖 PR Validation —⚠️ Review suggested
Related command
az sql db str-policy set,show, andwaitaz sql midb short-term-retention-policy setandshow(live and restorable dropped databases)Description
Add short-term backup immutability support using
2026-08-01-preview, with the final async SET result aligned with Azure PowerShell PR 30215.--lock-immutabilityand--yes/-yto both SET commands. Onlytrueprompts, with an irreversible-action warning. Decline/non-interactive confirmation failure sends no update and emits no result;--yesbypasses confirmation.--lock-immutabilitywith--deleted-time, including explicitfalse, before HTTP. Never serialize that property for dropped MI databases.immutabilityStatuson SET/show for SQL Database and live/dropped MI databases, retaining flattened CLI output and nestedsystemData.--ids, wait and--no-wait, with a small compatibility adapter for omitted values and completion polling.azure-mgmt-sql==4.0.0b22is unchanged; a whole-module migration to the hybrid models in5.0.0b2is out of scope.Generated-command customization review (2026-10-19)
Addressed the operations-directory and generated-inheritance review comments in
fc175e95adfc913b105e4af134fc9ed2f551f8e1.sql/operations/str_policy.pywith a package initializer and updated wrapper imports. All six commands directly inherit their generated AAZ command; all three customized PUT operations directly inherit their generated operation. Shared argument normalization and polling logic use ordinary functions, with no custom classes directly inheriting coreAAZCommandorAAZHttpOperation.Scenario cleanup safety (2026-10-19)
Commit
48a4c88fac189658c1b07b896bd7ee376daf986caddresses Copilot finding 4260152815, confirmed by the X Engineering Agent review.Integer differential-backup interval serialization (2026-10-16)
Commit
03307dd24188df4fce24d1223c51430d19eb144ffixes a regression found by live SQL Database validation: AAZ's generated numeric schema serialized--diffbackup-hours 12/24as JSON12.0/24.0, which the service rejected withInvalidResourceIdSegment. An integer-payload REST control was accepted.The SQL Database custom operation now normalizes only a present, integral
diffBackupIntervalInHoursvalue after generated serialization, and explicitly rejects fractional input instead of truncating it. Omitted fields stay omitted; the other properties, MI operations, response schemas, confirmation, and completion polling are unchanged. Generated Python files and the upstream AAZ models were not hand-edited or changed; this compatibility override survives regeneration.Validation for this fix:
Lockedand oneEnabled: 12/24 hours with normal completion and--no-wait, including explicit retention/lock preservation. A transport guard checked the actual outgoing JSON integer type and permitted writes only to these two policies.The earlier broad SQL live scenarios failed before this correction; they are not being relabeled as passes. The post-fix live validation targeted the affected field and its combinations. The MI and isolated SQL locking scenarios had already passed live and offline replay.
Exact additional validation commands (from the CLI worktree root; all exited 0):
The full offline command below was rerun unchanged and now reports 50 passing tests. New hosted CI results must be checked for this commit before merging.
AAZ generation (2026-10-16)
Commit
9451dbe62e486904492d957059b857d154b702a0replaces the handwritten STR request/response schemas with six command bases generated by aaz-dev-tools 4.7.1:sql/aaz/latest/sql/db/str_policy.sql/aaz/latest/sql/midb/short_term_retention_policy.restorable_droppedchild package.The bases remain unregistered: the existing custom handlers preserve public command names, aliases, required MI retention, database-ID handling, conditional irreversible-action confirmation, and rejection of either lock flag value for dropped databases. No new public command group is introduced. The dropped-policy model hides the shared-schema lock argument.
operations/str_policy.pycontains compatibility adapters, including the integer wire-type correction above, not manually maintained API schemas. Its shared PUT operation override intentionally retains the final policy GET described below: the current REST specifications declarefinal-state-via: location, which must not undo the already-tested PowerShell alignment when regenerating.Generation inputs:
Azure/azure-rest-api-specscommit2e2b290fd446b03bbddcdc31098ff97e7218f0cf, SQL2026-08-01-preview; AAZ base commitf4676b10d373ec9f5c0b63b986fe2a1832682814. Generated files were not hand-edited. An unrelated generator change to the existing MI start-stop-schedule registration was excluded.Upstream models: Azure/aaz#1130.
Final policy GET alignment (2026-10-13)
Commit
93e16b8f2253fbdccb1a8337cc2dca763d6cae83removes the explicitfinal-state-via: locationoverride from the shared STR PUT operation. For theAzure-AsyncOperationflow recorded for SQL Database and MI:Succeeded.This matches the PowerShell recordings, whose final policy GET belongs to the SET operation. It replaces the previous OperationResults GET; it does not add a second final read, synthesize
Locked, retry until a desired immutability status, add fixed delays, or fill omitted request properties.--no-waitstill submits once, without polling or a final GET, and emits no result.200responses without polling headers and Location-only responses retain standard ARM behavior: return their response without an additional policy GET. Unit tests cover these distinct paths; no unconditional readback is claimed.Lockedon SET itself, as well as through independent policy GETs. All five affected scenarios were genuinely re-recorded live on 2026-10-13; response statuses and URLs were not hand-edited to pass playback.Wait-command compatibility
The earlier fix in
3333619a720b9deb77c784134f1e276500dda0c4remains intact:az sql db str-policy wait --policy-name defaultis accepted and--policy-nameremains required, matching the exact PR basecc010d2104b3ab0089c33fb7eac8816c260a11ac. A dedicated getter forwards and URL-escapes the supplied name; show/set and MI commands still use the default policy without a new public option. Regression coverage includes--ids, encoded names and missing-option rejection without HTTP. No compatibility-rule suppression or exception is requested.Remaining service limitations and release checks
Disabledwhile the actual policy GET reportsLocked. Earlier raw SQL DB recordings and 24 paired MI diagnostic reads over approximately 144 seconds demonstrated this backend inconsistency. The CLI now uses the standard final policy GET for the recorded async flow; this does not claim the backend endpoint is fixed.Disabledbefore becomingEnabled. The new-DB locking test retains its 900-second readiness timeout and refuses to lock beforeEnabled; independent post-lock checks retain their 300-second timeout. A previous Oct13 initialization failure is not counted as passing. The refreshed new-DB locking recording passed.InvalidParameterValue; including current retention succeeds. On a locked policy, retention updates with the lock flag omitted can be interpreted as unlocking. Help now documents explicit retention when locking and preserving--lock-immutability truewhen increasing retention. No automatic payload completion was introduced.Testing Guide
Latest validation (2026-10-19,
fc175e95ad): 53 unique STR tests passed, zero failures/errors/skips, including all five recorded scenarios and direct generated-inheritance coverage. Scoped flake8, customization pylint, package discovery, whitespace checks, and editor diagnostics passed. The complete 52-test published baseline also passed before refactoring. Hosted CI for this new commit is separate from older successful runs.Prior local validation (2026-10-16): 50 tests passed, zero failures/errors/skips (34 CLI/HTTP unit tests + 11 scenario safety tests + 5 recorded scenarios). Offline execution used this checkout's CLI/core/test SDK source with the installed CLI libraries on Python 3.14.6, an empty Azure configuration, live-target flags removed, socket connections blocked, and only the unrelated release-update connectivity probe disabled.
The new original-resource final-GET regressions failed against the previous Location override and passed after the fix. A combined-suite run also exposed and fixed the unit-test session-cache isolation issue; the complete combined suite then passed in 70.238 seconds.
AAZ migration validation (2026-10-16)
custom.pyhas 27 import-analysis diagnostics in this local SDK environment, all also present in the 31-diagnostic parent baseline; the migration adds zero pylint diagnostics. A clean full-module pylint result is not claimed.--idsand required retention, lack of public registration for dropped-policy bases, nestedsystemDataacross all three generated resource types, and execution of all four generated examples through the public CLI wrappers.Exact local validation commands and results
Run from the CLI worktree root. The installed SDK uses Python 3.14.6; the separate test dependencies are in
E:\CLI\str-env.The broader AAZ repository check was stopped in favor of the focused SQL verification above. The regenerated head
03307dd24188df4fce24d1223c51430d19eb144fsubsequently passed all 52 hosted checks. The October 19 cleanup commit requires separate CI.SQL Database scenarios
Source: SQL Database STR tests.
test_sql_db_short_term_retentionDisabled/Enabled.test_sql_db_short_term_retention_immutabilityEnabled; initialize 7/12. Decline/no-TTY cause no HTTP. Accepted confirmation locks at 7 days; SET returnsLockedand GET independently verifies it.--yesincreases to 8 days with SET and GETLocked. Explicit-lock decrease and false unlock returnInvalidImmutableBackupRetentionPeriodandCannotRemoveLockedPitrImmutability. Differential-only no-wait preserves Locked at 8/24.test_sql_db_existing_policy_immutabilityEnabled. Locks with unchanged 7-day retention and preserves 24-hour differential interval; SET and GET reportLocked. Rejects reduction to 6 days and unlocking. Repeated lock with no-wait has no output/prompt; independent GET remains Locked7/24. Policy-only transport guard; no create/delete.All three refreshed SQL DB scenarios passed live on 2026-10-13 (new DBs in West US 2; policy-only in West Central US), and passed offline playback. The two new SQL DBs were retained by request. There are now eight retained SQL test databases across the earlier and current validation runs; they continue to incur charges. The policy-only run modifies only its expressly authorized retained test DB, not an original database.
SQL Managed Instance scenarios
Source: SQL MI STR tests.
test_sql_managed_db_short_retentiontest_sql_managed_db_short_retention_immutabilityEnabled. Ordinary updates/false before locking; decline/no-TTY send no HTTP. Accepted lock at 7 and--yesincrease to 8 both return SETLocked, with independent GET verification. Service rejects reduction/unlocking. After dropping only its own DB, policy remains Locked8; both dropped lock-flag values fail locally, and the service rejects dropped-retention reduction.Both refreshed MI recordings passed live in West Central US on 2026-10-13 and offline playback. Earlier attempts encountered a non-JSON response and an interrupted backup-readiness wait; these are not counted as successful recordings and were superseded by complete passing captures. All MI test databases from these attempts were cleaned up, including failed-attempt databases. The seven original MI database names remain unchanged; locked dropped backups are not purged and remain for their retention period.
Offline regressions, audits and CI
systemData; required wait policy-name compatibility; IDs and help. Polling coverage includes async-only/both headers for all three resource types, InProgress → Succeeded → original policy GET, synchronous200, Location-only, no-wait request counts, Failed/Canceled without final read, final-GET403/404 propagation, and actual CLI SET JSON output. Lock-only serialization coverage does not imply live support.LockedSET results across the three locking scenarios. No STR OperationResults GET remains in these captures. No-wait SETs have no polling/final reads.git diff --check, and editor diagnostics passed. The shared STR operation module passed Pylint at 10.00/10. Full local SQL-module Pylint is not claimed because the installed runtime has compiled-only dependencies and previously reported unrelated findings.03307dd24188df4fce24d1223c51430d19eb144f: 52/52 checks completed successfully, independently verified on 2026-10-19. Those results do not validate cleanup commit48a4c88fac189658c1b07b896bd7ee376daf986c; current-head checks are pending.Hosted pipeline history: The October 13 author-trigger permission failure was subsequently superseded by successful maintainer-triggered runs. The current customization-review commit needs its own CI; no older pending/green status should be treated as its result.
Replay with
python -m unittest azure.cli.command_modules.sql.tests.latest.test_sql_str_policy azure.cli.command_modules.sql.tests.latest.test_sql_mi_str_policy azure.cli.command_modules.sql.tests.latest.test_sql_db_str_policyin a configured developer checkout.Live recording requirements and safety guards: SQL STR recording guidance.
AZURE_CLI_TEST_SQL_MI_RESOURCE_ID; irreversible locking additionally requiresAZURE_CLI_TEST_SQL_MI_ALLOW_IMMUTABILITY_LOCK=true.AZURE_CLI_TEST_SQL_SERVER_RESOURCE_ID; locking additionally requiresAZURE_CLI_TEST_SQL_DB_ALLOW_IMMUTABILITY_LOCK=true. These runs usedAZURE_CLI_TEST_SQL_DB_KEEP_DATABASES=true.AZURE_CLI_TEST_SQL_DB_RESOURCE_IDplus separate irreversible-lock authorization. RequiresEnabledand retention above one day; always retains the database.History Notes
[SQL]
az sql db str-policy: Add short-term backup immutability locking with confirmation and expose immutability status[SQL]
az sql midb short-term-retention-policy: Add immutability locking for live databases and expose status for live and dropped databasesThis checklist is used to make sure that common guidelines for a pull request are followed.