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

Release sdk status #22260

Merged
merged 61 commits into from
Dec 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
0847053
initial
msyyc Jul 5, 2021
3435844
fix
msyyc Jul 5, 2021
63173b8
fix
msyyc Jul 5, 2021
48ff8f5
print fix
msyyc Jul 5, 2021
3fe5c9a
debug
msyyc Jul 6, 2021
be16d3b
debug
msyyc Jul 6, 2021
820b983
debug
msyyc Jul 6, 2021
5981429
debug
msyyc Jul 6, 2021
5cf6252
fix html link
msyyc Jul 6, 2021
461be1d
print format
msyyc Jul 6, 2021
fc5957c
Add some comments
RAY-316 Jul 6, 2021
3d169c6
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
msyyc Sep 3, 2021
8d420b0
swagger default branch changes to main
msyyc Sep 3, 2021
bf3be9f
Update main.py
BigCat20196 Dec 15, 2021
e1b28d4
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Dec 15, 2021
f6b5ac1
test
BigCat20196 Dec 15, 2021
20fdbc8
test
BigCat20196 Dec 15, 2021
3bbb334
test
BigCat20196 Dec 15, 2021
aead081
test
BigCat20196 Dec 15, 2021
135edf4
test
BigCat20196 Dec 15, 2021
2521660
test
BigCat20196 Dec 15, 2021
c6a2608
test
BigCat20196 Dec 15, 2021
93dc348
test
BigCat20196 Dec 15, 2021
da6afb3
test
BigCat20196 Dec 15, 2021
26117ab
test
BigCat20196 Dec 15, 2021
624554f
test
BigCat20196 Dec 15, 2021
7ad5de2
test
BigCat20196 Dec 15, 2021
1c8b6a9
test
BigCat20196 Dec 16, 2021
e8187ad
test
BigCat20196 Dec 16, 2021
3dd4a12
test
BigCat20196 Dec 16, 2021
035a95e
test
BigCat20196 Dec 17, 2021
c4b47d3
test
BigCat20196 Dec 17, 2021
a08d498
test
BigCat20196 Dec 20, 2021
fa31cfb
test
BigCat20196 Dec 20, 2021
cfab0aa
test
BigCat20196 Dec 20, 2021
4ac6fbe
test
BigCat20196 Dec 20, 2021
890df2a
test
BigCat20196 Dec 20, 2021
7f6ebba
test
BigCat20196 Dec 20, 2021
e19953a
Update release_sdk_status.yml for Azure Pipelines
BigCat20196 Dec 21, 2021
4c66efc
Update release_sdk_status.yml for Azure Pipelines
BigCat20196 Dec 21, 2021
c485ce3
test
BigCat20196 Dec 21, 2021
9f9b70a
Merge branch 'release-sdk-status' of https://github.com/msyyc/azure-s…
BigCat20196 Dec 21, 2021
a5fc556
test
BigCat20196 Dec 21, 2021
708f519
fix
BigCat20196 Dec 21, 2021
152ba89
fix
BigCat20196 Dec 21, 2021
73ccf50
fix
BigCat20196 Dec 21, 2021
a8cdbc9
fix path
BigCat20196 Dec 21, 2021
fb52e86
fix path
BigCat20196 Dec 21, 2021
e575111
fix title
BigCat20196 Dec 21, 2021
c7f49c7
fix failed
BigCat20196 Dec 22, 2021
a1edc06
fix failed
BigCat20196 Dec 22, 2021
c65f1cf
fix
BigCat20196 Dec 22, 2021
673d967
fix multi api describe
BigCat20196 Dec 23, 2021
44c4652
test
BigCat20196 Dec 23, 2021
8140341
test
BigCat20196 Dec 24, 2021
7d98c64
fix fake
BigCat20196 Dec 24, 2021
49a3472
test
BigCat20196 Dec 24, 2021
a51663f
test
BigCat20196 Dec 24, 2021
8edac61
test
BigCat20196 Dec 24, 2021
8d574f2
test
BigCat20196 Dec 24, 2021
2901ebf
test
BigCat20196 Dec 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
debug
  • Loading branch information
msyyc committed Jul 6, 2021
commit 5981429973422c784b347ba73461dca7e82a61e4
71 changes: 31 additions & 40 deletions scripts/release_sdk_status/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import requests
import re
import os
import glob
from lxml import etree
import lxml.html
import subprocess as sp
Expand Down Expand Up @@ -204,60 +205,50 @@ def project_html(url):
return parse_result


