From 6c2ea71df5f8c77bd0666d2a3eaf350bf2fe60bf Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Wed, 28 Apr 2021 15:57:47 +0800 Subject: [PATCH 1/5] docs template for extension --- scripts/ci/avail-ext-doc/list-template.md | 6 +++--- scripts/ci/avail-ext-doc/update_extension_list.py | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/ci/avail-ext-doc/list-template.md b/scripts/ci/avail-ext-doc/list-template.md index 9df8e087015..95ceb5d171d 100644 --- a/scripts/ci/avail-ext-doc/list-template.md +++ b/scripts/ci/avail-ext-doc/list-template.md @@ -21,6 +21,6 @@ The list of extensions is also available from the CLI. To get it, run [az exten az extension list-available --output table ``` -| Name | Version | Summary | Preview | -|------|---------|---------|---------|{% for extension in extensions %} -| [{{ extension.name }}]({{ extension.project_url }}) | {{ extension.version }} | {{ extension.desc }} | {{ extension.preview }} |{% endfor %} +| Reference | Extension | Minimum Version | Description | Preview |Release Notes | +|----|-----------|-----------------|-------------|---------|---------------|{% for extension in extensions %} +|[{{ extension.name }}]({{ extension.project_url }}) | {{extension.name}} | {{ extension.version }} | {{ extension.desc }} | {{ extension.preview }} | [history]({{extension.history}}) |{% endfor %} diff --git a/scripts/ci/avail-ext-doc/update_extension_list.py b/scripts/ci/avail-ext-doc/update_extension_list.py index 5433e5badfd..944f7c0b529 100644 --- a/scripts/ci/avail-ext-doc/update_extension_list.py +++ b/scripts/ci/avail-ext-doc/update_extension_list.py @@ -18,7 +18,7 @@ from pkg_resources import parse_version from jinja2 import Template # pylint: disable=import-error - +import requests SCRIPTS_LOCATION = os.path.abspath(os.path.join('.', 'scripts')) @@ -36,11 +36,18 @@ def get_extensions(): for _, exts in index_extensions.items(): # Get latest version exts = sorted(exts, key=lambda c: parse_version(c['metadata']['version']), reverse=True) + + # some extension modules may not include 'HISTORY.rst' + project_url = exts[0]['metadata']['extensions']['python.details']['project_urls']['Home'] + history_tmp = project_url + '/HISTORY.rst' + history = project_url if str(requests.get(history_tmp).status_code) == '404' else history_tmp + extensions.append({ 'name': exts[0]['metadata']['name'], 'desc': exts[0]['metadata']['summary'], - 'version': exts[0]['metadata']['version'], - 'project_url': exts[0]['metadata']['extensions']['python.details']['project_urls']['Home'], + 'version': exts[0]['metadata']['azext.minCliCoreVersion'], + 'project_url': project_url, + 'history': history, 'preview': 'Yes' if exts[0]['metadata'].get('azext.isPreview') else '' }) return extensions From e41e8a81b3031f7fa3ea6a42f0bda0fc3074f302 Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Wed, 12 May 2021 17:23:26 +0800 Subject: [PATCH 2/5] review --- scripts/ci/avail-ext-doc/list-template.md | 4 ++-- scripts/ci/avail-ext-doc/update_extension_list.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/ci/avail-ext-doc/list-template.md b/scripts/ci/avail-ext-doc/list-template.md index 95ceb5d171d..9c3da4c25ea 100644 --- a/scripts/ci/avail-ext-doc/list-template.md +++ b/scripts/ci/avail-ext-doc/list-template.md @@ -21,6 +21,6 @@ The list of extensions is also available from the CLI. To get it, run [az exten az extension list-available --output table ``` -| Reference | Extension | Minimum Version | Description | Preview |Release Notes | +| Extension | Latest Version | Minimum CLI Version | Description | Status | Release Notes | |----|-----------|-----------------|-------------|---------|---------------|{% for extension in extensions %} -|[{{ extension.name }}]({{ extension.project_url }}) | {{extension.name}} | {{ extension.version }} | {{ extension.desc }} | {{ extension.preview }} | [history]({{extension.history}}) |{% endfor %} +|[{{ extension.name }}]({{ extension.project_url }}) | {{extension.version}} | {{ extension.min_cli_core_version }} | {{ extension.desc }} | {{ extension.status }} | [history]({{extension.history}}) |{% endfor %} diff --git a/scripts/ci/avail-ext-doc/update_extension_list.py b/scripts/ci/avail-ext-doc/update_extension_list.py index 944f7c0b529..4db01c48b95 100644 --- a/scripts/ci/avail-ext-doc/update_extension_list.py +++ b/scripts/ci/avail-ext-doc/update_extension_list.py @@ -41,14 +41,21 @@ def get_extensions(): project_url = exts[0]['metadata']['extensions']['python.details']['project_urls']['Home'] history_tmp = project_url + '/HISTORY.rst' history = project_url if str(requests.get(history_tmp).status_code) == '404' else history_tmp + if exts[0]['metadata'].get('azext.isPreview'): + status='Preview' + elif exts[0]['metadata'].get('azext.isExperimental'): + status='Experimental' + else: + status='GA' extensions.append({ 'name': exts[0]['metadata']['name'], 'desc': exts[0]['metadata']['summary'], - 'version': exts[0]['metadata']['azext.minCliCoreVersion'], + 'min_cli_core_version': exts[0]['metadata']['azext.minCliCoreVersion'], + 'version': exts[0]['metadata']['version'], 'project_url': project_url, 'history': history, - 'preview': 'Yes' if exts[0]['metadata'].get('azext.isPreview') else '' + 'status': status }) return extensions From 2a75d24500d8027b95e07cf8b4b7b90121602aa3 Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Wed, 12 May 2021 17:27:52 +0800 Subject: [PATCH 3/5] pylint --- scripts/ci/avail-ext-doc/update_extension_list.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ci/avail-ext-doc/update_extension_list.py b/scripts/ci/avail-ext-doc/update_extension_list.py index 4db01c48b95..72ae5dc982f 100644 --- a/scripts/ci/avail-ext-doc/update_extension_list.py +++ b/scripts/ci/avail-ext-doc/update_extension_list.py @@ -42,11 +42,11 @@ def get_extensions(): history_tmp = project_url + '/HISTORY.rst' history = project_url if str(requests.get(history_tmp).status_code) == '404' else history_tmp if exts[0]['metadata'].get('azext.isPreview'): - status='Preview' + status = 'Preview' elif exts[0]['metadata'].get('azext.isExperimental'): - status='Experimental' + status = 'Experimental' else: - status='GA' + status = 'GA' extensions.append({ 'name': exts[0]['metadata']['name'], From c9f20cc3658523b54443b1609ff768cdbf55a85f Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Thu, 13 May 2021 10:32:45 +0800 Subject: [PATCH 4/5] review --- scripts/ci/avail-ext-doc/list-template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ci/avail-ext-doc/list-template.md b/scripts/ci/avail-ext-doc/list-template.md index 9c3da4c25ea..a453c483a27 100644 --- a/scripts/ci/avail-ext-doc/list-template.md +++ b/scripts/ci/avail-ext-doc/list-template.md @@ -21,6 +21,6 @@ The list of extensions is also available from the CLI. To get it, run [az exten az extension list-available --output table ``` -| Extension | Latest Version | Minimum CLI Version | Description | Status | Release Notes | -|----|-----------|-----------------|-------------|---------|---------------|{% for extension in extensions %} -|[{{ extension.name }}]({{ extension.project_url }}) | {{extension.version}} | {{ extension.min_cli_core_version }} | {{ extension.desc }} | {{ extension.status }} | [history]({{extension.history}}) |{% endfor %} +| Extension | Needed Minimum CLI Version | Description | Status | Release Notes | +|----|-----------------|-------------|---------|---------------|{% for extension in extensions %} +|[{{ extension.name }}]({{ extension.project_url }}) | {{ extension.min_cli_core_version }} | {{ extension.desc }} | {{ extension.status }} | [{{extension.version}}]({{extension.history}}) |{% endfor %} From d2411c29a65db1df207e1a315f744fe9d53d1d20 Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Fri, 14 May 2021 10:04:29 +0800 Subject: [PATCH 5/5] Update scripts/ci/avail-ext-doc/list-template.md Co-authored-by: Feng Zhou <55177366+fengzhou-msft@users.noreply.github.com> --- scripts/ci/avail-ext-doc/list-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/avail-ext-doc/list-template.md b/scripts/ci/avail-ext-doc/list-template.md index a453c483a27..22572198427 100644 --- a/scripts/ci/avail-ext-doc/list-template.md +++ b/scripts/ci/avail-ext-doc/list-template.md @@ -21,6 +21,6 @@ The list of extensions is also available from the CLI. To get it, run [az exten az extension list-available --output table ``` -| Extension | Needed Minimum CLI Version | Description | Status | Release Notes | +| Extension | Required Minimum CLI Version | Description | Status | Release Notes | |----|-----------------|-------------|---------|---------------|{% for extension in extensions %} |[{{ extension.name }}]({{ extension.project_url }}) | {{ extension.min_cli_core_version }} | {{ extension.desc }} | {{ extension.status }} | [{{extension.version}}]({{extension.history}}) |{% endfor %}