-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Container app may return null in the dapr object, which cli should handle gracefully #5782
Conversation
Thank you for your contribution calleo! We will review the pull request and get back to you soon. |
Container app |
@Juliehzl Could you please review this once you get a chance ? |
@@ -2366,7 +2366,7 @@ def enable_dapr(cmd, name, resource_group_name, | |||
if 'configuration' not in containerapp_def['properties']: | |||
containerapp_def['properties']['configuration'] = {} | |||
|
|||
if 'dapr' not in containerapp_def['properties']['configuration']: | |||
if not containerapp_def['properties']['configuration'].get('dapr', None): | |||
containerapp_def['properties']['configuration']['dapr'] = {} |
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 test in https://github.com/Azure/azure-cli-extensions/blob/main/src/containerapp/azext_containerapp/tests/latest/test_containerapp_commands.py#L583 and follow the pattern in existing test
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.
I have added an additional e2e test for this specific scenario. Is there any documentation explaining how to generate the recordings (possibly for a single test). I had to fiddle with scripts/ci/test_source.py to only run the new test method and store the recording. There must be an easier way, but this worked 🙂
@Juliehzl When you get another chance, can you take another look at this PR?
@microsoft-github-policy-service agree |
f1352b0
to
177b5e6
Compare
'dapr enable' won't crash. * This is the case when container app is created using 'containerapp up' * Extend the guard to handle nulls
@calleo could you help update history.rst with the release note of your fix |
Thanks @Juliehzl . @calleo I have updated the Could you please approve this ? |
Thanks! 🙏 Merged it 🤗 |
Update HISTORY.rst
This fixes #5781
Needs some guidance on how to add tests for this 🙏
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az containerapp dapr enable
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally?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.The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify
src/index.json
.