Skip to content

Commit 3801f3a

Browse files
committed
Support unspecific version number
1 parent 939778e commit 3801f3a

2 files changed

Lines changed: 60 additions & 11 deletions

File tree

doc/how_to_introduce_breaking_changes.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,50 @@ All breaking changes **must** be pre-announced two sprints ahead Release. It giv
3636
1. (**Mandatory**) Breaking Changes must be pre-announced through Warning Log while executing.
3737
2. (*Automatic*) Breaking Changes would be collected automatically and listed in [Upcoming Breaking Change](https://learn.microsoft.com/en-us/cli/azure/upcoming-breaking-changes) Document.
3838

39+
### Breaking Changes in Extensions
40+
41+
All breaking changes in GA extensions **must** be pre-announced at least **30** days prior to their Release.
42+
43+
Extensions don't need to follow the breaking change window. However, we still strongly recommend releasing breaking changes only in breaking change windows along with Core Azure CLI.
44+
45+
```text
46+
[GA Release with Breaking Change Pre-Announcement]
47+
48+
├─ Must include complete Breaking Change Information
49+
50+
└─┬─ [Minimum 30-day Announcement Period] ────────────────┐
51+
│ │
52+
│ Allow releases during this period: │
53+
│ - Other unrelated GA versions (vX.(Y+1), v(X+1).Y) │
54+
│ - Multiple preview releases (Beta) │
55+
│ │
56+
▼ ▼
57+
[GA Release Containing Breaking Changes]
58+
(Must fulfill 30-day announcement requirement)
59+
```
60+
3961
## Workflow
4062

41-
### Overview
63+
### CLI Workflow Overview
4264

43-
* CLI Owned Module
44-
* Service Team should create an Issue that requests CLI Team to create the pre-announcement several sprints ahead Breaking Change Window. The issue should include the label `Breaking Change`. The CLI team will look at the issue and evaluate if it will be accepted in the next breaking change release.
65+
* **CLI Owned Module**
66+
* Service Team should create an Issue that requests CLI Team to create the pre-announcement at least **2** sprints ahead of Breaking Change Window. The issue should include the label `Breaking Change`. The CLI team will look at the issue and evaluate if it will be accepted in the next breaking change release.
4567
* Please ensure sufficient time for CLI Team to finish the pre-announcement.
46-
* The pre-announcement should be released ahead of Breaking Change Window.
47-
* Service Owned Module
48-
* Service Team should create a Pull Request that create the pre-announcement several sprints ahead Breaking Change Window.
49-
* The pre-announcement should be released ahead of Breaking Change Window.
68+
* The pre-announcement should be released at least **2** sprints ahead of Breaking Change Window.
69+
* **Service Owned Module**
70+
* Service Team should create a Pull Request that adds the pre-announcement at least **2** sprints ahead of Breaking Change Window.
71+
* The pre-announcement should be released at least **2** sprints ahead of Breaking Change Window.
5072
* After releasing the pre-announcement, a pipeline would be triggered, and the Upcoming Breaking Change Documentation would be updated.
5173
* At the start of Breaking Change window, the CLI team would notify Service Teams to adopt Breaking Changes.
5274
* Breaking Changes should be adopted within Breaking Change Window. Any unfinished pre-announcements of breaking changes targeting this release will be deleted by the CLI team.
5375

76+
### Extensions Workflow Overview
77+
78+
* Service Team should create a Pull Request that includes the pre-announcement.
79+
* The pre-announcement should be released after merged.
80+
* After releasing the pre-announcement, a pipeline would be triggered, and the Upcoming Breaking Change Documentation would be updated.
81+
* After 30 days, the Pull Request that contains the actual breaking changes could be merged and released.
82+
5483
### Pre-announce Breaking Changes
5584

5685
The breaking change pre-announcement must be released at least two sprints before the breaking change itself. It is strongly recommended to follow the best practice of providing the new behavior along with the pre-announcement. This allows customers to take action as soon as they discover the pre-announcement.
@@ -72,7 +101,7 @@ You can then pre-announce breaking changes for different command groups or comma
72101
from azure.cli.core.breaking_change import register_required_flag_breaking_change, register_default_value_breaking_change, register_other_breaking_change
73102

74103
register_required_flag_breaking_change('bar foo', '--name')
75-
register_default_value_breaking_change('bar foo baz', '--foobar', 'A', 'B')
104+
register_default_value_breaking_change('bar foo baz', '--foobar', 'A', 'B', target_version='May 2025')
76105
register_other_breaking_change('bar foo baz', 'During May 2024, another Breaking Change would happen in Build Event.')
77106
```
78107

@@ -84,7 +113,7 @@ az bar foo baz
84113

85114
# =====Warning output=====
86115
# The argument '--name' will become required in next breaking change release(2.61.0).
87-
# The default value of '--foobar' will be changed to 'B' from 'A' in next breaking change release(2.61.0).
116+
# The default value of '--foobar' will be changed to 'B' from 'A' in May 2025.
88117
# During May 2024, another Breaking Change would happen in Build Event.
89118
```
90119

@@ -132,6 +161,8 @@ from azure.cli.core.breaking_change import register_argument_deprecate
132161

133162
register_argument_deprecate('bar foo', '--name', target_version='2.70.0')
134163
# Warning Message: Option `--name` has been deprecated and will be removed in 2.70.0.
164+
register_argument_deprecate('bar foo', '--name', target_version='May 2025')
165+
# Warning Message: Option `--name` has been deprecated and will be removed in May 2025.
135166
```
136167

137168
**Rename**
@@ -143,6 +174,8 @@ from azure.cli.core.breaking_change import register_argument_deprecate
143174

144175
register_argument_deprecate('bar foo', '--name', '--new-name')
145176
# Warning Message: Option `--name` has been deprecated and will be removed in next breaking change release(2.67.0). Use `--new-name` instead.
177+
register_argument_deprecate('bar foo', '--name', '--new-name', target_version='May 2025')
178+
# Warning Message: Option `--name` has been deprecated and will be removed in May 2025. Use `--new-name` instead.
146179
```
147180

148181
**Output Change**

src/azure-cli-core/azure/cli/core/breaking_change.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# --------------------------------------------------------------------------------------------
55
import abc
66
import argparse
7+
import re
78
from collections import defaultdict
89

910
from knack.log import get_logger
@@ -14,6 +15,7 @@
1415
logger = get_logger()
1516

1617
NEXT_BREAKING_CHANGE_RELEASE = '2.73.0'
18+
NEXT_BREAKING_CHANGE_DATE = 'May 2025'
1719
DEFAULT_BREAKING_CHANGE_TAG = '[Breaking Change]'
1820

1921

@@ -152,7 +154,7 @@ class NextBreakingChangeWindow(TargetVersion):
152154
def __str__(self):
153155
next_breaking_change_version = _next_breaking_change_version()
154156
if next_breaking_change_version:
155-
return f'in next breaking change release({next_breaking_change_version})'
157+
return f'in next breaking change release({next_breaking_change_version}) scheduled for {NEXT_BREAKING_CHANGE_DATE}'
156158
return 'in next breaking change release'
157159

158160
def version(self):
@@ -171,6 +173,18 @@ def version(self):
171173
return self._version
172174

173175

176+
# pylint: disable=too-few-public-methods
177+
class NonVersion(TargetVersion):
178+
def __init__(self, msg):
179+
self._msg = msg
180+
181+
def __str__(self):
182+
return f'in {self._msg}'
183+
184+
def version(self):
185+
return None
186+
187+
174188
# pylint: disable=too-few-public-methods
175189
class UnspecificVersion(TargetVersion):
176190
def __str__(self):
@@ -192,8 +206,10 @@ def __init__(self, cmd, arg=None, target=None, target_version=None):
192206
self.target = target if target else '/'.join(self.args) if self.args else self.cmd
193207
if isinstance(target_version, TargetVersion):
194208
self._target_version = target_version
195-
elif isinstance(target_version, str):
209+
elif isinstance(target_version, str) and re.match(r'\d+.\d+.\d+', target_version):
196210
self._target_version = ExactVersion(target_version)
211+
elif isinstance(target_version, str):
212+
self._target_version = NonVersion(target_version)
197213
else:
198214
self._target_version = UnspecificVersion()
199215

0 commit comments

Comments
 (0)