Skip to content

[Compute] az compute-recommender spot-placement-score: Add new command to replace original command az compute-recommender spot-placement-recommender#31858

Merged
zhoxing-ms merged 14 commits intoAzure:devfrom
Elina-L:wenxliu/RecommenderRPSpotPlacementScore20250605
Jul 28, 2025
Merged

[Compute] az compute-recommender spot-placement-score: Add new command to replace original command az compute-recommender spot-placement-recommender#31858
zhoxing-ms merged 14 commits intoAzure:devfrom
Elina-L:wenxliu/RecommenderRPSpotPlacementScore20250605

Conversation

@Elina-L
Copy link
Copy Markdown
Member

@Elina-L Elina-L commented Jul 22, 2025

Related command
az compute-recommender spot-placement-score

Description

Changing the command from az compute-recommender spot-placement-recommender to az compute-recommender spot-placement-score.

Update version to stable 2025-06-05
Azure/aaz#816

Testing Guide

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change
[Component Name 2] az command b: Add some customer-facing feature


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

Copilot AI review requested due to automatic review settings July 22, 2025 23:48
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Jul 22, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️latest
️✔️3.12
️✔️3.9

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @Elina-L,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Jul 22, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️compute
rule cmd_name rule_message suggest_message
⚠️ 1003 - CmdPropAdd compute-recommender spot-placement-recommender cmd compute-recommender spot-placement-recommender added property deprecate_info_hide
⚠️ 1003 - CmdPropAdd compute-recommender spot-placement-recommender cmd compute-recommender spot-placement-recommender added property deprecate_info_redirect
⚠️ 1003 - CmdPropAdd compute-recommender spot-placement-recommender cmd compute-recommender spot-placement-recommender added property deprecate_info_target
⚠️ 1001 - CmdAdd compute-recommender spot-placement-score cmd compute-recommender spot-placement-score added

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the Azure CLI compute-recommender module to change the command from az compute-recommender spot-placement-recommender to az compute-recommender spot-placement-score and updates the API version to stable 2025-06-05.

  • Adds a new SpotPlacementScore command class to replace the existing spot placement recommender functionality
  • Updates the command name to better reflect its purpose of generating placement scores
  • Upgrades to use the stable 2025-06-05 API version

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
_spot_placement_score.py New command implementation for spot placement score generation with updated API version
__init__.py Import statement to expose the new SpotPlacementScore command

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Jul 22, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@yonzhan yonzhan requested review from yanzhudd and zhoxing-ms July 23, 2025 02:57
@Elina-L Elina-L changed the title [Compute] Spot Placement Score 2025-06-05 Stable version [Compute] az compute-recommender spot-placement-score Add Spot Placement Score 2025-06-05 Stable version command Jul 23, 2025
@Elina-L Elina-L changed the title [Compute] az compute-recommender spot-placement-score Add Spot Placement Score 2025-06-05 Stable version command [Compute] az compute-recommender spot-placement-score: Add Spot Placement Score 2025-06-05 Stable version command Jul 23, 2025
@Elina-L Elina-L changed the title [Compute] az compute-recommender spot-placement-score: Add Spot Placement Score 2025-06-05 Stable version command [Compute] az compute-recommender spot-placement-score Add Spot Placement Score 2025-06-05 Stable version command Jul 23, 2025
@Elina-L Elina-L changed the title [Compute] az compute-recommender spot-placement-score Add Spot Placement Score 2025-06-05 Stable version command [Compute] az compute-recommender spot-placement-score: Add Spot Placement Score 2025-06-05 Stable version command Jul 23, 2025
@azure-pipelines
Copy link
Copy Markdown

Commenter does not have sufficient privileges for PR 31858 in repo Azure/azure-cli

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Jul 24, 2025

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@Elina-L Elina-L force-pushed the wenxliu/RecommenderRPSpotPlacementScore20250605 branch from 8dc4cf0 to efcd3f8 Compare July 24, 2025 01:03
@zhoxing-ms
Copy link
Copy Markdown
Contributor

