in azdev/operations/breaking_change/__init__.py [0:0]
def collect_upcoming_breaking_changes(modules=None, target_version='NextWindow', source=None, group_by_version=None,
output_format='structure', no_head=False, no_tail=False,
include_whl_extensions=False):
if target_version == 'NextWindow':
from azure.cli.core.breaking_change import NEXT_BREAKING_CHANGE_RELEASE
target_version = NEXT_BREAKING_CHANGE_RELEASE
elif target_version.lower() == 'none':
target_version = None
require_azure_cli()
selected_modules = calc_selected_modules(modules, include_whl_extensions=include_whl_extensions)
cli_mod_names = list(selected_modules['core'].keys()) + list(selected_modules['mod'].keys())
ext_mod_names = list(selected_modules['ext'].keys())
if cli_mod_names or ext_mod_names:
display('Modules selected: {}\n'.format(', '.join(cli_mod_names + ext_mod_names)))
command_loader = _load_commands()
heading('Collecting Breaking Change Pre-announcement')
breaking_changes = []
if cli_mod_names:
cli_breaking_changes = _handle_upcoming_breaking_changes(command_loader, cli_mod_names, source)
cli_breaking_changes = _filter_breaking_changes(cli_breaking_changes, target_version)
breaking_changes.extend(cli_breaking_changes)
if ext_mod_names:
ext_breaking_changes = _handle_upcoming_breaking_changes(command_loader, ext_mod_names, 'pre_announce')
breaking_changes.extend(ext_breaking_changes)
breaking_changes = _group_breaking_change_items(breaking_changes, group_by_version)
if output_format == 'structure':
return breaking_changes
elif output_format == 'markdown':
from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader('azdev', 'operations/breaking_change'),
trim_blocks=True)
template = env.get_template('markdown_template.jinja2')
output(template.render({
'module_bc': breaking_changes,
'no_head': no_head,
'no_tail': no_tail,
}), end='' if no_tail else '\n')
return None