Skip to content

Conversation

@snehapar9
Copy link
Contributor

@snehapar9 snehapar9 commented Jul 28, 2023


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?

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

azure-client-tools-bot-prd bot commented Jul 28, 2023

⚠️Azure CLI Extensions Breaking Change Test
⚠️containerapp
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd containerapp create cmd containerapp create added parameter branch
⚠️ 1006 - ParaAdd containerapp create cmd containerapp create added parameter context_path
⚠️ 1006 - ParaAdd containerapp create cmd containerapp create added parameter repo
⚠️ 1006 - ParaAdd containerapp create cmd containerapp create added parameter service_principal_client_id
⚠️ 1006 - ParaAdd containerapp create cmd containerapp create added parameter service_principal_client_secret
⚠️ 1006 - ParaAdd containerapp create cmd containerapp create added parameter service_principal_tenant_id
⚠️ 1006 - ParaAdd containerapp create cmd containerapp create added parameter source
⚠️ 1006 - ParaAdd containerapp create cmd containerapp create added parameter token
⚠️ 1006 - ParaAdd containerapp update cmd containerapp update added parameter source

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

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

Hi @snehapar9,
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.

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 28, 2023

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

@Greedygre
Copy link
Contributor

LGTM.
@Juliehzl Could you please have a look?

self.set_up_source()

def set_up_source(self):
if self.get_argument_source():
Copy link
Contributor

Choose a reason for hiding this comment

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

does your feature only work for managed environment? If yes, please add validation for --environment-type.
For more information, @Greedygre can help.

Copy link
Contributor

@Greedygre Greedygre Sep 8, 2023

Choose a reason for hiding this comment

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

This feature only work for managed environment. Because it use a lot of class from up, which only support managed environment.
@snehapar9
please add validation for --environment-type, if environement-type value is connected, or managed_env value is a connected environment reource id, should not use --repo and --source.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

no_wait=False,
secret_volume_mount=None):
secret_volume_mount=None,
source=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

In this PR, you also want to support --source for update 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.

yes, we are adding support for --source as well for update in this PR.

@Juliehzl
Copy link
Contributor

Juliehzl commented Sep 8, 2023

pls update history.rst for release notes

@snehapar9 snehapar9 marked this pull request as draft September 11, 2023 01:57
@snehapar9 snehapar9 marked this pull request as ready for review September 11, 2023 02:10
JMESPathCheck('properties.provisioningState', 'Succeeded'),
]).get_output_in_json()
test_cls.assertEqual(app["properties"]["template"]["containers"][0]["image"].split(":")[0], image_name)
test_cls.assertNotEqual(app["properties"]["template"]["containers"][0]["image"], old_image)
Copy link
Contributor

Choose a reason for hiding this comment

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

add container app delete and env delete commands to make sure all resources deleted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@Greedygre
Copy link
Contributor

Please resolve zunli's latest comment, otherwise LGTM.

@snehapar9
Copy link
Contributor Author

Please resolve zunli's latest comment, otherwise LGTM.

Committed test changes to delete containerapp and environment at the end of the tests.

@Greedygre
Copy link
Contributor

Hi @zhoxing-ms
This PR has been reviewed by me and zunli, could you help to review and merge? Thanks.

TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))

class ContainerAppCreateTest(ScenarioTest):
@live_only()
Copy link
Contributor

Choose a reason for hiding this comment

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

May I ask why do you mark these tests as @live_only()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These tests require a docker push operation to push the image built as part of the test to the container registry and would not execute from the CI pipeline since docker is not installed in the CI.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, please add comments in the test to explain this reason

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

parsed = urlparse(registry_server)
registry_name = (parsed.netloc if parsed.scheme else parsed.path).split(".")[0]
if registry_name and len(registry_name) > MAXIMUM_SECRET_LENGTH:
raise ValidationError(f"--registry-server ACR name must be less than {MAXIMUM_SECRET_LENGTH} "
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
raise ValidationError(f"--registry-server ACR name must be less than {MAXIMUM_SECRET_LENGTH} "
raise InvalidArgumentValueError(f"--registry-server ACR name must be less than {MAXIMUM_SECRET_LENGTH} "

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, ValidationError is acceptable, but personally, I think InvalidArgumentValueError is a more accurate usage.
If you want to maintain consistency with _validate_up_args, then I think it's also OK. Or modify them all to InvalidArgumentValueError

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for taking a look! Just going to keep it as-is so we are consistent with this validation in the up command.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK

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.

7 participants