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

Container app may return null in the dapr object, which cli should handle gracefully #5782

Merged
merged 3 commits into from
Feb 2, 2023

Conversation

calleo
Copy link
Contributor

@calleo calleo commented Jan 17, 2023

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

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run 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.

@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Jan 17, 2023
@ghost
Copy link

ghost commented Jan 17, 2023

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

@ghost ghost requested a review from yonzhan January 17, 2023 20:30
@ghost ghost added the Auto-Assign Auto assign by bot label Jan 17, 2023
@ghost ghost requested a review from wangzelin007 January 17, 2023 20:30
@ghost ghost assigned zhoxing-ms Jan 17, 2023
@ghost ghost added this to the Jan 2023 (2023-02-07) milestone Jan 17, 2023
@ghost ghost added the ContainerApp label Jan 17, 2023
@ghost ghost requested review from zhoxing-ms and jsntcy January 17, 2023 20:30
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 17, 2023

Container app

@navba-MSFT navba-MSFT requested a review from Juliehzl January 18, 2023 06:54
@navba-MSFT
Copy link
Contributor

@Juliehzl Could you please review this once you get a chance ?

src/containerapp/azext_containerapp/custom.py Outdated Show resolved Hide resolved
@@ -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'] = {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@calleo calleo Jan 22, 2023

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?

@calleo
Copy link
Contributor Author

calleo commented Jan 18, 2023

@microsoft-github-policy-service agree

@calleo calleo force-pushed the main branch 6 times, most recently from f1352b0 to 177b5e6 Compare January 22, 2023 16:58
'dapr enable' won't crash.

* This is the case when container app is created using 'containerapp up'
* Extend the guard to handle nulls
@Juliehzl
Copy link
Contributor

Juliehzl commented Feb 1, 2023

@calleo could you help update history.rst with the release note of your fix

@navba-MSFT
Copy link
Contributor

@calleo could you help update history.rst with the release note of your fix

Thanks @Juliehzl .

@calleo I have updated the history.rst for your commit. calleo@7243993 .

Could you please approve this ?

@calleo
Copy link
Contributor Author

calleo commented Feb 1, 2023

@calleo could you help update history.rst with the release note of your fix

Thanks @Juliehzl .

@calleo I have updated the history.rst for your commit. calleo@7243993 .

Could you please approve this ?

Thanks! 🙏 Merged it 🤗

@zhoxing-ms zhoxing-ms merged commit a66158a into Azure:main Feb 2, 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 customer-reported Issues that are reported by GitHub users external to the Azure organization.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabling dapr on an existing container app fails consistently
5 participants