Skip to content

Commit

Permalink
Update breaking change report template (#492)
Browse files Browse the repository at this point in the history
* Update breaking change report template.

* Fix

* Update Version number
  • Loading branch information
ReaNAiveD authored Dec 26, 2024
1 parent 94d93dc commit babeb53
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 12 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.91
++++++
* `azdev generate-breaking-change-report`: Update report report template.

0.1.90
++++++
* `azdev cmdcov`: Fix incorrect detection of code changes as new commands
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.90'
__VERSION__ = '0.1.91'
24 changes: 18 additions & 6 deletions azdev/operations/breaking_change/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ def __init__(self, module, command, detail, target_version):
self.command = command
self.detail = detail
self.target_version = target_version
self.group_ref = None

def calc_ref(self, loader):
if not loader:
return
if self.command in loader.command_group_table:
self.group_ref = self.command.split()
else:
self.group_ref = self.command.split()[:-1]


def _load_commands():
Expand Down Expand Up @@ -247,7 +256,9 @@ def _handle_upcoming_breaking_changes(selected_mod_names, source):
yield from _handle_core(source)

for module, loader in _iter_and_prepare_module_loader(command_loader, selected_mod_names):
yield from _handle_module(module, loader, source)
for bc_item in _handle_module(module, loader, source):
bc_item.calc_ref(loader)
yield bc_item


def _filter_breaking_changes(iterator, max_version=None):
Expand Down Expand Up @@ -276,18 +287,19 @@ def _group_breaking_change_items(iterator, group_by_version=False):
if group_by_version:
upcoming_breaking_changes = defaultdict( # module to command
lambda: defaultdict( # command to version
lambda: defaultdict( # version to list of breaking changes
lambda: [])))
lambda: {'group_ref': None, 'items': defaultdict( # version to list of breaking changes
lambda: [])}))
else:
upcoming_breaking_changes = defaultdict( # module to command
lambda: defaultdict( # command to list of breaking changes
lambda: []))
lambda: {'group_ref': None, 'items': []}))
for item in iterator:
version = item.target_version if item.target_version else 'Unspecific'
upcoming_breaking_changes[item.module][item.command]['group_ref'] = item.group_ref
if group_by_version:
upcoming_breaking_changes[item.module][item.command][version].append(item.detail)
upcoming_breaking_changes[item.module][item.command]['items'][version].append(item.detail)
else:
upcoming_breaking_changes[item.module][item.command].append(item.detail)
upcoming_breaking_changes[item.module][item.command]['items'].append(item.detail)
return upcoming_breaking_changes


Expand Down
19 changes: 14 additions & 5 deletions azdev/operations/breaking_change/markdown_template.jinja2
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Upcoming breaking changes in Azure CLI

The breaking changes listed in this article are planned for the next major release of the Azure CLI unless otherwise noted. Per our [Support lifecycle](./azure-cli-support-lifecycle.md), breaking changes in Azure CLI Core reference groups occur twice a year.

{% for module, command_bc in module_bc.items() -%}
## {{ module }}

Expand All @@ -8,21 +10,28 @@
### `{{ command }}`

{% endif -%}
{% if multi_version_bcs is mapping -%}
{% for version, bcs in multi_version_bcs | dictsort -%}
{% if multi_version_bcs.group_ref -%}
[Link to {{ multi_version_bcs.group_ref|join(' ') }} reference group](/cli/azure/{{ multi_version_bcs.group_ref|join('/') }})

{% endif -%}
{% if multi_version_bcs['items'] is mapping -%}
{% for version, bcs in multi_version_bcs['items'] | dictsort -%}
###{%- if not (module == 'core' and command == 'core') -%}#{%- endif %} Deprecated in {{ version }}

{% for bc in bcs -%}
- {{ bc }}
- {{ bc.detail }}
{% endfor %}

{% endfor -%}
{% else -%}

{% for bc in multi_version_bcs -%}
{% for bc in multi_version_bcs['items'] -%}
- {{ bc }}
{% endfor %}

{% endif -%}
{% endfor -%}
{% endfor -%}
{% endfor -%}

> [!NOTE]
> This article provides information on upcoming breaking changes. For previously published breaking changes, see [Azure CLI release notes](./release-notes-azure-cli.md).

0 comments on commit babeb53

Please sign in to comment.