def read_file(file_name):
with open(file_name, 'r', encoding='utf-8') as file_in:
content = file_in.readlines()
return content


def sdk_info_from_swagger():
sdk_name_re = re.compile(r'azure-mgmt-[a-z]+-*([a-z])+')
resource_manager = []
SDK_URL = "https://github.com/Azure/azure-rest-api-specs/tree/master/specification"
sdk_hrefs = project_html(SDK_URL).xpath('//div[@class="js-details-container Details"]/div/div/'
'div[@class="flex-auto min-width-0 col-md-2 mr-3"]//a/@href')
my_print(f'total folder num: {len(sdk_hrefs)}')

# extract all folders which have python config
for href in sdk_hrefs:
readme_python = None
track_config = []
SWAGGER_FOLDER = os.getenv('SWAGGER_REPO')
readme_folders = glob.glob(f'{SWAGGER_FOLDER}/specification/*/resource-manager/readme.md')
my_print(f'total readme folders: {len(readme_folders)}')

for folder in readme_folders:
track_config = 0
package_name = ''
if 'resource-manager' not in href:
href = href + '/resource-manager'
href = 'https://github.com' + href
html_text = project_html(href)
resource_manager_folders = html_text.xpath('//div[@class="js-details-container Details"]/div/div/'
'div[@class="flex-auto min-width-0 col-md-2 mr-3"]//a/text()')
for resource_manager_folder in resource_manager_folders:
if resource_manager_folder == 'readme.python.md':
readme_python = href + '/readme.python.md'
readme_text = html_text.xpath('//div[@class="Box-body px-5 pb-5"]/article//text()')
folder = folder.replace('readme.md', '')
readme_python = 'NA' if 'readme.python.md' not in os.listdir(folder) else f'{folder}/readme.python.md'
readme_text = read_file(folder + 'readme.md')
for line in readme_text:
if line == 'azure-sdk-for-python':
track_config.append('track1')
elif line == 'azure-sdk-for-python-track2':
track_config.append('track2')
if readme_python is None and sdk_name_re.search(line) is not None and package_name == '':
if line.find('azure-sdk-for-python-track2') > -1:
track_config += 2
elif line.find('azure-sdk-for-python') > -1:
track_config += 1
if readme_python == 'NA' and sdk_name_re.search(line) is not None and package_name == '':
package_name = sdk_name_re.search(line).group()
if len(track_config) == 2:
track_config = 'both'
elif len(track_config) > 2:
track_config = 'Rule error'
elif len(track_config) == 1:
track_config = track_config[0]
elif len(track_config) == 0:
track_config = 'NA'
if readme_python is not None:
readme_python_html_text = project_html(readme_python)
readme_python_text = readme_python_html_text.xpath('//div[@id="readme"]/article//text()')

if readme_python != 'NA':
readme_python_text = read_file(readme_python)
for text in readme_python_text:
if sdk_name_re.search(text) is not None:
package_name = sdk_name_re.search(text).group()

my_print(f'{href} : {package_name}')
TRACK_CONFIG = {0: 'NA', 1: 'track1', 2: 'track2', 3: 'both'}
track_config = TRACK_CONFIG.get(track_config, 'Rule error')
readme_html = folder.replace(SWAGGER_FOLDER, 'https://github.com/Azure/azure-rest-api-specs')
if package_name != '':
if readme_python is None:
readme_python = 'NA'
resource_manager.append('{},{},{},{}\n'.format(package_name,
track_config,
readme_python,
str(href)))
my_print(f'total backup package kinds: {len(resource_manager)}')
readme_html))
my_print(f'{folder} : {package_name}')

my_print(f'total package kinds: {len(resource_manager)}')
return resource_manager


Expand Down
3 changes: 3 additions & 0 deletions scripts/release_sdk_status/release_sdk_status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ jobs:
# clone(REPO: https://github.com/Azure/azure-sdk-for-python.git, USR_NAME: Azure, USR_TOKEN: xxxxxxxxxxxxx)
mkdir file-storage
git clone ${REPO:0:8}$(USR_NAME):$(USR_TOKEN)@${REPO:8} $(pwd)/file-storage
mkdir azure-rest-api-specs
git clone https://github.com/Azure/azure-rest-api-specs.git $(pwd)/azure-rest-api-specs

# import env variable
export CONN_STR=$(ENV_CONN_STR)
export FILE=$(ENV_FILE)
export TOKEN=$(USR_TOKEN)
export SWAGGER_REPO=$(pwd)/azure-rest-api-specs

# create virtual env
python -m venv venv-sdk
Expand Down