Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(readme): show every person who shipped on the contributor wall (#1185)

Ruben Lütked70ada4fbf1e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ac17e983ee..4143dffa9a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,12 @@ versioning per [SemVer](https://semver.org/).
## [Unreleased]
+### Fixed
+
+- The README contributor wall shows everyone who has shipped work. People whose
+ git email GitHub never linked to an account are named, and a pull request
+ author appears even when the contributors index has not caught up yet.
+
### Changed
- The small-machine vision download is `qwen3-vl:2b-instruct` (1.9 GB, refreshed
diff --git a/README.md b/README.md
index e05cc197a5..f0f5407516 100644
--- a/README.md
+++ b/README.md
@@ -171,7 +171,9 @@ A star on GitHub helps other people find Dodaios. Sponsors are listed in [SPONSO
<!-- contributors:start -->
-<a href="https://github.com/rubenluetke10-beep"><img src="https://avatars.githubusercontent.com/u/226271791?v=4&s=48" width="48" height="48" alt="rubenluetke10-beep"></a> <a href="https://github.com/dannyward630"><img src="https://avatars.githubusercontent.com/u/71604164?v=4&s=48" width="48" height="48" alt="dannyward630"></a> <a href="https://github.com/ANO3457"><img src="https://avatars.githubusercontent.com/u/187025195?v=4&s=48" width="48" height="48" alt="ANO3457"></a> <a href="https://github.com/Idee-Wird-App"><img src="https://avatars.githubusercontent.com/u/330157118?v=4&s=48" width="48" height="48" alt="Idee-Wird-App"></a> <a href="https://github.com/jaydenhawkes123"><img src="https://avatars.githubusercontent.com/u/7899343?v=4&s=48" width="48" height="48" alt="jaydenhawkes123"></a> <a href="https://github.com/CodeByPeace"><img src="https://avatars.githubusercontent.com/u/228503734?v=4&s=48" width="48" height="48" alt="CodeByPeace"></a> <a href="https://github.com/tianxingjian2406"><img src="https://avatars.githubusercontent.com/u/247943876?v=4&s=48" width="48" height="48" alt="tianxingjian2406"></a> <a href="https://github.com/Uddoo"><img src="https://avatars.githubusercontent.com/u/19704816?v=4&s=48" width="48" height="48" alt="Uddoo"></a> <a href="https://github.com/alibaba080290"><img src="https://avatars.githubusercontent.com/u/59247334?v=4&s=48" width="48" height="48" alt="alibaba080290"></a> <!-- i18n-allow -->
+<a href="https://github.com/rubenluetke10-beep"><img src="https://avatars.githubusercontent.com/u/226271791?v=4&s=48" width="48" height="48" alt="rubenluetke10-beep"></a> <a href="https://github.com/dannyward630"><img src="https://avatars.githubusercontent.com/u/71604164?v=4&s=48" width="48" height="48" alt="dannyward630"></a> <a href="https://github.com/dennisheidederamirez-coder"><img src="https://avatars.githubusercontent.com/u/338621144?v=4&s=48" width="48" height="48" alt="dennisheidederamirez-coder"></a> <a href="https://github.com/ANO3457"><img src="https://avatars.githubusercontent.com/u/187025195?v=4&s=48" width="48" height="48" alt="ANO3457"></a> <a href="https://github.com/PilarJ"><img src="https://avatars.githubusercontent.com/u/2921746?v=4&s=48" width="48" height="48" alt="PilarJ"></a> <a href="https://github.com/CodeByPeace"><img src="https://avatars.githubusercontent.com/u/228503734?v=4&s=48" width="48" height="48" alt="CodeByPeace"></a> <a href="https://github.com/Idee-Wird-App"><img src="https://avatars.githubusercontent.com/u/330157118?v=4&s=48" width="48" height="48" alt="Idee-Wird-App"></a> <a href="https://github.com/jaydenhawkes123"><img src="https://avatars.githubusercontent.com/u/7899343?v=4&s=48" width="48" height="48" alt="jaydenhawkes123"></a> <a href="https://github.com/alibaba080290"><img src="https://avatars.githubusercontent.com/u/59247334?v=4&s=48" width="48" height="48" alt="alibaba080290"></a> <a href="https://github.com/tianxingjian2406"><img src="https://avatars.githubusercontent.com/u/247943876?v=4&s=48" width="48" height="48" alt="tianxingjian2406"></a> <!-- i18n-allow -->
+<a href="https://github.com/Uddoo"><img src="https://avatars.githubusercontent.com/u/19704816?v=4&s=48" width="48" height="48" alt="Uddoo"></a> <!-- i18n-allow -->
+Commits not linked to a GitHub account: <a href="https://github.com/search?q=repo%3ADodaios%2FDodaios%20author-name%3A%22Joana%20L%C3%BCtke%22&type=commits">Joana Lütke</a> (14) · <a href="https://github.com/search?q=repo%3ADodaios%2FDodaios%20author-name%3A%22Harald%20Herz%22&type=commits">Harald Herz</a> (13) <!-- i18n-allow -->
<!-- contributors:end -->
diff --git a/scripts/ci/update_contributors.py b/scripts/ci/update_contributors.py
index bbb37e202b..d97d8c198f 100644
--- a/scripts/ci/update_contributors.py
+++ b/scripts/ci/update_contributors.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-"""Regenerate the README's contributor avatar wall from the GitHub API.
+"""Regenerate the README's contributor wall from the GitHub API.
The wall lives between two HTML comment markers in ``README.md`` so the rest of
the file is never touched:
@@ -11,11 +11,23 @@ the file is never touched:
Run it with no arguments to rewrite the block in place, or with ``--check`` to
fail when the block is stale (that is the CI mode).
-Two kinds of entries are deliberately excluded, both of which would otherwise
-credit somebody who never worked on this project:
+Three sources are merged, because any one of them hides people:
-* GitHub Apps and bots (``type == "Bot"``, or a ``[bot]`` suffix) - Dependabot
- opening dependency bumps is not a contributor.
+* The contributors API lists commit authors on the default branch. It lags a
+ merge by minutes to hours, so the refresh that runs the moment a pull
+ request lands used to report "up to date" and leave the new person off.
+* Merged pull requests name the GitHub account that opened them, which is
+ known the instant the pull request merges.
+* Commits whose email GitHub could not link to an account come back as
+ anonymous names. When every merged pull request with that git name was
+ opened by one account, the commits are credited to that account. Otherwise
+ the name is written out. The email is never written: those addresses are
+ local hostnames, and putting them on the README would publish them.
+
+Two kinds of accounts are deliberately excluded:
+
+* GitHub Apps and bots (``type == "Bot"``, a ``[bot]`` suffix, or an
+ ``app/`` login). Dependabot opening dependency bumps is not a contributor.
* The accounts in ``EXCLUDED_LOGINS``. ``Co-Authored-By: Claude
<[email protected]>`` trailers are attributed by GitHub to whichever
account happens to own that address, which is a stranger to this repository.
@@ -23,17 +35,21 @@ credit somebody who never worked on this project:
person, and it presents an AI trailer as a human contributor.
Requires no dependencies. A token is optional but lifts the rate limit: the
-script reads ``GITHUB_TOKEN`` (set for free inside GitHub Actions) and falls
-back to an unauthenticated request.
+script reads ``GITHUB_TOKEN`` (set for free inside GitHub Actions). With no
+token it asks the ``gh`` CLI, which already holds a login on a developer
+machine, and only then falls back to an unauthenticated request.
"""
from __future__ import annotations
import argparse
+import html
import json
import os
+import subprocess
import sys
import urllib.error
+import urllib.parse
import urllib.request
from pathlib import Path
@@ -55,63 +71,288 @@ AVATAR_PX = 48
#: Inline marker that scripts/ci/check_no_new_german.py skips.
LANGUAGE_GATE_ESCAPE = "i18n-allow"
+_PR_QUERY = """
+query($cursor: String) {
+ repository(owner: "Dodaios", name: "Dodaios") {
+ pullRequests(states: MERGED, first: 100, after: $cursor) {
+ pageInfo { hasNextPage endCursor }
+ nodes {
+ author {
+ login
+ __typename
+ ... on User { avatarUrl }
+ }
+ mergeCommit {
+ author { name }
+ }
+ }
+ }
+ }
+}
+"""
+
-def fetch_contributors() -> list[dict]:
- """Every human contributor, most commits first."""
+def _headers() -> dict[str, str]:
+ headers = {
+ "Accept": "application/vnd.github+json",
+ "User-Agent": "dodaios-contributors",
+ }
+ token = os.environ.get("GITHUB_TOKEN")
+ if token:
+ headers["Authorization"] = f"Bearer {token}"
+ return headers
+
+
+def _read_json_with_gh(req: urllib.request.Request) -> object:
+ """Use the ``gh`` login when no ``GITHUB_TOKEN`` is set.
+
+ ``gh api`` reads credentials from the user's own keyring. The token never
+ enters this process or the README.
+ """
+ cmd = ["gh", "api", "--method", req.get_method(), req.full_url]
+ if req.data:
+ # `--input -` is what makes gh treat stdin as the request body.
+ cmd.extend(["--input", "-"])
+ env = os.environ.copy()
+ # gh colors JSON when it thinks stdout is a terminal, which is not JSON.
+ env["NO_COLOR"] = "1"
+ env["GH_FORCE_TTY"] = "0"
+ proc = subprocess.run( # noqa: S603 - fixed argv, URL built from REPO
+ cmd,
+ input=req.data,
+ capture_output=True,
+ check=False,
+ env=env,
+ )
+ if proc.returncode != 0:
+ detail = proc.stderr.decode("utf-8", "replace").strip()[:400]
+ raise SystemExit(f"gh api failed ({proc.returncode}): {detail}")
+ return json.loads(proc.stdout.decode("utf-8"))
+
+
+def _read_json(req: urllib.request.Request) -> object:
+ if not os.environ.get("GITHUB_TOKEN"):
+ return _read_json_with_gh(req)
+ try:
+ # noqa justification: callers build the URL from the REPO constant or
+ # post to the fixed GitHub GraphQL endpoint. No custom scheme can reach
+ # here.
+ with urllib.request.urlopen(req, timeout=60) as resp: # noqa: S310
+ return json.load(resp)
+ except urllib.error.HTTPError as exc: # pragma: no cover - network path
+ raise SystemExit(f"GitHub API returned {exc.code}: {exc.reason}") from exc
+
+
+def _keep(login: str, type_: str | None) -> bool:
+ """Humans only. Bots and the mis-attributed co-author account stay off."""
+ if not login or type_ == "Bot" or login.endswith("[bot]") or login.startswith("app/"):
+ return False
+ return login not in EXCLUDED_LOGINS
+
+
+def fetch_commit_contributors() -> list[dict]:
+ """Commit authors on the default branch, including anonymous git names."""
people: list[dict] = []
page = 1
- while True:
- url = f"https://api.github.com/repos/{REPO}/contributors?per_page=100&page={page}"
- req = urllib.request.Request(
- url,
- headers={
- "Accept": "application/vnd.github+json",
- "User-Agent": "dodaios-contributors",
- },
- )
- token = os.environ.get("GITHUB_TOKEN")
- if token:
- req.add_header("Authorization", f"Bearer {token}")
- try:
- # noqa justification: the URL is a literal https constant built from
- # REPO above, never user input, so no custom scheme can reach here.
- with urllib.request.urlopen(req, timeout=30) as resp: # noqa: S310
- batch = json.load(resp)
- except urllib.error.HTTPError as exc: # pragma: no cover - network path
- raise SystemExit(f"GitHub API returned {exc.code}: {exc.reason}") from exc
- if not batch:
+ while page <= 20:
+ url = f"https://api.github.com/repos/{REPO}/contributors?per_page=100&page={page}&anon=true"
+ # S310: URL is the GitHub API built from the REPO constant, never user input.
+ batch = _read_json(urllib.request.Request(url, headers=_headers())) # noqa: S310
+ if not isinstance(batch, list) or not batch:
break
- people.extend(batch)
+ people.extend(p for p in batch if isinstance(p, dict))
if len(batch) < 100:
break
page += 1
+ return people
- return [
- p
- for p in people
- if p.get("type") != "Bot"
- and not p.get("login", "").endswith("[bot]")
- and p.get("login") not in EXCLUDED_LOGINS
- ]
+
+def fetch_merged_pull_authors() -> list[dict]:
+ """One entry per human who merged a pull request.
+
+ ``contributions`` is the number of merged pull requests. ``git_names`` are
+ the git author names on those merge commits, so commits GitHub stored
+ under a local email can be attached to the account that opened the pull
+ request.
+ """
+ by_login: dict[str, dict] = {}
+ cursor: str | None = None
+ for _ in range(20):
+ payload = _read_json(
+ urllib.request.Request(
+ "https://api.github.com/graphql",
+ data=json.dumps({"query": _PR_QUERY, "variables": {"cursor": cursor}}).encode(),
+ headers={**_headers(), "Content-Type": "application/json"},
+ method="POST",
+ )
+ )
+ if not isinstance(payload, dict) or payload.get("errors"):
+ detail = repr(payload)[:400]
+ raise SystemExit(f"GitHub GraphQL returned errors: {detail}")
+ connection = payload["data"]["repository"]["pullRequests"]
+ for node in connection["nodes"] or []:
+ author = node.get("author") or {}
+ if author.get("__typename") != "User":
+ continue
+ login = author.get("login") or ""
+ if not _keep(login, "User"):
+ continue
+ entry = by_login.get(login)
+ if entry is None:
+ entry = {
+ "login": login,
+ "avatar_url": author.get("avatarUrl") or "",
+ "type": "User",
+ "contributions": 0,
+ "git_names": set(),
+ }
+ by_login[login] = entry
+ entry["contributions"] += 1
+ merge = node.get("mergeCommit") or {}
+ git_name = ((merge.get("author") or {}).get("name") or "").strip()
+ if git_name:
+ entry["git_names"].add(git_name)
+ info = connection["pageInfo"]
+ if not info.get("hasNextPage"):
+ break
+ nxt = info.get("endCursor")
+ if not nxt or nxt == cursor:
+ break
+ cursor = nxt
+ return list(by_login.values())
+
+
+def combine(commit_people: list[dict], pr_people: list[dict]) -> list[dict]:
+ """Every human who shipped something, most work first.
+
+ A GitHub account is ranked by its commit count, or by its merged pull
+ request count when the contributors index has not listed it yet. Anonymous
+ git names fold into an account when exactly one merged-pull-request author
+ used that name. Names that fold nowhere stay, without their email.
+ """
+ users: dict[str, dict] = {}
+ for person in commit_people:
+ if person.get("type") == "Anonymous":
+ continue
+ login = person.get("login") or ""
+ if not _keep(login, person.get("type")):
+ continue
+ users[login] = {
+ "login": login,
+ "avatar_url": person.get("avatar_url") or "",
+ "contributions": int(person.get("contributions") or 0),
+ }
+
+ name_to_logins: dict[str, set[str]] = {}
+ for person in pr_people:
+ login = person.get("login") or ""
+ if not _keep(login, person.get("type") or "User"):
+ continue
+ pr_count = int(person.get("contributions") or 0)
+ entry = users.get(login)
+ if entry is None:
+ users[login] = {
+ "login": login,
+ "avatar_url": person.get("avatar_url") or "",
+ "contributions": pr_count,
+ }
+ else:
+ if not entry["avatar_url"]:
+ entry["avatar_url"] = person.get("avatar_url") or ""
+ # A squash is one commit and one pull request. Adding the two
+ # would rank the same work twice, so the larger figure wins.
+ entry["contributions"] = max(entry["contributions"], pr_count)
+ for git_name in person.get("git_names") or []:
+ cleaned = str(git_name).strip()
+ if cleaned:
+ name_to_logins.setdefault(cleaned, set()).add(login)
+
+ anon_counts: dict[str, int] = {}
+ for person in commit_people:
+ if person.get("type") != "Anonymous":
+ continue
+ name = str(person.get("name") or "").strip()
+ if not name:
+ continue
+ anon_counts[name] = anon_counts.get(name, 0) + int(person.get("contributions") or 0)
+
+ names: list[dict] = []
+ for name, count in anon_counts.items():
+ logins = name_to_logins.get(name, set())
+ if len(logins) == 1:
+ entry = users.get(next(iter(logins)))
+ if entry is not None:
+ entry["contributions"] = max(entry["contributions"], count)
+ continue
+ names.append({"name": name, "contributions": count})
+
+ people = list(users.values()) + names
+ people.sort(
+ key=lambda person: (
+ -int(person.get("contributions") or 0),
+ (person.get("login") or person.get("name") or "").lower(),
+ )
+ )
+ return people
+
+
+def fetch_contributors() -> list[dict]:
+ """Every human who shipped something here, most work first."""
+ return combine(fetch_commit_contributors(), fetch_merged_pull_authors())
+
+
+def _avatar_src(url: str) -> str:
+ join = "&" if "?" in url else "?"
+ return f"{url}{join}s={AVATAR_PX}"
+
+
+def _user_cell(person: dict) -> str:
+ login = person["login"]
+ safe = html.escape(login, quote=True)
+ return (
+ f'<a href="https://github.com/{safe}">'
+ f'<img src="{_avatar_src(person.get("avatar_url") or "")}" '
+ f'width="{AVATAR_PX}" height="{AVATAR_PX}" alt="{safe}"></a>'
+ )
+
+
+def _name_cell(person: dict) -> str:
+ """A person GitHub could not link to an account. No email in the markup."""
+ name = str(person.get("name") or "").strip()
+ safe = html.escape(name, quote=True)
+ query = urllib.parse.quote(f'repo:{REPO} author-name:"{name}"', safe="")
+ href = f"https://github.com/search?q={query}&type=commits"
+ count = int(person.get("contributions") or 0)
+ return f'<a href="{href}">{safe}</a> ({count})'
+
+
+def _marked(line: str) -> str:
+ # GitHub logins and real names are not prose: a login or a name made of
+ # German words must not trip the output-language gate, so every row
+ # carries its escape marker.
+ return line + f" <!-- {LANGUAGE_GATE_ESCAPE} -->"
def render(people: list[dict]) -> str:
- """The avatar wall, one row per ``PER_ROW`` people."""
+ """Avatars for accounts, then the names GitHub could not link.
+
+ Accounts stay a grid of ``PER_ROW`` so the wall wraps the way it always
+ has. People with no account follow, most work first, with the commit
+ count in parentheses. Their emails are not part of the line.
+ """
if not people:
return "_Nobody yet. That first square is yours._"
- cells = [
- f'<a href="https://github.com/{p["login"]}">'
- f'<img src="{p["avatar_url"]}&s={AVATAR_PX}" '
- f'width="{AVATAR_PX}" height="{AVATAR_PX}" alt="{p["login"]}"></a>'
- for p in people
- ]
- # GitHub logins are names, not prose: a login made of German words must not
- # trip the output-language gate, so every row carries its escape marker.
+ accounts = [person for person in people if person.get("login")]
+ named = [person for person in people if not person.get("login")]
rows = [
- " ".join(cells[i : i + PER_ROW]) + f" <!-- {LANGUAGE_GATE_ESCAPE} -->"
- for i in range(0, len(cells), PER_ROW)
+ _marked(" ".join(_user_cell(person) for person in accounts[i : i + PER_ROW]))
+ for i in range(0, len(accounts), PER_ROW)
]
+ for i in range(0, len(named), PER_ROW):
+ chunk = named[i : i + PER_ROW]
+ body = " · ".join(_name_cell(person) for person in chunk)
+ rows.append(_marked(f"Commits not linked to a GitHub account: {body}"))
return "\n".join(rows)
diff --git a/tests/unit/ci/test_update_contributors_language_gate.py b/tests/unit/ci/test_update_contributors_language_gate.py
index 59c9892a8f..ec1416aca2 100644
--- a/tests/unit/ci/test_update_contributors_language_gate.py
+++ b/tests/unit/ci/test_update_contributors_language_gate.py
@@ -43,3 +43,100 @@ def test_every_row_carries_the_escape_marker() -> None:
assert len(rows) == 3
assert all(row.endswith("<!-- i18n-allow -->") for row in rows)
+
+
+def test_user_cell_keeps_the_avatar_markup() -> None:
+ block = update_contributors.render(
+ [{"login": "octocat", "avatar_url": "https://avatars.example/octocat?v=4"}]
+ )
+
+ assert block == (
+ '<a href="https://github.com/octocat">'
+ '<img src="https://avatars.example/octocat?v=4&s=48" '
+ 'width="48" height="48" alt="octocat"></a> <!-- i18n-allow -->'
+ )
+
+
+def test_wall_includes_pull_authors_and_unlinked_names_without_emails() -> None:
+ commits = [
+ {
+ "login": "rubenluetke10-beep",
+ "avatar_url": "https://avatars.example/r?v=4",
+ "type": "User",
+ "contributions": 100,
+ },
+ {
+ "login": "dependabot[bot]",
+ "type": "Bot",
+ "contributions": 20,
+ "avatar_url": "https://avatars.example/bot",
+ },
+ {
+ "login": "claude",
+ "type": "User",
+ "contributions": 2,
+ "avatar_url": "https://avatars.example/claude",
+ },
+ {
+ "type": "Anonymous",
+ "name": "Joana Lütke", # i18n-allow
+ "email": "[email protected]",
+ "contributions": 14,
+ },
+ {
+ "type": "Anonymous",
+ "name": "Dennis Heide de Ramirez",
+ "email": "one@local",
+ "contributions": 6,
+ },
+ {
+ "type": "Anonymous",
+ "name": "Dennis Heide de Ramirez",
+ "email": "two@local",
+ "contributions": 2,
+ },
+ ]
+ pull_authors = [
+ {
+ "login": "PilarJ",
+ "avatar_url": "https://avatars.example/p?v=4",
+ "type": "User",
+ "contributions": 3,
+ "git_names": ["Jakub Pilař"],
+ },
+ {
+ "login": "dennisheidederamirez-coder",
+ "avatar_url": "https://avatars.example/d?v=4",
+ "type": "User",
+ "contributions": 1,
+ "git_names": ["Dennis Heide de Ramirez"],
+ },
+ {
+ "login": "app/dependabot",
+ "type": "Bot",
+ "contributions": 9,
+ "git_names": [],
+ },
+ ]
+
+ people = update_contributors.combine(commits, pull_authors)
+ shown = [person.get("login") or person.get("name") for person in people]
+
+ assert shown == [
+ "rubenluetke10-beep",
+ "Joana Lütke", # i18n-allow
+ "dennisheidederamirez-coder",
+ "PilarJ",
+ ]
+ assert people[2]["contributions"] == 8
+
+ block = update_contributors.render(people)
+ assert "secret@joanas-mbp" not in block
+ assert "one@local" not in block
+ assert "claude" not in block
+ assert "dependabot" not in block
+ assert "Commits not linked to a GitHub account: " in block
+ assert "Joana Lütke" in block # i18n-allow
+ assert "PilarJ" in block
+ added = [("README.md", n, line) for n, line in enumerate(block.splitlines(), start=1)]
+ assert check_no_new_german.find_violations(added, []) == []