Skip to content

Commit 44ae57c

Browse files
authored
CI: Enhance Autobumper Script (#857)
* ci: fix linter annoyances * remove unused import * remove f-string without parameter * add explicit None check to satisfy return type constraint * ci: add release notes for WebLink and GitHub dependencies * ci: remove ttar comment, submodules are managed by dependabot
1 parent 4d2a200 commit 44ae57c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ci/scripts/autobump-dependencies.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python3
22
import functools
3-
from hashlib import sha1
43
import json
54
import os
65
import re
@@ -286,20 +285,21 @@ def get_release_download_url(rel):
286285
current_version,
287286
)
288287

289-
if latest_version == version.parse("0.0.0"):
288+
if latest_version == version.parse("0.0.0") or latest_release is None:
290289
raise Exception(f"No release found for '{repo}'")
291290

292291
return latest_release
293292

294293
def get_release_notes(self) -> str:
295-
return ""
294+
return f"Make sure to check the [CHANGELOG]({self.root_url}/releases) for any breaking changes."
296295

297296

298297
@dataclass
299298
class WebLinkDependency(Dependency):
300299

301300
selector: str = "a"
302301
pattern: str = "({name}-({pinned_version}" + r"(?:\.[0-9])+))\.tar\.gz"
302+
changelog_url: str = ""
303303

304304
def fetch_latest_release(self) -> Release:
305305
data = requests.get(self.root_url)
@@ -330,7 +330,7 @@ def fetch_latest_release(self) -> Release:
330330
raise Exception(f"Failed to get latest {self.name} version from {self.root_url}")
331331

332332
def get_release_notes(self) -> str:
333-
return ""
333+
return f"Make sure to check the [CHANGELOG]({self.changelog_url}) for any breaking changes."
334334

335335

336336
@dataclass
@@ -412,7 +412,7 @@ def get_release_notes(self) -> str:
412412
Change log was trimmed to {releaseNoteLimit} characters. Please see the changelog file for the full change log.
413413
""")
414414

415-
releaseNote += textwrap.dedent(f"""
415+
releaseNote += textwrap.dedent("""
416416
```
417417
418418
</details>""")
@@ -465,12 +465,14 @@ def main() -> None:
465465
"https://keepalived.org/download.html",
466466
package="keepalived",
467467
selector="div.content a",
468+
changelog_url="https://keepalived.org/release-notes/"
468469
),
469470
WebLinkDependency(
470471
"socat",
471472
"SOCAT_VERSION",
472473
SOCAT_VERSION,
473474
"http://www.dest-unreach.org/socat/download/",
475+
changelog_url="http://www.dest-unreach.org/socat/CHANGES"
474476
),
475477
HaproxyDependency(
476478
"haproxy",
@@ -499,7 +501,6 @@ def main() -> None:
499501
tagname_prefix="v",
500502
filename_suffix="",
501503
),
502-
# ttar (currently a submodule to https://github.com/jhunt/ttar, no new releases. Manual bump only.)
503504
]
504505

505506
write_private_yaml()

0 commit comments

Comments
 (0)