While preparing the v2.1.0 release, I stopped and asked myself how much time I actually spend on release notes. Reading back through commits, turning technical language into something a user would understand, then making the Japanese and English versions match: on a big release that alone takes an hour or two.
This post is the record of the small tool I built for that, which drafts bilingual release notes from git log. The first version, written in May 2026, used the old google-generativeai SDK and gemini-2.5-flash. Rereading it in November 2026, some of it no longer runs as written, so I have rewritten the whole thing around the current SDK and a safer way to pick the model.
It is written for someone who writes store release notes by hand every time and keeps their commit messages reasonably descriptive. By the end you should be able to produce a draft from your own repository.
The short answer
Let Gemini draft the notes, and keep the check before publishing for yourself. The machine writes the draft; I answer for what goes into the store. Why I did not automate the last step is in the caveats below.
Why the original code no longer works
| What the first version did | Where things stand now | What to do |
|---|---|---|
import google.generativeai as genai | The legacy SDK. The official quickstart has moved to google-genai | Use from google import genai |
genai.GenerativeModel("gemini-2.5-flash") | The 2.5 family shows no shutdown date in the official deprecations table, yet 404 reports have been coming in since July | Do not hard-code the model ID; read it from an environment variable |
| Asking for JSON in the prompt | Asking leaves room for a Markdown fence around the output | Constrain the shape with response_mime_type and a schema |
I wrote up how to read the 2.5 shutdown situation separately, and it is worth reading before you pin any model: Gemini 2.5 Flash returns 404 "no longer available" while the official table still shows no shutdown date.
Why git log is the right input
A commit message is first-hand evidence of what changed and why, written right after the change. It beats anything I reconstruct from memory on release day.
During v2.1.0 I had recorded, with reasons, an IndexOutOfBoundsException on the list screen, a startup problem on older devices after a library update, and a rework of the back-button ad flow. Turning that into user-facing language is a structured-to-structured conversion, which is squarely what language models do well.
The quality of your commit messages is the ceiling for the quality of your release notes. Keep that in mind before you run anything below.
The script (new SDK)
First, what I could and could not verify.
- Verified: the
git loghandling, the prompt that--dry-runprints, the error for a tag that does not exist, and thecheck()function that flags internal terms. I ran these in a throwaway repository. - Not verified: the API call inside
generate(). In the environment where I did this rewrite I did not run it against my own key through the new SDK. It follows the official documentation, but run--dry-runfirst and then one short tag range before trusting it.
Setup:
pip install google-genai
export GEMINI_API_KEY="YOUR_API_KEY"
# use an ID that appears in models.list (how to check is in the next section)
export RELEASE_NOTES_MODEL="gemini-3.6-flash"The script. The model ID comes from the environment, the output shape is constrained by a schema, and the result is checked mechanically for leaked internal terms.
#!/usr/bin/env python3
"""Draft store release notes (ja + en) from git log.
Usage:
export GEMINI_API_KEY=... # keep the key out of the code
export RELEASE_NOTES_MODEL=<a model id from models.list>
python release_notes.py v2.0.0 --version 2.1.0
python release_notes.py v2.0.0 --version 2.1.0 --dry-run # print the input, no API call
"""
import argparse
import json
import os
import re
import subprocess
import sys
MODEL = os.environ.get("RELEASE_NOTES_MODEL", "gemini-3.6-flash")
BANNED = re.compile(r"RecyclerView|Glide|NullPointer|IndexOutOfBounds|desugar|AGP|ViewModel|Exception", re.I)
MAX_BULLETS = 5
def get_commits(from_tag: str, to_ref: str = "HEAD") -> str:
r = subprocess.run(
["git", "log", f"{from_tag}..{to_ref}", "--no-merges", "--pretty=format:- %s%n%b"],
capture_output=True, text=True,
)
if r.returncode != 0:
sys.exit(f"git log failed: {r.stderr.strip()}")
return r.stdout.strip()
def build_prompt(commits: str, version: str) -> str:
return (
f"Below are the commit messages for app v{version}. "
"Write release notes for the store's What's New field in Japanese (ja) and English (en).\n"
"Rules:\n"
f"- Each language is an array of 3 to {MAX_BULLETS} strings\n"
"- Only changes a user can notice on screen\n"
"- No class names, library names or exception names\n"
"- Do not mention anything that is not in the commits\n\n"
f"Commits:\n{commits}\n"
)
def generate(commits: str, version: str) -> dict:
from google import genai # pip install google-genai
from google.genai import types
client = genai.Client() # reads GEMINI_API_KEY from the environment
resp = client.models.generate_content(
model=MODEL,
contents=build_prompt(commits, version),
config=types.GenerateContentConfig(
response_mime_type="application/json",
response_schema={
"type": "OBJECT",
"properties": {
"ja": {"type": "ARRAY", "items": {"type": "STRING"}},
"en": {"type": "ARRAY", "items": {"type": "STRING"}},
},
"required": ["ja", "en"],
},
),
)
return json.loads(resp.text)
def check(notes: dict) -> list[str]:
problems = []
for lang in ("ja", "en"):
items = notes.get(lang, [])
if not 1 <= len(items) <= MAX_BULLETS:
problems.append(f"{lang}: {len(items)} bullets")
for line in items:
if BANNED.search(line):
problems.append(f"{lang}: internal term left -> {line}")
return problems
if __name__ == "__main__":
ap = argparse.ArgumentParser()
ap.add_argument("from_tag")
ap.add_argument("--version", required=True)
ap.add_argument("--dry-run", action="store_true")
a = ap.parse_args()
commits = get_commits(a.from_tag)
if not commits:
sys.exit("No commits in range. Check the tag name: git tag -l")
if a.dry_run:
print(build_prompt(commits, a.version))
sys.exit(0)
notes = generate(commits, a.version)
for p in check(notes):
print("CHECK:", p, file=sys.stderr)
for lang in ("ja", "en"):
print(f"=== {lang} ===")
print("\n".join(f"・{x}" for x in notes[lang]))Three design choices matter here.
--dry-runcomes first. You see exactly what the model will receive before spending a call. Missing commits and wrong tags show up here.- The shape is enforced by a schema.
jaandenare arrays of strings, so you can count bullets before pasting. - A machine checks too. The
BANNEDpattern holds terms that actually leaked in my own project. Replace them with yours.
Usage:
python release_notes.py v2.0.0 --version 2.1.0 --dry-run
python release_notes.py v2.0.0 --version 2.1.0This is the --dry-run output from the throwaway repository (two commits):
Below are the commit messages for app v2.1.0. Write release notes for the store's What's New field in Japanese (ja) and English (en).
Rules:
- Each language is an array of 3 to 5 strings
- Only changes a user can notice on screen
- No class names, library names or exception names
- Do not mention anything that is not in the commits
Commits:
- Redesign back button ad gate
- Fix RecyclerView IndexOutOfBoundsException with defensive copy
list crashed on fast scroll
Do not hard-code the model ID
The first version had gemini-2.5-flash in the source. Today I would use an environment variable, because a model can stop working on a date different from the one in a table.
You can check which IDs your own key can see with models.list:
curl -s "https://generativelanguage.googleapis.com/v1beta/models?pageSize=200" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
| grep -o '"name": "models/[^"]*"' | sed 's|.*models/||; s|"$||' | sortPick a light, inexpensive Flash-tier model from that list and put it in RELEASE_NOTES_MODEL. As of November 2026, when I reread the official deprecations table, gemini-3.6-flash was listed as the replacement for gemini-2.0-flash. That table changes often, though. Trust the names your own key returns over the names in a table.
If you want to know what happens when you keep calling a retired model, I measured it: Retrying a retired model never showed up in success latency. It is useful when you design retries.
What came out, and what to check before pasting
In May, on about 40 commits from the v2.1.0 cycle, the old SDK with a 2.5-family model produced a draft like this:
• Fixed a rare crash that occurred while browsing wallpapers
• Resolved a display issue on older Android devices
• Improved responsiveness when switching between categories
• Made the home screen slideshow transition more smoothly
• Optimized certain animations
The line to doubt is the last one. "Optimized certain animations" may have no commit behind it, and it tells a user nothing. Find the commit it came from, and delete the line if you cannot. Pasting without checking can promise improvements you never made. That is the reason I keep a human read between the draft and the store.
Troubleshooting table
| Symptom | Likely cause | How to check | Fix |
|---|---|---|---|
json.loads fails | Output wrapped in a code fence, or an empty response | print(resp.text) and read the raw string | Set response_mime_type and a schema; do not rely on "JSON only" in the prompt |
| 404 "no longer available" | The model you named has been withdrawn | Does models.list show it for this key? | Point RELEASE_NOTES_MODEL at an ID from the list |
ModuleNotFoundError: google.genai | Only the legacy package is installed, or it went into another Python | python -m pip show google-genai | Run python -m pip install google-genai with the Python that runs the script |
git log says unknown revision | Wrong tag name, or a shallow clone without tags | git tag -l; in CI, is fetch-depth: 0 set? | Pass the right tag; fetch full history and tags in CI |
| Only one or two bullets | Too few commits, or only fix / update messages | Is the --dry-run input thin? | Pass several releases together; write the reason in the commit |
| A class name shows up in the output | The instruction about internal terms is too weak | The "CHECK" lines from check() | Add example terms to the prompt; fix by hand when one slips through |
Three common misconceptions
"Writing 'JSON only' in the prompt guarantees JSON." It usually works, but it is not a guarantee, and it is exactly what bit me in the first version. If you need the shape guaranteed, constrain it in the configuration. The official reference is Structured outputs.
"Short commits are fine, the model will fill the gaps." What it fills in can be facts that are not in your history. A draft looks good only when the input was careful.
"A Pro model always writes better notes." For this task the difference felt small to me and the price gap was the bigger factor. I did not run a controlled comparison, so if it matters to you, feed the same 40 commits to two models and count how many lines are pasteable.
Manual, semi-automatic or fully automatic
| Approach | Effort | Risk | Fits when |
|---|---|---|---|
| Write by hand every time | High (over an hour for me) | Forgetting things | A few releases a year, one language |
| Generate a draft, review it (this post) | Low (just the check) | Low | Several languages, a few releases a month |
| Generate and publish from CI | Lowest | Unfounded promises or mistranslations go straight to the store | Internal builds, where a mistake is easy to undo |
For store-facing text I pick the middle row. Release notes are a promise that users read after you publish.
The next hurdle: more languages
Once two languages run smoothly, the next wall is the number of languages. When I go beyond two, I find terms stay more consistent if I treat the confirmed Japanese and English as the source and translate in a separate call, rather than asking for everything at once.
Watch the character limits too. Each store limits the What's New field per language, and Google Play's is on the short side. These numbers change, so check the current value in the official help and add a length check to check().
What to do next
Run --dry-run from your last tag to today. The input the model receives mirrors the quality of your own commits. Wherever you think "I could not write notes from this," that is the commit message to improve next time.
After that, call the API once on a short tag range. That is the order I plan to follow on my next release.