Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions tom/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class ChangelogGenerator:

repos_root = ".."
changelog_filenames = {
"core": "ChangeLog",
"enterprise": "ChangeLog.Enterprise",
"core": "CHANGELOG.md",
"enterprise": "CHANGELOG.md",
"masterfiles": "CHANGELOG.md",
}

Expand All @@ -57,7 +57,7 @@ def split_changelog_into_parts(self, changelog_filename, repo):
changelog_lines = changelog_file.splitlines()
for i in range(5):
# look for line having proper version
m = re.match("^([0-9]+\\.[0-9]+\\.[0-9]+):$", changelog_lines[i])
m = re.match("^## ([0-9]+\\.[0-9]+\\.[0-9]+)$", changelog_lines[i])
if m:
return (
"\n".join(changelog_lines[:i]),
Expand All @@ -68,8 +68,8 @@ def split_changelog_into_parts(self, changelog_filename, repo):
(
"Failed to find version in changelog "
+ "file, top 5 lines are: {}. Remember that version should be "
+ "three groups of numbers separated by dots and ending with "
+ 'colon, for example "3.12.0:"'
+ "three groups of numbers separated by dots and prefixed "
+ 'with a markdown h2 header, for example "## 3.12.0"'
).format(changelog_lines[:5])
)

Expand Down Expand Up @@ -143,8 +143,9 @@ def generate_changelog_in_repo(self, branch, repo):
new_changelog = self.get_changelog_for(name, "--repo", old_version, branch)
changelog_contents = (
header
+ "## "
+ new_version
+ ":\n"
+ "\n"
+ new_changelog
+ "\n"
+ old_changelog
Expand All @@ -159,11 +160,12 @@ def generate_changelog_in_repo(self, branch, repo):
"buildscripts", "--repo", old_version, branch
)
changelog_contents = (
new_version
+ ":\n"
"## "
+ new_version
+ "\n"
+ changelog_enterprise
+ "\n"
+ "\tPackaging changes:\\n"
+ "**Packaging changes:**\n"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In your changelog PR it looked like this part is buggy and inserts a backslash n. I don't know why.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was for 3.24? It used the previous old state of the script

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ changelog_buildscripts
+ "\n"
+ old_changelog
Expand Down
Loading