Skip to content

{Batch} Pre-announce that az batch pool reset will print the pool in the same format as az batch pool show - #34471

Open
Keyan Song (mskeyansong) wants to merge 5 commits into
Azure:devfrom
mskeyansong:keyan/batch-fix-pool-reset-output
Open

Keyan Song (mskeyansong) wants to merge 5 commits into
Azure:devfrom
mskeyansong:keyan/batch-fix-pool-reset-output

Conversation

@mskeyansong

@mskeyansong Keyan Song (mskeyansong) commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Tests Suppressions
⚠️ None ️✔️ 130/130 ️✔️ None
⚠️AzureCLI-BreakingChangeTest
⚠️batch
rule cmd_name rule_message suggest_message
⚠️ 1003 - CmdPropAdd batch pool reset cmd batch pool reset added property deprecate_info_target

Related command
az batch pool reset

Description
az batch pool reset prints the pool it reads back in a different format from az batch pool show: other key names (diskSizeGB instead of diskSizeGb), the three keys pool show hides (targetNodeCommunicationMode, currentNodeCommunicationMode, resourceTags), durations as 0:15:00 instead of PT15M, timestamps with +00:00, and unset properties as null. The two formats have differed since 2.69.0, so customers may have built automation against the current one, and printing the pool like az batch pool show is a breaking change.

This PR pre-announces that change for 2.100.0 (June 2027) in the module's _breaking_change.py, with register_output_breaking_change and the module's TARGET_VERSION, as described in How to introduce breaking changes. The output doesn't change now; the PR with the change will follow in the breaking change window. The PR also adds an example to the az batch pool reset help (a new start task on a Linux pool).

ADO: https://msazure.visualstudio.com/AzureBatch/_workitems/edit/40810359

Testing Guide

  • az batch pool reset and az batch pool reset -h show: The output will be changed in 2.100.0. 'az batch pool reset' will print the pool in the same format as 'az batch pool show'. Update scripts that read this output before 2.100.0 (June 2027); 'az batch pool show' already prints that format. az batch pool -h lists reset [Breaking Change].
  • test_batch_preannouncements checks the new entry, its version and its full message. test_batch_pool_reset_output still checks selected fields of today's output, as on dev, and now also the start of the warning on stderr.
  • Against a local fake Batch endpoint, 11 az batch pool command lines send the same requests and print the same output as on dev; only pool reset adds the warning.
  • azdev generate-breaking-change-report batch lists the new entry.
  • azdev test batch, azdev style batch, and azdev linter with CI's options (changes against dev).

History Notes
None ({Batch} title): the pre-announcement only adds a warning. The PR that changes the output in 2.100.0 will have the History Notes.


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

Copilot AI balanced review requested due to automatic review settings November 20, 2026 00:56
@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Nov 20, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution Keyan Song (@mskeyansong)! We will review the pull request and get back to you soon.

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.

🟢 Approval recommended

No active review issues are reported for the change aligning pool reset output with pool show.

No open issues 🎉

What changed in this PR

Restores consistent output between az batch pool reset and az batch pool show, addressing formatting differences introduced after the Batch Track 2 SDK migration.

Changes:

  • Applies the existing Batch output transform to pool reset, aligning key names, hidden fields, and value formatting.
  • Updates the regression test to compare reset and show output directly and assert expected formatting.
File Description
src/​azure-cli/​azure/​cli/​command_modules/​batch/​tests/​latest/​test_batch_output.py Verifies reset output matches show output and preserves expected formatting.
src/​azure-cli/​azure/​cli/​command_modules/​batch/​commands.py Registers the shared Batch output transform for pool reset.

Review effort: Balanced

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Hi Keyan Song (@mskeyansong),
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@xuming-ms

Copy link
Copy Markdown
Contributor

This format mismatch has been live since 2.69.0 (almost 2 years). Customers have likely built automation against the current shape by now, so restoring the old format is a breaking change for them and needs pre-announcement, not a direct fix.

The CLI linter asks for at least one example on commands that a PR changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
test_batch_preannouncements expects the new entry with its exact warning, and
test_batch_pool_reset_output checks that the command prints it. The output itself stays as it is
on dev.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…n the same format as `az batch pool show`

Since 2.69.0, `az batch pool reset` prints the pool in a different format from `az batch pool show`.
Customers may rely on that format, so changing it is a breaking change: this pre-announces it for
2.100.0 (June 2027) with register_output_breaking_change. The output doesn't change now.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mskeyansong
Keyan Song (mskeyansong) force-pushed the keyan/batch-fix-pool-reset-output branch from 484455e to 93b24e4 Compare November 23, 2026 04:24
@mskeyansong Keyan Song (mskeyansong) changed the title [Batch] az batch pool reset: Print the pool in the same format as az batch pool show {Batch} Pre-announce that az batch pool reset will print the pool in the same format as az batch pool show Nov 23, 2026
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

@mskeyansong

Copy link
Copy Markdown
Contributor Author

Good point, thanks. I changed this PR to a pre-announcement only: az batch pool reset now warns that its output will match az batch pool show in 2.100.0, and we'll make that change then.

…W_ERRORS is set

test_batch_pool_reset_output checks the pre-announcement warning on stderr, which the CLI leaves
out when only errors are shown.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Its start task runs /bin/sh, which a Windows pool doesn't have.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Batch az batch customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants