Skip to content

Commit 0803bc8

Browse files
authored
Support trim head and tail in markdown breaking change report generation (#509)
* Support new parameter no-head and no-tail in markdown report generation * Release
1 parent 0cfef5b commit 0803bc8

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
33
Release History
44
===============
5+
0.1.96
6+
++++++
7+
* `azdev generate-breaking-change-report`: Add `--no-head` and `--no-tail` to support trim header and tail in markdown report.
8+
59
0.1.95
610
++++++
711
* `azdev generate-breaking-change-report`: Extracts upcoming breaking changes in extensions, regardless of the target version set

azdev/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# license information.
55
# -----------------------------------------------------------------------------
66

7-
__VERSION__ = '0.1.95'
7+
__VERSION__ = '0.1.96'

azdev/operations/breaking_change/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def _group_breaking_change_items(iterator, group_by_version=False):
304304

305305

306306
def collect_upcoming_breaking_changes(modules=None, target_version='NextWindow', source=None, group_by_version=None,
307-
output_format='structure'):
307+
output_format='structure', no_head=False, no_tail=False):
308308
if target_version == 'NextWindow':
309309
from azure.cli.core.breaking_change import NEXT_BREAKING_CHANGE_RELEASE
310310
target_version = NEXT_BREAKING_CHANGE_RELEASE
@@ -339,5 +339,9 @@ def collect_upcoming_breaking_changes(modules=None, target_version='NextWindow',
339339
env = Environment(loader=PackageLoader('azdev', 'operations/breaking_change'),
340340
trim_blocks=True)
341341
template = env.get_template('markdown_template.jinja2')
342-
output(template.render({'module_bc': breaking_changes}))
342+
output(template.render({
343+
'module_bc': breaking_changes,
344+
'no_head': no_head,
345+
'no_tail': no_tail,
346+
}))
343347
return None

azdev/operations/breaking_change/markdown_template.jinja2

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
{% if not no_head -%}
12
# Upcoming breaking changes in Azure CLI
23

34
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.
45

6+
{% endif -%}
57
{% for module, command_bc in module_bc.items() -%}
68
## {{ module }}
79

@@ -32,6 +34,7 @@ The breaking changes listed in this article are planned for the next major relea
3234
{% endif -%}
3335
{% endfor -%}
3436
{% endfor -%}
35-
37+
{% if not no_tail %}
3638
> [!NOTE]
37-
> This article provides information on upcoming breaking changes. For previously published breaking changes, see [Azure CLI release notes](./release-notes-azure-cli.md).
39+
> This article provides information on upcoming breaking changes. For previously published breaking changes, see [Azure CLI release notes](./release-notes-azure-cli.md).
40+
{%- endif -%}

azdev/params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,5 @@ def load_arguments(self, _):
276276
help='If specified, breaking changes would be grouped by their target version as well.')
277277
c.argument('output_format', choices=['structure', 'markdown'], default='structure',
278278
help='Output format of the collected breaking changes.')
279+
c.argument('no_head', action='store_true', help='Skip head when displaying as markdown.')
280+
c.argument('no_tail', action='store_true', help='Skip tail when displaying as markdown.')

0 commit comments

Comments
 (0)