azure-cli-diff-tool 0.0.9__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/PKG-INFO +17 -3
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool/__init__.py +2 -2
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool/meta_change_detect.py +4 -2
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool.egg-info/PKG-INFO +17 -3
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool.egg-info/SOURCES.txt +1 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool.egg-info/requires.txt +1 -1
- azure_cli_diff_tool-0.1.1/pyproject.toml +9 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/setup.py +1 -1
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/tests/test_break_change.py +44 -20
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/README.rst +0 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool/_const.py +0 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool/data/blob_config.ini +0 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool/data/meta_change_whitelist.txt +0 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool/meta_change.py +0 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool/utils.py +0 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool.egg-info/dependency_links.txt +0 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool.egg-info/top_level.txt +0 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/setup.cfg +0 -0
- {azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/tests/__init__.py +0 -0
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: azure-cli-diff-tool
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: A tool for cli metadata management
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
Author-email: azpycli@microsoft.com
|
|
7
7
|
License: MIT
|
|
8
|
-
Requires-Dist: deepdiff
|
|
8
|
+
Requires-Dist: deepdiff~=8.6.1
|
|
9
9
|
Requires-Dist: requests~=2.32.3
|
|
10
|
+
Dynamic: author
|
|
11
|
+
Dynamic: author-email
|
|
12
|
+
Dynamic: description
|
|
13
|
+
Dynamic: license
|
|
14
|
+
Dynamic: requires-dist
|
|
15
|
+
Dynamic: summary
|
|
10
16
|
|
|
11
17
|
Microsoft Azure CLI Diff Tools (azure-cli-diff-tool)
|
|
12
18
|
=======================================================
|
|
@@ -98,6 +104,14 @@ License
|
|
|
98
104
|
|
|
99
105
|
Release History
|
|
100
106
|
===============
|
|
107
|
+
0.1.1
|
|
108
|
+
++++++
|
|
109
|
+
* Bump `deepDiff` to 8.6.1
|
|
110
|
+
|
|
111
|
+
0.1.0
|
|
112
|
+
++++++
|
|
113
|
+
* Enable meta-diff with `module_name` excluded
|
|
114
|
+
|
|
101
115
|
0.0.9
|
|
102
116
|
++++++
|
|
103
117
|
* Use dynamic metadata whitelist
|
|
@@ -18,7 +18,7 @@ from .utils import get_blob_config, load_blob_config_file, get_target_version_mo
|
|
|
18
18
|
extract_module_name_from_meta_file, export_meta_changes_to_csv, export_meta_changes_to_json, \
|
|
19
19
|
export_meta_changes_to_dict, expand_deprecate_obj
|
|
20
20
|
|
|
21
|
-
__VERSION__ = '0.
|
|
21
|
+
__VERSION__ = '0.1.1'
|
|
22
22
|
|
|
23
23
|
logger = logging.getLogger(__name__)
|
|
24
24
|
|
|
@@ -63,7 +63,7 @@ def meta_diff(base_meta_file, diff_meta_file, only_break=False, output_type="tex
|
|
|
63
63
|
raise Exception("Please update your azure cli diff tool")
|
|
64
64
|
expand_deprecate_obj(command_tree_before)
|
|
65
65
|
expand_deprecate_obj(command_tree_after)
|
|
66
|
-
diff = DeepDiff(command_tree_before, command_tree_after)
|
|
66
|
+
diff = DeepDiff(command_tree_before, command_tree_after, exclude_paths=["root['module_name']"])
|
|
67
67
|
if not diff:
|
|
68
68
|
print(f"No meta diffs from {diff_meta_file} to {base_meta_file}")
|
|
69
69
|
return export_meta_changes_to_json(None, output_file)
|
{azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool/meta_change_detect.py
RENAMED
|
@@ -45,8 +45,10 @@ class MetaChangeDetect:
|
|
|
45
45
|
self.deep_diff = deep_diff
|
|
46
46
|
else:
|
|
47
47
|
logger.info("None diffs from cmd meta json")
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
if base_meta["module_name"] != diff_meta["module_name"]:
|
|
49
|
+
print(f'Comparing two modules with different name, base mod: {base_meta["module_name"]},'
|
|
50
|
+
f' diff mod: {diff_meta["module_name"]}')
|
|
51
|
+
self.module_name = diff_meta["module_name"]
|
|
50
52
|
self.base_meta = base_meta
|
|
51
53
|
self.diff_meta = diff_meta
|
|
52
54
|
self.diff_objs = []
|
{azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool.egg-info/PKG-INFO
RENAMED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: azure-cli-diff-tool
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: A tool for cli metadata management
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
Author-email: azpycli@microsoft.com
|
|
7
7
|
License: MIT
|
|
8
|
-
Requires-Dist: deepdiff
|
|
8
|
+
Requires-Dist: deepdiff~=8.6.1
|
|
9
9
|
Requires-Dist: requests~=2.32.3
|
|
10
|
+
Dynamic: author
|
|
11
|
+
Dynamic: author-email
|
|
12
|
+
Dynamic: description
|
|
13
|
+
Dynamic: license
|
|
14
|
+
Dynamic: requires-dist
|
|
15
|
+
Dynamic: summary
|
|
10
16
|
|
|
11
17
|
Microsoft Azure CLI Diff Tools (azure-cli-diff-tool)
|
|
12
18
|
=======================================================
|
|
@@ -98,6 +104,14 @@ License
|
|
|
98
104
|
|
|
99
105
|
Release History
|
|
100
106
|
===============
|
|
107
|
+
0.1.1
|
|
108
|
+
++++++
|
|
109
|
+
* Bump `deepDiff` to 8.6.1
|
|
110
|
+
|
|
111
|
+
0.1.0
|
|
112
|
+
++++++
|
|
113
|
+
* Enable meta-diff with `module_name` excluded
|
|
114
|
+
|
|
101
115
|
0.0.9
|
|
102
116
|
++++++
|
|
103
117
|
* Use dynamic metadata whitelist
|
{azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool.egg-info/requires.txt
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
deepdiff
|
|
1
|
+
deepdiff~=8.6.1
|
|
2
2
|
requests~=2.32.3
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# -----------------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
+
# license information.
|
|
5
|
+
# -----------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
[build-system]
|
|
8
|
+
# Minimum requirements for the build system to execute.
|
|
9
|
+
requires = ["setuptools", "wheel"]
|
|
@@ -30,7 +30,7 @@ setup(name="azure-cli-diff-tool",
|
|
|
30
30
|
author_email='azpycli@microsoft.com',
|
|
31
31
|
packages=find_packages(),
|
|
32
32
|
include_package_data=True,
|
|
33
|
-
install_requires=["deepdiff
|
|
33
|
+
install_requires=["deepdiff~=8.6.1", "requests~=2.32.3"],
|
|
34
34
|
package_data={
|
|
35
35
|
"azure_cli_diff_tool": ["data/*"]
|
|
36
36
|
}
|
|
@@ -10,6 +10,7 @@ import os
|
|
|
10
10
|
from azure_cli_diff_tool import meta_diff
|
|
11
11
|
from azure_cli_diff_tool.utils import get_command_tree, extract_cmd_name, extract_cmd_property, extract_para_info, \
|
|
12
12
|
extract_subgroup_name, extract_subgroup_deprecate_property, expand_deprecate_obj, extract_subgroup_property
|
|
13
|
+
TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
class CLIDiffToolTestCase(unittest.TestCase):
|
|
@@ -65,12 +66,15 @@ class CLIDiffToolTestCase(unittest.TestCase):
|
|
|
65
66
|
self.assertEqual(subgroup_prop, "deprecate_info_hide", "sub group prop extract failed")
|
|
66
67
|
|
|
67
68
|
def test_diff_meta(self):
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
base_meta_file = os.path.join(TEST_DIR, "jsons", "az_monitor_meta_before.json")
|
|
70
|
+
diff_meta_file = os.path.join(TEST_DIR, "jsons", "az_monitor_meta_after.json")
|
|
71
|
+
if not os.path.exists(base_meta_file) or not os.path.exists(diff_meta_file):
|
|
72
|
+
raise ValueError("Meta file not found, please check testing package")
|
|
73
|
+
|
|
74
|
+
result = meta_diff(base_meta_file=base_meta_file,
|
|
75
|
+
diff_meta_file=diff_meta_file,
|
|
73
76
|
output_type="text")
|
|
77
|
+
|
|
74
78
|
target_message = [
|
|
75
79
|
"please confirm cmd `monitor private-link-scope scoped-resource show` removed",
|
|
76
80
|
"sub group `monitor private-link-scope private-endpoint-connection cust` removed",
|
|
@@ -97,20 +101,22 @@ class CLIDiffToolTestCase(unittest.TestCase):
|
|
|
97
101
|
self.assertTrue(ignored, "ignored message found")
|
|
98
102
|
|
|
99
103
|
def test_diff_meta_whitelist(self):
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
base_meta_file = os.path.join(TEST_DIR, "jsons", "az_ams_meta_before.json")
|
|
105
|
+
diff_meta_file = os.path.join(TEST_DIR, "jsons", "az_ams_meta_after.json")
|
|
106
|
+
if not os.path.exists(base_meta_file) or not os.path.exists(diff_meta_file):
|
|
107
|
+
raise ValueError("Meta file not found, please check testing package")
|
|
108
|
+
result = meta_diff(base_meta_file=base_meta_file,
|
|
109
|
+
diff_meta_file=diff_meta_file,
|
|
105
110
|
output_type="text")
|
|
106
111
|
self.assertEqual(result, [], "returned change isn't empty")
|
|
107
112
|
|
|
108
113
|
def test_dynamic_diff_meta_whitelist(self):
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
base_meta_file = os.path.join(TEST_DIR, "jsons", "az_mysql_meta_before.json")
|
|
115
|
+
diff_meta_file = os.path.join(TEST_DIR, "jsons", "az_mysql_meta_after.json")
|
|
116
|
+
if not os.path.exists(base_meta_file) or not os.path.exists(diff_meta_file):
|
|
117
|
+
raise ValueError("Meta file not found, please check testing package")
|
|
118
|
+
result = meta_diff(base_meta_file=base_meta_file,
|
|
119
|
+
diff_meta_file=diff_meta_file,
|
|
114
120
|
output_type="text")
|
|
115
121
|
self.assertEqual(result, [], "returned change isn't empty")
|
|
116
122
|
|
|
@@ -158,11 +164,12 @@ class CLIDiffToolTestCase(unittest.TestCase):
|
|
|
158
164
|
self.assertEqual(example_obj["sub_groups"]["acr"]["commands"]["acr helm list"]["parameters"][0]["deprecate_info_redirect"], "resource_group_name2", "deprecate info expand not working properly")
|
|
159
165
|
|
|
160
166
|
def test_diff_meta_for_deprecate_info(self):
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
base_meta_file = os.path.join(TEST_DIR, "jsons", "az_acr_meta_before.json")
|
|
168
|
+
diff_meta_file = os.path.join(TEST_DIR, "jsons", "az_acr_meta_after.json")
|
|
169
|
+
if not os.path.exists(base_meta_file) or not os.path.exists(diff_meta_file):
|
|
170
|
+
raise ValueError("Meta file not found, please check testing package")
|
|
171
|
+
|
|
172
|
+
result = meta_diff(base_meta_file=base_meta_file, diff_meta_file=diff_meta_file, output_type="text")
|
|
166
173
|
target_message = [
|
|
167
174
|
"sub group `acr` added property `deprecate_info_hide` | diff_level: 2",
|
|
168
175
|
"sub group `acr` updated property `deprecate_info_redirect` from `acr2` to `acr3` | diff_level: 1",
|
|
@@ -183,6 +190,23 @@ class CLIDiffToolTestCase(unittest.TestCase):
|
|
|
183
190
|
print(mes)
|
|
184
191
|
self.assertTrue(found, "target message not found")
|
|
185
192
|
|
|
193
|
+
def test_diff_meta_with_different_mod_name(self):
|
|
194
|
+
base_meta_file = os.path.join(TEST_DIR, "jsons", "az_virtual-network-manager_meta_before.json")
|
|
195
|
+
diff_meta_file = os.path.join(TEST_DIR, "jsons", "az_network-manager_meta_after.json")
|
|
196
|
+
if not os.path.exists(base_meta_file) or not os.path.exists(diff_meta_file):
|
|
197
|
+
raise ValueError("Meta file not found, please check testing package")
|
|
198
|
+
result = meta_diff(base_meta_file=base_meta_file, diff_meta_file=diff_meta_file, output_type="text")
|
|
199
|
+
target_message = [
|
|
200
|
+
"updated property `name` from `network_manager_scopes` to `module_name`",
|
|
201
|
+
]
|
|
202
|
+
for mes in target_message:
|
|
203
|
+
found = False
|
|
204
|
+
for line in result:
|
|
205
|
+
if line.find(mes) > -1:
|
|
206
|
+
found = True
|
|
207
|
+
break
|
|
208
|
+
self.assertTrue(found, "target message not found")
|
|
209
|
+
|
|
186
210
|
|
|
187
211
|
if __name__ == '__main__':
|
|
188
212
|
unittest.main()
|
|
File without changes
|
|
File without changes
|
{azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool/data/blob_config.ini
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{azure_cli_diff_tool-0.0.9 → azure_cli_diff_tool-0.1.1}/azure_cli_diff_tool.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|