Skip to content

[Billing] Fix #34082: az billing product list: Handle non-ISO product dates - #34094

Open
Aditya Pujara (a0x1ab) wants to merge 2 commits into
Azure:devfrom
a0x1ab:agent-assist/azure-azure-cli-issue-34082-810b3bec6105
Open

Aditya Pujara (a0x1ab) wants to merge 2 commits into
Azure:devfrom
a0x1ab:agent-assist/azure-azure-cli-issue-34082-810b3bec6105

Conversation

@a0x1ab

@a0x1ab Aditya Pujara (a0x1ab) commented Sep 16, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests
️✔️ None ️✔️ 130/130

Related command

az billing product list

Description

Fixes #34082.

Implemented by X Engineering Agent using Azure AI Foundry. This is an AI-generated change, published by the configured operator.

Testing Guide

  • Run az billing product list.
  • Focused regression coverage: src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py.
  • Repository CI and the authorized live-test workflow validate the published revision.

History Notes

[Billing] az billing product list: Handle non-ISO product dates


This checklist is used to make sure that common guidelines for a pull request are followed.

…product dates

AI-generated by X Engineering Agent via Azure AI Foundry.
Foundry-Job: 810b3bec61050822e3021f8e85bea0cc4013ed608e141c03068fd347f933532b
@yonzhan

Copy link
Copy Markdown
Collaborator

Billing

@x-engineering-agent
x-engineering-agent Bot marked this pull request as ready for review September 16, 2026 22:56
@x-engineering-agent
x-engineering-agent Bot requested review from a team as code owners September 16, 2026 22:56
Copilot AI lite review requested due to automatic review settings September 16, 2026 22:56
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)
@x-engineering-agent

Copy link
Copy Markdown
Contributor

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: billing.test_billing_product_dates (module)
PR head ref: agent-assist/azure-azure-cli-issue-34082-810b3bec6105
PR head sha: 14e383f6980312d29a56d205d44610eeaed973f7
PR base ref: dev
New test files in PR: true

Changed test files run
src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py

New test files
src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/35161742422

Last 80 lines of azdev output

=============
| Run Tests |
=============


test index found: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: billing.test_billing_product_dates

WARNING: RUNNING TESTS LIVE
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.14, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.7.5, xdist-3.8.0
collecting ... collected 18 items

azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_empty_list PASSED [  5%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_empty_page_still_follows_next_link PASSED [ 11%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_encoded_response_and_service_error PASSED [ 16%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_http_errors_propagate_on_first_and_later_pages PASSED [ 22%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_invalid_date_on_later_page_propagates PASSED [ 27%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_invalid_dates_are_not_guessed_or_discarded PASSED [ 33%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_later_http_error_does_not_emit_partial_cli_json PASSED [ 38%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_later_invalid_date_does_not_emit_partial_cli_json PASSED [ 44%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_later_transport_error_propagates PASSED [ 50%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_malformed_json_on_later_page_propagates PASSED [ 55%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_mixed_iso_offsets_and_fractional_seconds_remain_unchanged PASSED [ 61%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_month_day_semantics_for_each_product_date_field PASSED [ 66%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_null_and_missing_optional_dates PASSED [ 72%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_product_list_uses_handwritten_override PASSED [ 77%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_product_show_and_shared_deserializer_are_unaffected PASSED [ 83%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_profile_command_serializes_all_pages_and_preserves_fields PASSED [ 88%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_registered_list_preserves_routing_and_filters PASSED [ 94%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_unadapted_sdk_reproduces_lazy_deserialization_failure PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 18 passed in 4.20s ==============================

Posted by the X Engineering Agent live-test workflow.

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Live test results — azdev test --live --series (changed test files only)

PASS

Selectors: billing.test_billing_product_dates (module)
PR head ref: agent-assist/azure-azure-cli-issue-34082-810b3bec6105
PR head sha: 8d04bcc0205553e296ca8f677fd1515279b094d5
PR base ref: dev
New test files in PR: true

Changed test files run
src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py

New test files
src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py

Workflow run: https://github.com/Azure/issue-sentinel/actions/runs/35164762496

Last 80 lines of azdev output

=============
| Run Tests |
=============


test index found: /home/runner/.azdev/env_config/home/runner/work/issue-sentinel/issue-sentinel/.venv/test_index/latest.json

Test on modules: billing.test_billing_product_dates

WARNING: RUNNING TESTS LIVE
The tests are set to run against current profile "latest"
============================= test session starts ==============================
platform linux -- Python 3.12.14, pytest-9.1.1, pluggy-1.6.0 -- /home/runner/work/issue-sentinel/issue-sentinel/.venv/bin/python
cachedir: .pytest_cache
rootdir: /home/runner/work/issue-sentinel/issue-sentinel/azure-cli/src/azure-cli
plugins: forked-1.7.5, xdist-3.8.0
collecting ... collected 18 items

azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_empty_list PASSED [  5%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_empty_page_still_follows_next_link PASSED [ 11%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_encoded_response_and_service_error PASSED [ 16%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_http_errors_propagate_on_first_and_later_pages PASSED [ 22%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_invalid_date_on_later_page_propagates PASSED [ 27%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_invalid_dates_are_not_guessed_or_discarded PASSED [ 33%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_later_http_error_does_not_emit_partial_cli_json PASSED [ 38%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_later_invalid_date_does_not_emit_partial_cli_json PASSED [ 44%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_later_transport_error_propagates PASSED [ 50%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_malformed_json_on_later_page_propagates PASSED [ 55%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_mixed_iso_offsets_and_fractional_seconds_remain_unchanged PASSED [ 61%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_month_day_semantics_for_each_product_date_field PASSED [ 66%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_null_and_missing_optional_dates PASSED [ 72%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_product_list_uses_handwritten_override PASSED [ 77%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_product_show_and_shared_deserializer_are_unaffected PASSED [ 83%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_profile_command_serializes_all_pages_and_preserves_fields PASSED [ 88%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_registered_list_preserves_routing_and_filters PASSED [ 94%]
azure-cli/src/azure-cli/azure/cli/command_modules/billing/tests/latest/test_billing_product_dates.py::BillingProductDateTests::test_unadapted_sdk_reproduces_lazy_deserialization_failure PASSED [100%]

- generated xml file: /home/runner/work/issue-sentinel/issue-sentinel/test-output/results.xml -
============================== 18 passed in 2.79s ==============================

Posted by the X Engineering Agent live-test workflow.

@x-engineering-agent x-engineering-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aditya Pujara (@a0x1ab)

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 billing before merge.

@x-engineering-agent x-engineering-agent Bot added X Engineering Agent Reviewed Pull request reviewed by X Engineering Agent and removed Request X Engineering Agent Request X Engineering Agent testing and review labels Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

X Engineering Agent Reviewed Pull request reviewed by X Engineering Agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Billing product list fails on date format returned

4 participants