Changing the command from az compute-recommender spot-placement-recommender to az compute-recommender spot-placement-score.

May I ask why you are not considering upgrading the api-version of the original command and instead creating a new command?

@Elina-L
Copy link
Copy Markdown
Member Author

Elina-L commented Jul 24, 2025

Changing the command from az compute-recommender spot-placement-recommender to az compute-recommender spot-placement-score.

May I ask why you are not considering upgrading the api-version of the original command and instead creating a new command?

Hi Xing, the API used to be spotplacementrecommender, but our team renamed the API to spotplacementscore. I've added the new "score" command to align with the API's name and also the API path. We plan to deprecate the "recommender" version of the command in the future, but our number one priority right now is to merge this PR in time for August release.

However, if retaining the same "spot placement recommender" name and upgrading the API version of "spot placement recommender" would help speed up the PR review, I can do that for this PR, then deprecate the command and replace it with "spot-placement-score" in a future PR instead.

@zhoxing-ms
Copy link
Copy Markdown
Contributor

Thank you for your detailed explanation. I think you can upgrade the api-version only for az compute-recommender spot-placement-score, but you can now use deprecate_info=self.deprecate(redirect='az compute-recommender spot-placement-score', hide=True) to hide and mark the az compute-recommender spot-placement-recommender as deprecated and redirect it to az compute-recommender spot-placement-score

@Elina-L
Copy link
Copy Markdown
Member Author

Elina-L commented Jul 24, 2025

deprecate_info=self.deprecate(redirect='az compute-recommender spot-placement-score', hide=True)

Hi Xing, I'm trying to understand how to implement the command you shared:

deprecate_info=self.deprecate(redirect='az compute-recommender spot-placement-score', hide=True)

Is there any wiki or example I can reference? I'm checking in the code and it is referenced within "load_command_table" methods, in the commands.py, should I do something similar?

image image

…ment-recommender with spot-placement-score

Adding deprecate_info=self.deprecate(redirect to deprecate spot-placement-recommender with spot-placement-score, and passing

Adding deprecate_info=self.deprecate(redirect to deprecate spot-placement-recommender with spot-placement-score, and passing
@Elina-L Elina-L force-pushed the wenxliu/RecommenderRPSpotPlacementScore20250605 branch from 38ceb02 to 074489c Compare July 24, 2025 08:38
@Elina-L
Copy link
Copy Markdown
Member Author

Elina-L commented Jul 24, 2025

deprecate_info=self.deprecate(redirect='az compute-recommender spot-placement-score', hide=True)

Updated the code in compute-recommender/commands.py:

image

@zhoxing-ms zhoxing-ms changed the title [Compute] az compute-recommender spot-placement-score: Add Spot Placement Score 2025-06-05 Stable version command [Compute] az compute-recommender spot-placement-score: Add new command to replace original command az compute-recommender spot-placement-recommender Jul 24, 2025
zhoxing-ms
zhoxing-ms previously approved these changes Jul 24, 2025
@zhoxing-ms
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@Elina-L
Copy link
Copy Markdown
Member Author

Elina-L commented Jul 25, 2025

Hi Xing, after reviewing the code, again, is this section correct?

image

On the third line in this image, should it be 'az compute-recommender spot-placement-recommender' instead?

@Elina-L
Copy link
Copy Markdown
Member Author

Elina-L commented Jul 28, 2025

I was able to fix the deprecation issue by adding _breaking_change.py file according to this wiki: azure-cli/doc/how_to_introduce_breaking_changes.md at dev · Azure/azure-cli

It's working after validation:
image

Running the command via the old name is still successful:
image

Running new command is also successful
image

@zhoxing-ms
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

@zhoxing-ms zhoxing-ms merged commit 981975a into Azure:dev Jul 28, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants