Skip to content

Commit

Permalink
contributing: Hide bots from release notes (OSGeo#3829)
Browse files Browse the repository at this point in the history
This hides all changes by recognized bots from release notes. The changes may still be relevant, e.g., change of version of dependency in a Docker image, so they are hidden but discoverable using Markdown details HTML tag.

Additionally, to make the release notes shorter, this shows only 20 items and hides the rest together with the changes from bots. The overflowing changes are printed first, then the ones from bots. Each group is sorted alphabetically.
  • Loading branch information
wenzeslaus authored and a0x8o committed Jun 17, 2024
1 parent d1cb474 commit fe7a666
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions utils/generate_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import argparse
import csv
import itertools
import json
import re
import subprocess
Expand Down Expand Up @@ -113,6 +114,7 @@ def print_category(category, changes, file=None):
=======
>>>>>>> osgeo-main
print_section_heading_3(category, file=file)
<<<<<<< HEAD
=======
print(f"### {category}", file=file)
>>>>>>> 6cf60c76a4 (wxpyimgview: explicit conversion to int (#2704))
Expand All @@ -126,8 +128,30 @@ def print_category(category, changes, file=None):
>>>>>>> osgeo-main
=======
>>>>>>> osgeo-main
=======
bot_file = Path("utils") / "known_bot_names.txt"
known_bot_names = bot_file.read_text().splitlines()
visible = []
hidden = []
overflow = []
max_section_length = 25
>>>>>>> eb39403b39 (contributing: Hide bots from release notes (#3829))
for item in sorted(items):
author = item.rsplit(" by ", maxsplit=1)[-1]
if author in known_bot_names or author.endswith("[bot]"):
hidden.append(item)
elif len(visible) > max_section_length:
overflow.append(item)
else:
visible.append(item)
for item in visible:
print(f"* {item}", file=file)
if hidden:
print("\n<details>")
print(" <summary>Show more</summary>\n")
for item in itertools.chain(overflow, hidden):
print(f" * {item}", file=file)
print("\n</details>")
print("")


Expand Down
1 change: 1 addition & 0 deletions utils/known_bot_names.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
osgeoweblate

0 comments on commit fe7a666

Please sign in to comment.