-
Notifications
You must be signed in to change notification settings - Fork 1.5k
containerapp - Add --source and --repo to containerapp create/update #6574
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 - Add --source and --repo to containerapp create/update #6574
Conversation
…to snehapar/Add-source-and-repo-to-create
…dd-source-to-containerapp-update
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| containerapp create | cmd containerapp create added parameter branch |
||
| containerapp create | cmd containerapp create added parameter context_path |
||
| containerapp create | cmd containerapp create added parameter repo |
||
| containerapp create | cmd containerapp create added parameter service_principal_client_id |
||
| containerapp create | cmd containerapp create added parameter service_principal_client_secret |
||
| containerapp create | cmd containerapp create added parameter service_principal_tenant_id |
||
| containerapp create | cmd containerapp create added parameter source |
||
| containerapp create | cmd containerapp create added parameter token |
||
| containerapp update | cmd containerapp update added parameter source |
|
Hi @snehapar9, |
|
Hi @snehapar9, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
LGTM. |
| self.set_up_source() | ||
|
|
||
| def set_up_source(self): | ||
| if self.get_argument_source(): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
pls update history.rst for release notes |
| 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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
|
Please resolve zunli's latest comment, otherwise LGTM. |
Committed test changes to delete containerapp and environment at the end of the tests. |
|
Hi @zhoxing-ms |
| TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) | ||
|
|
||
| class ContainerAppCreateTest(ScenarioTest): | ||
| @live_only() |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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} " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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} " |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally?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.jsonautomatically.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.