[Billing] Fix #34082: az billing product list: Handle non-ISO product dates - #34094
Aditya Pujara (a0x1ab) wants to merge 2 commits into
Conversation
…product dates AI-generated by X Engineering Agent via Azure AI Foundry. Foundry-Job: 810b3bec61050822e3021f8e85bea0cc4013ed608e141c03068fd347f933532b
|
Billing |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
Correct the deserializer call before approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Fixes az billing product list handling of non-ISO product dates.
Changes:
- Normalizes product dates before SDK deserialization.
- Adds regression coverage for date formats, pagination, errors, and routing.
File summaries
| File | Summary |
|---|---|
src/azure-cli/azure/cli/command_modules/billing/manual/custom.py |
Implements date normalization. Critical: the deserializer is called with incorrect arguments, causing a TypeError for successful responses. |
src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py |
Adds focused regression coverage. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| return | ||
|
|
||
| encoding = response.context.get('response_encoding') | ||
| content = ContentDecodePolicy.deserialize_from_http_generics(response.http_response, encoding) |
Live test results —
|
Live test results —
|
There was a problem hiding this comment.
Summary
No blocking source issues found at 8d04bcc0205553e296ca8f677fd1515279b094d5.
The handwritten billing product-list adapter normalizes service MM/DD/YYYY values in purchaseDate, endDate, and lastChargeDate before SDK deserialization. It retains lazy pagination, existing routing and filters across all four listing scopes, and unchanged product-show behavior. No generated files were modified.
The pinned Azure Core pipeline construction and response-policy ordering support running the raw hook before content decoding. The added regressions use the actual Billing SDK with a controlled transport and exercise CLI JSON output across pages, malformed dates, encoded responses, and later-page error propagation rather than only mocked deserialization.
Upstream CI
All 50 checks passed for the reviewed head; none failed or remained pending in the captured snapshot.
Test validation
- Live test: Passed. Workflow run
- Regression coverage: Present for
billing: 1 focused test file(s) changed.
Risk assessment
29/100 · Medium · High confidence
The Medium rating is driven by public CLI behavior, failure-handling behavior.
- Change scope: 2 changed files, 465 changed lines (
+465/-0), including 1 production file. - Affected components:
billing - Risk drivers: public CLI behavior (+18); failure-handling behavior (+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 recommended for
billingbefore merge.
🤖 PR Validation — ️✔️ All clear
Related command
az billing product listDescription
Fixes #34082.
Implemented by X Engineering Agent using Azure AI Foundry. This is an AI-generated change, published by the configured operator.
Testing Guide
az billing product list.src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py.History Notes
[Billing]
az billing product list: Handle non-ISO product datesThis 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.