Skip to content

Commit 8758b6a

Browse files
committed
renamed removed by retired
1 parent 25c5e54 commit 8758b6a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

packages/common-library/src/common_library/changelog.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ChangelogType(Enum):
2121
NEW = auto()
2222
CHANGED = auto()
2323
DEPRECATED = auto()
24-
REMOVED = auto()
24+
RETIRED = auto()
2525

2626

2727
class ChangelogEntry(ABC):
@@ -94,17 +94,17 @@ def get_version(self) -> Version | None:
9494
return Version(self.version) if self.version else None
9595

9696

97-
class RemovedEndpoint(ChangelogEntry):
97+
class RetiredEndpoint(ChangelogEntry):
9898
"""Indicates when an endpoint will be or was removed"""
9999

100-
entry_type = ChangelogType.REMOVED
100+
entry_type = ChangelogType.RETIRED
101101

102102
def __init__(self, version: str, message: str):
103103
self.version = version
104104
self.message = message
105105

106106
def to_string(self) -> str:
107-
return f"Removed in *version {self.version}*: {self.message}\n"
107+
return f"Retired in *version {self.version}*: {self.message}\n"
108108

109109
def get_version(self) -> Version:
110110
return Version(self.version)
@@ -227,7 +227,7 @@ def create_route_config(
227227
for entry in changelog_list:
228228
if entry.entry_type == ChangelogType.DEPRECATED:
229229
is_deprecated = True
230-
elif entry.entry_type == ChangelogType.REMOVED:
230+
elif entry.entry_type == ChangelogType.RETIRED:
231231
is_removed = True
232232

233233
# Set route options based on endpoint state

packages/common-library/tests/test_changelog.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
ChangelogType,
1111
DeprecatedEndpoint,
1212
NewEndpoint,
13-
RemovedEndpoint,
13+
RetiredEndpoint,
1414
create_route_config,
1515
create_route_description,
1616
validate_changelog,
@@ -28,7 +28,7 @@ def current_api_version(mocker: MockerFixture) -> str:
2828
def test_changelog_entry_types():
2929
assert ChangelogType.NEW.value < ChangelogType.CHANGED.value
3030
assert ChangelogType.CHANGED.value < ChangelogType.DEPRECATED.value
31-
assert ChangelogType.DEPRECATED.value < ChangelogType.REMOVED.value
31+
assert ChangelogType.DEPRECATED.value < ChangelogType.RETIRED.value
3232

3333

3434
def test_changelog_entry_classes():
@@ -59,11 +59,11 @@ def test_changelog_entry_classes():
5959
assert "Deprecated" in deprecated_no_version.to_string()
6060
assert "in *version" not in deprecated_no_version.to_string()
6161

62-
# Test RemovedEndpoint
63-
removed_entry = RemovedEndpoint("0.9.0", "Use the new endpoint instead")
64-
assert removed_entry.entry_type == ChangelogType.REMOVED
62+
# Test RetiredEndpoint
63+
removed_entry = RetiredEndpoint("0.9.0", "Use the new endpoint instead")
64+
assert removed_entry.entry_type == ChangelogType.RETIRED
6565
assert removed_entry.get_version() == Version("0.9.0")
66-
assert "Removed in *version 0.9.0*" in removed_entry.to_string()
66+
assert "Retired in *version 0.9.0*" in removed_entry.to_string()
6767
assert "Use the new endpoint instead" in removed_entry.to_string()
6868

6969

@@ -181,7 +181,7 @@ def test_create_route_config_with_removal_notice(current_api_version: str) -> No
181181
changelog = [
182182
NewEndpoint("0.5.0"),
183183
DeprecatedEndpoint(alternative_route),
184-
RemovedEndpoint("0.9.0", removal_message),
184+
RetiredEndpoint("0.9.0", removal_message),
185185
]
186186

187187
config = create_route_config(
@@ -232,7 +232,7 @@ def test_create_route_config_with_mixed_changelog(current_api_version: str) -> N
232232
ChangedEndpoint("0.6.0", "Added authentication"),
233233
ChangedEndpoint("0.6.2", "Fixed a bug"),
234234
DeprecatedEndpoint(alternative_route),
235-
RemovedEndpoint("0.9.0", "Use the new endpoint instead"),
235+
RetiredEndpoint("0.9.0", "Use the new endpoint instead"),
236236
]
237237

238238
config = create_route_config(

0 commit comments

Comments
 (0)