Skip to content

Automatically generate contributor list for releases#11120

Merged
stephenking314 merged 1 commit into
thunderbird:mainfrom
stephenking314:contributors
Jun 16, 2026
Merged

Automatically generate contributor list for releases#11120
stephenking314 merged 1 commit into
thunderbird:mainfrom
stephenking314:contributors

Conversation

@stephenking314

@stephenking314 stephenking314 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Contribution Summary

Generate contributor list and compare url for github release notes.

The goal of this change is to fully automate the generation of github release notes removing an error prone, tedious, manual step.

Additionally this includes a minor readability update for the render notes script.

Pipeline runs performed in fork repo. Note, there was no attempt to fully model the shippable builds pipeline in the private repo since this pipeline uses secrets for various task, and completion of these tasks was not necessary to exercise the desired code paths. See Release Bumps:Append Contributors for the important bits.
modeling a full release
modeling a beta release

AI Disclosure

Select one of the following (mandatory)

  • This contribution does not include any changes created or assisted by AI.
  • This contribution includes changes assisted by AI.
  • This contribution includes changes created by AI.

Contribution Checklist

  • I have read and affirm that my contribution adheres to Mozilla’s Community Participation Guidelines
  • This contribution is in Kotlin where possible
  • This contribution does not use merge commits
  • This contribution adheres to the existing codestyle (run gradlew spotlessCheck to check and gradlew spotlessApply to format your source code; will be checked by CI).
  • This contribution does not break existing unit tests (run gradlew testDebugUnitTest; will be checked by CI).
  • This contribution includes tests for any new functionality, and maintains tests for any updated functionality.
  • This PR has a descriptive title and body that accurately outlines all changes made, and contains a reference to any issues that it fixes (e.g. Closes #XXX or Fixes #XXX).

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Validation Passed: All report and feature-flag labels are correctly set.

@stephenking314 stephenking314 added the report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users). label Jun 8, 2026
@wmontwe

wmontwe commented Jun 9, 2026

Copy link
Copy Markdown
Member

@stephenking314 We're working on changing our in app changelog implementation. Please have a look at: RFC and technical design

TLDR, we want to get rid of the XML format and use a JSON version defined in the above docs. It should be closer to thunderbird-notes, but as YAML support on Kotlin is weak, we will use JSON.

Feel free to comment.

@stephenking314

Copy link
Copy Markdown
Contributor Author

@wmontwe Those changes seem reasonable and it shouldn't be a big impact to the notes generation since we use an xml template file to generate the current changelog used in the app. Switching over to use a json format should be simple, and we already have separate template files for github notes and the short form notes submitted to play store.
I'll give it a more thorough look over and leave any comments on the related issue.

Just a quick note about this PR, in case it isn't clear. This addition is only for the github release notes.

Comment thread scripts/ci/contributor_list.py Outdated
Comment on lines +38 to +55
def github_compare(repo, older, newer):
commits = []

url = f"https://api.github.com/repos/{repo}/compare/{older}...{newer}"

while True:
response = github_get(url)
data = response.json()

page_commits = data.get("commits", [])
commits.extend(page_commits)

if "next" in response.links:
url = response.links["next"]["url"]
else:
break

return commits

@kryoseu kryoseu Jun 10, 2026

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.

Probably not a big deal, but I believe the /compare API does not provide pagination. Instead the amount of commits is capped at 250, so this will always break at first iteration.

A way to confirm this is by running a compare against an old and recent tag:

curl -v https://api.github.com/repos/thunderbird/thunderbird-android/compare/THUNDERBIRD_12_1...THUNDERBIRD_20_0b2 > /tmp/git-compare.json

This has over 2.5k commits, but only 250 are returned.. No pagination.

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.

I was missing the hook to enable pagination, which is ?per_page=x. I actually had this earlier but accidentally dropped it while doing a refactor. What you pointed out is correct, without pagination the results are capped at 250 commits, which could end up cutting out contributors between major revisions.

Comment thread scripts/ci/contributor_list.py Outdated
Comment on lines +126 to +130
first_contributions = get_first_contributions(repo, contributors)

contributors = {f"@{author}" for author in contributors}
excludes = {'@dependabot[bot]', '@thunderbird-botmobile[bot]', '@weblate'}
contributors -= excludes

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.

Since we're excluding the bots after get_first_contributions(), is it possible we include bots as first contributors?

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.

Good call, might not be too likely we add a new bot, but if we do we'll want to be able to just add it to the list to exclude it.

for author, pr in first_contributions.items():
print(f"* @{author} made their first contribution in {pr}", file=f)

changelog = f"https://github.com/thunderbird/thunderbird-android/compare/{older}...{changelog_newer}"

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.

nit: hardcoded repo instead of {repo}.

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.

Yeah, that's cleaner. If we want to fully generalize still can. No need to pass around a parameter that will never change

kryoseu
kryoseu previously approved these changes Jun 10, 2026

@kryoseu kryoseu left a comment

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.

Added a few comments @stephenking314. None of those issues seem blocking, just some improvements worth noting.

Generate contributor list and compare url for github release notes.

The goal of this change is to fully automate the generation of github
releases removing an error prone, tedious, manual step.

Additionally this includes a minor readability update for the render
notes script.

@wmontwe wmontwe left a comment

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.

LGTM

@stephenking314 stephenking314 merged commit c959354 into thunderbird:main Jun 16, 2026
17 checks passed
@thunderbird-botmobile thunderbird-botmobile Bot added this to the Thunderbird 21 milestone Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

report: exclude Exclude changes from user-facing reports (internal, minor, or not relevant to users).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants