Repository navigation
[Network] Fix #27579: az network dns zone export: Fix export of empty TXT record sets - #34088
Aditya Pujara (a0x1ab) wants to merge 40 commits into
Conversation
…f empty TXT record sets AI-generated by X Engineering Agent via Azure AI Foundry. Foundry-Job: 5acb833b4854a53d4787b397556ad96a6e6708ffb41eabf63a5392f72a400c69
|
Network |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟢 Approval recommended
The reviewed changes are fully covered and no blocking issues were identified.
Pull request overview
Fixes az network dns zone export for empty TXT record sets and preserves them during import.
Changes:
- Emits
TXT ""for empty TXT record sets. - Preserves empty TXT values during parsing.
- Adds export, import, and round-trip regression tests.
File summaries
| File | Changes |
|---|---|
src/azure-cli/azure/cli/command_modules/network/zone_file/parse_zone_file.py |
Preserves empty TXT fragments. |
src/azure-cli/azure/cli/command_modules/network/tests/latest/test_dns_commands.py |
Adds TXT export/import regression coverage. |
src/azure-cli/azure/cli/command_modules/network/custom.py |
Emits empty TXT values during export. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
🔔 Routing this PR to @Azure/act-quality-productivity-squad. |
|
@Azure/x-engineering-agent The remediation execution for the current agent review was canceled by the agent deployment before model work began. Retry the existing live-test remediation against the unchanged current head without expanding its scope. |
|
Automated processing requires maintainer follow-up for this request. |
|
Automated processing requires maintainer follow-up for this request. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Live test results —
|
There was a problem hiding this comment.
Review
Upstream CI and the Agent live run passed at 9bb49410164281e36dcbfea9eb2db2f31199a13d. No code defects were confirmed by the seven review tools and changed-line inspection. Required-scenario coverage still needs owning-squad confirmation before human approval; this is not an all-clear.
Upstream CI
All 50/50 checks passed; the current-head snapshot last completed at 2026-10-09T11:02:07Z.
Test validation
- Live test: Passed. Workflow run
- Regression coverage: For
network: 1 focused test 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.
Manual scenario inspection: The body-linked issue #27579 reports KeyError: 'txt' during zone-file serialization. custom.py now supplies the missing TXT field for an empty record set. parse_zone_file.py preserves empty TXT strings without applying NAPTR's EMPTY convention.
The submitted DnsZoneExportTest cases in src/azure-cli/azure/cli/command_modules/network/tests/latest/test_dns_commands.py assert missing/null/empty TXT collections, exact console and optional-file output, valid/multiple/long values, export-import-reexport preservation, and propagation of malformed nonempty records. They mock the AAZ boundary and exercise the actual serializer/parser. This is substantive author-supplied deterministic evidence, distinct from the Agent workflow's passing result; neither the changed filename nor the workflow summary alone maps the reported service conditions to an executed scenario.
Coverage confirmation: Before approval, verify the required preconditions and output against DnsZoneExportTest.test_export_empty_txt_collections and DnsZoneExportTest.test_export_import_and_reexport_txt: quoted empty TXT output, original record name/TTL, identical console/file content, and preserved nonempty values. If an additional service-shaped condition from the report is uncovered, add it in that same test file. Rerun the authorized live-test workflow scoped to test_dns_commands after any test update.
Recording impact: No recording changed. The production edits affect local zone-file output/parsing, not service endpoints or HTTP request fields. If a service-backed scenario is added, refresh its cassette under src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/; an existing unrelated cassette is not evidence that the empty-TXT conditions were exercised.
Risk assessment
45/100 · Medium · High confidence
The Medium rating is driven by security-sensitive behavior, public CLI behavior.
- Change scope: 3 changed files, 309 changed lines (
+309/-0), including 2 production files. - Affected components:
network - Risk drivers: security-sensitive behavior (+28); 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 required for
networkbefore merge.
Posted by x-engineering-agent (Reviewer)
🤖 PR Validation — ️✔️ All clear
Related command
az network dns zone exportDescription
Fixes #27579.
Correct DNS zone export so empty TXT record sets serialize without indexing a nonexistent value.
Expected behavior: exporting a zone containing an empty TXT record set must not crash, while retaining valid TXT data and the existing zone-file conventions. Both console output and optional file output should work.
Testing Guide
az network dns zone export --resource-group <resource-group> --name <dns-zone> --file-name zone.txt.src/azure-cli/azure/cli/command_modules/network/tests/latest/test_dns_commands.py.History Notes
[Network]
az network dns zone export: Fix export of empty TXT record setsThis 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.