Skip to content

Commit

Permalink
contributing: Add monthly financial supporters to release notes (#3883)
Browse files Browse the repository at this point in the history
The generated release notes now contain members of supporters tier on Open Collective. We want to highlight financial contributions in the release notes. Monthly supporters seem like a fitting category in context of release. Current (draft) release notes are already updated.

The list is randomized when generated. Images are not included because that would require generating content for the missing images and making them circular (more work and circular did not work for me).

They are included under a heading at the end of highlights section, so not at the end, but not at the very beginning either.

Also: Specify number of highlight items. Add heading for new addons. Use title case. Use 'tools' not 'modules' for heading. Add requests as pip dependency to get the URL
  • Loading branch information
wenzeslaus authored Jun 18, 2024
1 parent 8566e31 commit 5591ec8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/additional_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Generate release notes using git log
run: |
python -m pip install PyYAML
python -m pip install PyYAML requests
# Git works without any special permissions.
# Using current branch or the branch against the PR is open.
# Using the last 30 commits (for branches, tags, and PRs).
Expand Down
24 changes: 23 additions & 1 deletion utils/generate_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
import csv
import itertools
import json
import random
import re
import subprocess
import sys
from collections import defaultdict
from pathlib import Path

import requests
import yaml

PRETTY_TEMPLATE = (
Expand Down Expand Up @@ -128,6 +130,20 @@ def binder_badge(tag):
return f"[![Binder]({binder_image_url})]({binder_url})"


def print_support(file=None):
url = "https://opencollective.com/grass/tiers/supporter/all.json"
response = requests.get(url=url)
data = response.json()
if data:
print_section_heading_3("Monthly Financial Supporters", file=file)
random.shuffle(data)
supporters = []
for member in data:
supporters.append(f"""[{member['name']}]({member['profile']})""")
print(", ".join(supporters))
print("")


def adjust_after(lines):
"""Adjust new contributor lines in the last part of the generated notes"""
bot_file = Path("utils") / "known_bot_names.txt"
Expand Down Expand Up @@ -170,7 +186,13 @@ def print_notes(
if before:
print(before)
print_section_heading_2("Highlights", file=file)
print("* _Put handcrafted list of items here._\n")
print("* _Put handcrafted list of 2-15 items here._\n")
print_section_heading_2("New Addon Tools", file=file)
print(
"* _Put here a list of new addos since last release "
"or delete the section if there are none._\n"
)
print_support(file=file)
print_section_heading_2("What's Changed", file=file)
changes_by_category = split_to_categories(changes, categories=categories)
print_by_category(changes_by_category, categories=categories, file=file)
Expand Down
2 changes: 1 addition & 1 deletion utils/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
notes:
categories:
- title: Modules
- title: Tools
regexp: '((d|db|g|i|m|ps|r|r3|t|v)\.[^ ]*)(, (d|db|g|i|m|ps|r|r3|t|v)\.[^ ]*)?: |(modules|tools|temporal): '

- title: Graphical User Interface
Expand Down

0 comments on commit 5591ec8

Please sign in to comment.