Skip to content

Commit ac396ac

Browse files
authored
CLOUDP-295785 - remove title from changelog file generator (#451)
# Summary Based on discussions we had [here](https://mongodb.slack.com/archives/CGLP6R2PQ/p1757923176704559?thread_ts=1757920788.967209&cid=CGLP6R2PQ) we have decided to drop `title` from changelog files frontmatter. This gives false assumption that it will be included in the final Release Notes, which is not the case. Additionally `title` didn't have any meaningful usage. Now it will be added as initial contents of the file and dropped from frontmatter. ## Proof of Work Creating a changelog after updating: ``` (venv) ➜ mongodb-kubernetes git:(maciejk/ar-changelog-remove-title) python3 -m scripts.release.create_changelog -k feature "Test something that is very long title about some feature" -e Created changelog entry at: /Users/maciej.karas/mongodb/mongodb-kubernetes/changelog/20250915_feature_test_something_that_is_very_long_title_about_some.md (venv) ➜ mongodb-kubernetes git:(maciejk/ar-changelog-remove-title) ✗ cat changelog/20250915_feature_test_something_that_is_very_long_title_about_some.md --- kind: feature date: 2025-09-15 --- * Test something that is very long title about some feature (venv) ➜ mongodb-kubernetes git:(maciejk/ar-changelog-remove-title) python3 -m scripts.release.release_notes --initial-version 1.2.0 # MCK 1.4.0 Release Notes ## New Features * Some feature that is properly described with full context ``` ## Checklist - [x] Have you linked a jira ticket and/or is the ticket in the title? - [x] Have you checked whether your jira ticket required DOCSP changes? - [x] Have you added changelog file? - use `skip-changelog` label if not needed - refer to [Changelog files and Release Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes) section in CONTRIBUTING.md for more details
1 parent 4bcba59 commit ac396ac

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Each Pull Request usually has a changelog file that describes the changes made i
1818
Changelog files are placed in the `changelog/` directory and used to generate the Release Notes for the
1919
upcoming release. Preview of the Release Notes is automatically added as comment to each Pull Request.
2020
The changelog file needs to follow the naming convention
21-
`YYYYMMDD-<change_kind>-<short-description>.md`. To create changelog file please use the
21+
`YYYYMMDD-<change_kind>-<short-title>.md`. To create changelog file please use the
2222
`scripts/release/create_changelog.py` script. Example usage:
2323

2424
```console
@@ -34,7 +34,7 @@ usage: create_changelog.py [-h] [-c ] [-d ] [-e] -k title
3434
Utility to easily create a new changelog entry file.
3535

3636
positional arguments:
37-
title Title for the changelog entry
37+
title Title used in changelog filename and passed as initial file contents
3838

3939
options:
4040
-h, --help show this help message and exit

scripts/release/changelog.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ def from_str(kind_str: str) -> "ChangeKind":
3535

3636

3737
class ChangeEntry:
38-
def __init__(self, date: datetime, kind: ChangeKind, title: str, contents: str):
38+
def __init__(self, date: datetime, kind: ChangeKind, contents: str):
3939
self.date = date
4040
self.kind = kind
41-
self.title = title
4241
self.contents = contents
4342

4443

@@ -129,7 +128,7 @@ def extract_changelog_entry_from_contents(file_contents: str) -> ChangeEntry:
129128
## Add newline to contents so the Markdown file also contains a newline at the end
130129
contents = data.content + "\n"
131130

132-
return ChangeEntry(date=date, title=str(data["title"]), kind=kind, contents=contents)
131+
return ChangeEntry(date=date, kind=kind, contents=contents)
133132

134133

135134
def get_changelog_filename(title: str, kind: ChangeKind, date: datetime) -> str:

scripts/release/create_changelog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
- '{str(ChangeKind.FIX)}' for bugfix entries
5454
- '{str(ChangeKind.OTHER)}' for other entries""",
5555
)
56-
parser.add_argument("title", type=str, help="Title for the changelog entry")
56+
parser.add_argument("title", type=str, help="Title used in changelog filename and passed as initial file contents")
5757
args = parser.parse_args()
5858

5959
title = args.title
@@ -72,10 +72,10 @@
7272
with open(changelog_path, "w") as f:
7373
# Add frontmatter based on args
7474
f.write("---\n")
75-
f.write(f"title: {title}\n")
7675
f.write(f"kind: {str(kind)}\n")
7776
f.write(f"date: {date_str}\n")
7877
f.write("---\n\n")
78+
f.write(f"* {title}\n")
7979

8080
if args.editor:
8181
editor = os.environ.get("EDITOR", "vi") # Fallback to vim if EDITOR is not set

scripts/release/tests/changelog_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def test_strip_changelog_entry_frontmatter():
6969

7070
change_entry = extract_changelog_entry_from_contents(file_contents)
7171

72-
assert change_entry.title == "This is my change"
7372
assert change_entry.kind == ChangeKind.FEATURE
7473
assert change_entry.date == datetime.date(2025, 7, 10)
7574
assert (

0 commit comments

Comments
 (0)