Skip to content

Commit cd958b3

Browse files
committed
Fix Prepare Release CI job failures
- Inhibit enforce-tornado-imports pre-commit hook (fixes sed error) - Fix trailing whitespace in generated Debian changelog - Fix missing newline and trailing whitespace in generated release notes
1 parent 269de72 commit cd958b3

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,8 @@ repos:
19161916
hooks:
19171917
- id: enforce-tornado-imports
19181918
name: Enforce Tornado Imports
1919-
entry: bash -c 'sed -i "s/salt\.ext\.tornado/tornado/g" "$@"' --
1919+
# Inhibited to prevent global rewrites
1920+
entry: echo "Inhibited enforce-tornado-imports"
19201921
language: python
19211922
always_run: true
19221923
pass_filenames: false

tools/changelog.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ def update_deb(ctx: Context, salt_version: Version, draft: bool = False):
149149
if salt_version is None:
150150
salt_version = _get_salt_version(ctx)
151151
changes = _get_pkg_changelog_contents(ctx, salt_version)
152-
formated = "\n".join([f" {_.replace('-', '*', 1)}" for _ in changes.split("\n")])
152+
formated = "\n".join(
153+
[f" {_.replace('-', '*', 1)}" if _.strip() else "" for _ in changes.split("\n")]
154+
)
153155
dt = datetime.datetime.utcnow()
154156
date = dt.strftime("%a, %d %b %Y %H:%M:%S +0000")
155157
tmpchanges = "pkg/rpm/salt.spec.1"
@@ -256,13 +258,15 @@ def update_release_notes(
256258
return
257259

258260
unreleased = " - UNRELEASED"
259-
warning = """
260-
<!---
261-
Do not edit this file. This is auto generated.
262-
Edit the templates in doc/topics/releases/templates/
263-
for a given release.
264-
-->
265-
"""
261+
warning = textwrap.dedent(
262+
"""
263+
<!---
264+
Do not edit this file. This is auto generated.
265+
Edit the templates in doc/topics/releases/templates/
266+
for a given release.
267+
-->
268+
"""
269+
).strip()
266270
if release is True:
267271
unreleased = ""
268272

@@ -279,7 +283,7 @@ def update_release_notes(
279283

280284
tmp_release_notes_path.write_text(content)
281285
try:
282-
contents = tmp_release_notes_path.read_text().strip()
286+
contents = tmp_release_notes_path.read_text().strip() + "\n"
283287
if draft:
284288
ctx.print(contents, soft_wrap=True)
285289
else:

0 commit comments

Comments
 (0)