Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Nov 10, 2023

Conversation

Greedygre
Copy link
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.

Copy link

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

Copy link

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.

Copy link

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

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 10, 2023

containerapp

@@ -572,6 +572,15 @@
az containerapp auth update -g myResourceGroup --name MyContainerapp --proxy-convention Standard
"""

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

@@ -109,6 +109,9 @@ def load_command_table(self, _):
with self.command_group('containerapp compose') as g:
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
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
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.

@@ -1088,6 +1088,10 @@ def create_containerapps_from_compose(cmd, # pylint: disable=R0914
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
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
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
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
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
14 checks passed
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.

None yet

4 participants