From fa81be7bbace1ca3cc71d633223b49a9b0fab9e5 Mon Sep 17 00:00:00 2001 From: AllyW Date: Thu, 10 Apr 2025 15:51:41 +0800 Subject: [PATCH 1/4] add linter example validate task --- .github/actions/env-setup/action.yml | 2 +- .github/workflows/AzdevLinter.yml | 6 +++++- .github/workflows/AzdevStyle.yml | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/actions/env-setup/action.yml b/.github/actions/env-setup/action.yml index eb943ffa6ef..241615503e9 100644 --- a/.github/actions/env-setup/action.yml +++ b/.github/actions/env-setup/action.yml @@ -10,7 +10,7 @@ runs: label: ${{ toJSON(github.event.label) }} shell: bash run: | - echo version cal job start + echo start azdev env setup - name: Checkout CLI extension repo uses: actions/checkout@v4 with: diff --git a/.github/workflows/AzdevLinter.yml b/.github/workflows/AzdevLinter.yml index c297df3cbae..9f6b72d0a92 100644 --- a/.github/workflows/AzdevLinter.yml +++ b/.github/workflows/AzdevLinter.yml @@ -89,5 +89,9 @@ jobs: for mod in ${changed_module_list[@]} do echo changed module: "${mod}" - azdev extension add "${mod}" && azdev linter "${mod}" --min-severity medium --repo ./ --src "$diff_branch" --tgt "$merge_base" + azdev extension add "${mod}" + # ado linter task + azdev linter "${mod}" --min-severity medium + # linter task that needs git commit info + azdev linter "${mod}" --repo ./ --src "$diff_branch" --tgt "$merge_base" --rules missing_command_example done \ No newline at end of file diff --git a/.github/workflows/AzdevStyle.yml b/.github/workflows/AzdevStyle.yml index 2cea8c37efc..fcea306e8ac 100644 --- a/.github/workflows/AzdevStyle.yml +++ b/.github/workflows/AzdevStyle.yml @@ -90,5 +90,5 @@ jobs: do echo changed module: "${mod}" azdev extension add "${mod}" - azdev style "${mod}" + azdev style "${mod}" done \ No newline at end of file From f8d8abbe545720f18d1016168ef150f8d2d2342a Mon Sep 17 00:00:00 2001 From: AllyW Date: Thu, 10 Apr 2025 16:05:58 +0800 Subject: [PATCH 2/4] add invalid html tag --- src/application-insights/azext_applicationinsights/_help.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application-insights/azext_applicationinsights/_help.py b/src/application-insights/azext_applicationinsights/_help.py index b1a4d4acaa2..4f26e885694 100644 --- a/src/application-insights/azext_applicationinsights/_help.py +++ b/src/application-insights/azext_applicationinsights/_help.py @@ -9,7 +9,7 @@ helps['monitor app-insights'] = """ type: group - short-summary: Commands for querying data in Application Insights applications. + short-summary: Commands for querying data in Application Insights applications. parameters: - name: --offset short-summary: > From e5e9d6ab1d08bca04ee4ef5b1fee1976265d880b Mon Sep 17 00:00:00 2001 From: AllyW Date: Thu, 10 Apr 2025 17:41:14 +0800 Subject: [PATCH 3/4] add cmd add --- .../azext_applicationinsights/_help.py | 14 ++++++++++++++ .../azext_applicationinsights/commands.py | 1 + .../azext_applicationinsights/custom.py | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/src/application-insights/azext_applicationinsights/_help.py b/src/application-insights/azext_applicationinsights/_help.py index 4f26e885694..b650e21afb3 100644 --- a/src/application-insights/azext_applicationinsights/_help.py +++ b/src/application-insights/azext_applicationinsights/_help.py @@ -140,6 +140,20 @@ az monitor app-insights query --app e292531c-eb03-4079-9bb0-fe6b56b99f8b --analytics-query 'requests | summarize count() by bin(timestamp, 1h)' --offset 1h30m """ +helps['monitor app-insights query-add'] = """ + type: command + short-summary: Execute a query over data in your application. + parameters: + - name: --offset + short-summary: > + Time offset of the query range, in ##d##h format. + long-summary: > + Can be used with either --start-time or --end-time. If used with --start-time, then + the end time will be calculated by adding the offset. If used with --end-time (default), then + the start time will be calculated by subtracting the offset. If --start-time and --end-time are + provided, then --offset will be ignored. +""" + helps['monitor app-insights metrics show'] = """ type: command short-summary: View the value of a single metric. diff --git a/src/application-insights/azext_applicationinsights/commands.py b/src/application-insights/azext_applicationinsights/commands.py index 40fc38934ce..e9d567c4d4c 100644 --- a/src/application-insights/azext_applicationinsights/commands.py +++ b/src/application-insights/azext_applicationinsights/commands.py @@ -94,6 +94,7 @@ def load_command_table(self, _): with self.command_group('monitor app-insights', query_sdk) as g: g.custom_command('query', 'execute_query') + g.custom_command('query-add', 'execute_query_add') with self.command_group('monitor app-insights component linked-storage'): from .custom import LinkedStorageAccountLink, LinkedStorageAccountUpdate, LinkedStorageAccountShow, LinkedStorageAccountUnlink diff --git a/src/application-insights/azext_applicationinsights/custom.py b/src/application-insights/azext_applicationinsights/custom.py index 7b03265f296..df21c119c46 100644 --- a/src/application-insights/azext_applicationinsights/custom.py +++ b/src/application-insights/azext_applicationinsights/custom.py @@ -42,6 +42,10 @@ def execute_query(cmd, client, application, analytics_query, start_time=None, en raise ValueError("The Application Insight is not found. Please check the app id again.") raise ex +def execute_query_add(cmd, client, start_time=None, end_time=None, offset='1h', + resource_group_name=None): + pass + def get_events(cmd, client, application, event_type, event=None, start_time=None, end_time=None, offset='1h', resource_group_name=None): timespan = get_timespan(cmd.cli_ctx, start_time, end_time, offset) From cbea7be691cc0311e4bec409f3c70a5f2da2ece1 Mon Sep 17 00:00:00 2001 From: AllyW Date: Thu, 10 Apr 2025 17:46:09 +0800 Subject: [PATCH 4/4] add param help --- src/application-insights/azext_applicationinsights/custom.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/application-insights/azext_applicationinsights/custom.py b/src/application-insights/azext_applicationinsights/custom.py index df21c119c46..7b4bbf28fcd 100644 --- a/src/application-insights/azext_applicationinsights/custom.py +++ b/src/application-insights/azext_applicationinsights/custom.py @@ -42,8 +42,7 @@ def execute_query(cmd, client, application, analytics_query, start_time=None, en raise ValueError("The Application Insight is not found. Please check the app id again.") raise ex -def execute_query_add(cmd, client, start_time=None, end_time=None, offset='1h', - resource_group_name=None): +def execute_query_add(cmd, client, offset='1h'): pass