Skip to content

Commit e0af8e3

Browse files
author
Matthias Wittgen
committed
Allow to discard broken tags
1 parent 88f5cfb commit e0af8e3

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

conf.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
changelog_conf = {
2+
"discard_tag" : ["25.0.1.rc1"],
3+
"first_tag" : ["25.0.1.rc2"]
4+
}

git_changelog.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
parser.add_argument('-n', type=int, default=5, dest='workers', help="Number of connection workers")
2929
parser.add_argument('-d', dest='debug', default=False, action='store_true', help="Enable debug mode")
3030
parser.add_argument('-u', dest='merge', default=True, action='store_false', help="Do not merge release candidates")
31-
parser.add_argument('-f', dest='first', default=True, action='store_false', help="Do noMerge first release RC")
31+
parser.add_argument('-f', dest='first', default=True, action='store_false', help="Do not merge first release RC")
3232
parser.add_argument('-w', dest='weekly', default=False, action='store_true', help="Create only weekly changelog")
3333
parser.add_argument('-r', dest='release', default=False, action='store_true',
3434
help="Create only regular release changelog")

rubin_changelog/tag.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
import re
2222
from enum import Enum
23+
from conf import changelog_conf
24+
25+
discard_tag = []
26+
first_tag = []
2327

2428

2529
class ReleaseType(Enum):
@@ -150,7 +154,7 @@ def rel_name(self) -> str:
150154
return name
151155

152156
def is_valid(self) -> bool:
153-
return self._valid
157+
return self._valid and self.name() not in discard_tag
154158

155159
def __eq__(self, other) -> bool:
156160
return self.__hash__() == other.__hash__()
@@ -234,7 +238,8 @@ def is_first_release_tag(self) -> bool:
234238
"""
235239
result = False
236240
if self.is_regular():
237-
result = self._rc == 1 and self._patch == 0
241+
result = (self._rc == 1 and self._patch == 0) or \
242+
((self.name() in first_tag) and (self.name() not in discard_tag))
238243
return result
239244

240245

@@ -259,3 +264,10 @@ def matches_release(tag: Tag, release: ReleaseType) -> bool:
259264
if tag.is_regular() and release == ReleaseType.REGULAR:
260265
return True
261266
return False
267+
268+
269+
for tag in changelog_conf["discard_tag"]:
270+
discard_tag.append(Tag(tag).name())
271+
272+
for tag in changelog_conf["first_tag"]:
273+
first_tag.append(Tag(tag).name())

0 commit comments

Comments
 (0)