Skip to content

Commit

Permalink
fix command-change data file pkg (#405)
Browse files Browse the repository at this point in the history
* fix command-change data file pkg
  • Loading branch information
AllyW authored Jul 10, 2023
1 parent df1b1e4 commit 6acd26a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Release History
===============
0.1.55
++++++
* `azdev command-change meta-diff`: Fix data/meta_change_whitelist.txt pkg building

0.1.54
++++++
* `azdev command-change meta-export/meta-diff`: Add cmd `type` extraction, fix false positive in cmdPropUpdate and add whitelist in certain meta-changes (#401)
Expand Down
2 changes: 1 addition & 1 deletion azdev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# license information.
# -----------------------------------------------------------------------------

__VERSION__ = '0.1.54'
__VERSION__ = '0.1.55'
14 changes: 8 additions & 6 deletions azdev/operations/command_change/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------------------------------------------

import os.path
from enum import Enum
from knack.log import get_logger
from azdev.utilities import (CMD_PROPERTY_ADD_BREAK_LIST, CMD_PROPERTY_REMOVE_BREAK_LIST,
CMD_PROPERTY_UPDATE_BREAK_LIST, PARA_PROPERTY_REMOVE_BREAK_LIST,
PARA_PROPERTY_ADD_BREAK_LIST, PARA_PROPERTY_UPDATE_BREAK_LIST,
get_azdev_repo_path)
PARA_PROPERTY_ADD_BREAK_LIST, PARA_PROPERTY_UPDATE_BREAK_LIST)
from .util import extract_cmd_name, extract_cmd_property, extract_subgroup_name, ChangeType
from .util import get_command_tree
from .meta_changes import (CmdAdd, CmdRemove, CmdPropAdd, CmdPropRemove, CmdPropUpdate, ParaAdd, ParaRemove,
Expand Down Expand Up @@ -43,12 +42,15 @@ def __init__(self, deep_diff=None, base_meta=None, diff_meta=None):
self.diff_meta = diff_meta
self.diff_objs = []
self.cmd_set_with_parameter_change = set()
self.meta_change_whitelist = set()
self.__get_meta_change_whitelist__()

def __get_meta_change_whitelist__(self):
self.meta_change_whitelist = set()
with open(get_azdev_repo_path() +
"/azdev/operations/command_change/data/meta_change_whitelist.txt", "r") as f_in:
white_list_file = os.path.dirname(os.path.realpath(__file__)) + "/data/meta_change_whitelist.txt"
if not os.path.exists(white_list_file):
logger.info("meta_change_whitelist.txt not exist, skipped")
return
with open(white_list_file, "r") as f_in:
for line in f_in:
white_key = line.rstrip()
self.meta_change_whitelist.add(white_key)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
'azdev.mod_templates': ['*.*'],
'azdev.operations.linter.rules': ['ci_exclusions.yml'],
'azdev.operations.cmdcov': ['*.*'],
'azdev.operations.command_change': ['data/*'],
},
include_package_data=True,
entry_points={
Expand Down

0 comments on commit 6acd26a

Please sign in to comment.