Skip to content

[containerapp] Revert remove deprecate command az containerapp env workload-profile set#6977

Merged
zhoxing-ms merged 3 commits intoAzure:mainfrom
Greedygre:xinyu/wp_set_command_revert_remove
Nov 10, 2023
Merged

[containerapp] Revert remove deprecate command az containerapp env workload-profile set#6977
zhoxing-ms merged 3 commits intoAzure:mainfrom
Greedygre:xinyu/wp_set_command_revert_remove

Conversation

@Greedygre
Copy link
Copy Markdown
Contributor


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

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

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

azure-client-tools-bot-prd bot commented Nov 10, 2023

⚠️Azure CLI Extensions Breaking Change Test
⚠️containerapp
rule cmd_name rule_message suggest_message
⚠️ 1001 - CmdAdd containerapp env workload-profile set cmd containerapp env workload-profile set added

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

Hi @Greedygre,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

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

Hi @Greedygre,
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

yonzhan commented Nov 10, 2023

containerapp


helps['containerapp env workload-profile set'] = """
type: command
short-summary: Create or update an existing workload profile in a Container Apps environment
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.

should you add deprecation_info here?

Copy link
Copy Markdown
Contributor Author

@Greedygre Greedygre Nov 10, 2023

Choose a reason for hiding this comment

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

Add in the deprecate info for command setting:
image

type: command
short-summary: Create or update an existing workload profile in a Container Apps environment
examples:
- name: Create or update an existing workload profile in a Container Apps environment
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.

have to be existing?

Copy link
Copy Markdown
Contributor Author

@Greedygre Greedygre Nov 10, 2023

Choose a reason for hiding this comment

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

update an existing workload profile, create a new one is ok too.

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.

I mean existing is not required in description

g.custom_command('create', 'create_containerapps_from_compose')

with self.command_group('containerapp env workload-profile') as g:
g.custom_command('set', 'set_workload_profile', deprecate_info=g.deprecate(hide=True))
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.

could you add redirect

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can not add redirect, because set = update + add:
command set support to create a new workload profile or update an existing one.
But command add only support add a new one, if the added name has been used, throw validate error;
command update only support update an existing one, if not existing, throw error.

return containerapps_from_compose


def set_workload_profile(cmd, resource_group_name, env_name, workload_profile_name, workload_profile_type=None, min_nodes=None, max_nodes=None):
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.

do we have test for the command?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Add test in test_containerapp_env_workload_profiles_e2e_no_waits

@Greedygre
Copy link
Copy Markdown
Contributor Author

Hi @zhoxing-ms
Can you help to review and merge this PR? Thanks.

@zhoxing-ms zhoxing-ms merged commit b348d16 into Azure:main Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot ContainerApp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants