[amg] Azure managed grafana options for notification channels#5033
[amg] Azure managed grafana options for notification channels#5033kairu-ms merged 15 commits intoAzure:mainfrom
Conversation
|
Thank you for your contribution michelletaal-shell! We will review the pull request and get back to you soon. |
|
amg |
|
@kairu-ms, can you please review this PR and merge appropriately? |
src/amg/azext_amg/commands.py
Outdated
|
|
||
| with self.command_group('grafana notification-channel') as g: | ||
| g.custom_command('list', 'list_notification_channels') | ||
| g.custom_command('list-short', 'list_notification_channels_short') |
There was a problem hiding this comment.
I suggest we merge this with list command and expose an argument of --short
There was a problem hiding this comment.
Valid suggestion. Applied in commit [REV1]
src/amg/azext_amg/_params.py
Outdated
|
|
||
| with self.argument_context("grafana notification-channel") as c: | ||
| c.argument("notification_channel", help="id, uid which can identify a data source. CLI will search in the order of id, and uid, till finds a match") | ||
| c.argument("definition", help="json string with notification channel definition, or a path to a file with such content") |
There was a problem hiding this comment.
You can use type=validate_file_or_dict for json string or json file.
azure-cli-extensions/src/datafactory/azext_datafactory/generated/_params.py
Lines 395 to 400 in 81dd55b
There was a problem hiding this comment.
Currently, none of the arguments have type validation in place. Would you like me to expand my scope slightly and add type validation to all pre-existing commands as well?
There was a problem hiding this comment.
Yes, please. BTW, we usually don't need to specify type for most simple arguments.
There was a problem hiding this comment.
Applied in commits [REV2]
Type validation of the argument was added, leading to improved error messaging but also to conflict with the _try_load_file_content function currently executing type validation. This function was therefore omitted for all cli arguments except 'az grafana dashboard import' as this command takes int, str and json objects.
|
Could you add tests for your changes? |
|
@michelletaal-shell your PR looks solid we would like to merge. Do you need any help on adding the test? Assume you have followed the dev doc, you can add a test in Or I can push the test change to your branch if you prefer. |
Thank you for accepting my pr. I've been working on writing some tests, but have been otherwise occupied the last few days. I've been having issues with the tests as automatically setting up the Managed Identity requires Azure permissions I don't have in my professional subscription. I'll be trying to work my way around that later this week. I suspect this is why there are also no tests for the other API-call functionalities. Once I get over that hump, the actual tests should be in place rather quickly. |
|
@michelletaal-shell, sounds good. If the permission is hard to workaround, |
|
@michelletaal-shell, let you know that we are on the way to move to Grafana 9.0 with unified alerting. This will light up the contact-point which is similar with notification channel. I suggest we hold on to this PR and I will work with you in a couple of weeks to migrate this PR to support |
|
@yugangw-msft, thank you for the update. I'm nearly done with setting up tests for all features and will commit those this week. I'm definitely willing to work with you to support contact point. Just let me know when you guys are ready to move forward. |
Pull from main
…/michelletaal-shell/azure-cli-extensions into feature/amg-notification-channel
|
@yugangw-msft does this PR ready for review and merge? |
|
@kairu-ms, please merge. |
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.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.