From 97a6c7f2fc22f6435cd8268bf8c31ad7d13b11f4 Mon Sep 17 00:00:00 2001 From: SDNick484 Date: Tue, 10 Nov 2026 14:36:03 -0800 Subject: [PATCH] sync_all_siblings: sync commits always carry the account's name, not the local one _commit_env forced the noreply e-mail but kept the local git user.name whenever one was set, so sync commits went out as . The siblings are public and their convention is no personal names in commits either; steam-backlog's privacy scan checks commit authors against a denylist and now fails on main over the previous round's sync commit. Author and committer are now always SDNick484 and its noreply address. Refs #16 Co-Authored-By: Claude Opus 5.5 --- scripts/sync_all_siblings.py | 21 +++++++++++---------- tests/test_sync_all_siblings.py | 5 +++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/sync_all_siblings.py b/scripts/sync_all_siblings.py index 0ccd3aa..9f90124 100644 --- a/scripts/sync_all_siblings.py +++ b/scripts/sync_all_siblings.py @@ -36,8 +36,9 @@ SHARED_REPO_NAME = "mcp-server-shared" LOCK_FILE = "shared.lock" -# The GitHub account the siblings live under. Its noreply address is the commit e-mail -# the portfolio uses, so sync commits carry it whatever the local git config says. +# The GitHub account the siblings live under. Sync commits are authored as the account and +# its noreply address, whatever the local git config says: the siblings are public, and a +# real name in a commit is as public as one in a file (a sibling's privacy scan checks both). OWNER = "SDNick484" COMMIT_EMAIL = f"{OWNER}@users.noreply.github.com" SSH_REMOTE_BASE = f"git@github.com:{OWNER}" @@ -470,13 +471,13 @@ def pr_body(info: SiblingInfo, new_commit: str, checks: str, paths: Sequence[str ) -def _commit_env(repo: Path) -> dict[str, str]: - env = {"GIT_AUTHOR_EMAIL": COMMIT_EMAIL, "GIT_COMMITTER_EMAIL": COMMIT_EMAIL} - try: - _git(repo, "config", "user.name") - except GitError: - env |= {"GIT_AUTHOR_NAME": OWNER, "GIT_COMMITTER_NAME": OWNER} - return env +def _commit_env() -> dict[str, str]: + return { + "GIT_AUTHOR_NAME": OWNER, + "GIT_AUTHOR_EMAIL": COMMIT_EMAIL, + "GIT_COMMITTER_NAME": OWNER, + "GIT_COMMITTER_EMAIL": COMMIT_EMAIL, + } def release_sibling( @@ -558,7 +559,7 @@ def row(status: str, ok: bool, commit: str | None = None) -> StatusRow: subject = SYNC_SUBJECT_PREFIX + new[:7] body = f"shared.lock: {info.short_commit} -> {new[:7]} (scripts/sync_shared.py --update)\n\n" body += "\n".join(f"- {p}" for p in paths) - _git(sibling, "commit", "--quiet", "-m", subject, "-m", body, env=_commit_env(sibling)) + _git(sibling, "commit", "--quiet", "-m", subject, "-m", body, env=_commit_env()) except GitError as exc: if branch != default: _git(sibling, "switch", "--quiet", default) # the uncommitted changes come along diff --git a/tests/test_sync_all_siblings.py b/tests/test_sync_all_siblings.py index defcecd..9d6b2d1 100644 --- a/tests/test_sync_all_siblings.py +++ b/tests/test_sync_all_siblings.py @@ -410,6 +410,7 @@ def test_update_pr_opens_a_pr_only_for_siblings_that_pass(tmp_path: Path, portfo beta = make_git_sibling(tmp_path, "mcp-server-beta", "beta_mcp") # fails ruff check make_git_sibling(tmp_path, "mcp-server-gamma", "gamma_mcp") # this sync's PR already open delta = make_git_sibling(tmp_path, "mcp-server-delta", "delta_mcp") # someone's work in progress + git(alpha, "config", "user.name", "Real Name") # a developer's identity must not reach the commit tools.failing["mcp-server-beta"] = "ruff check" branch = f"sync-shared-{COMMIT_B[:7]}" gh.open[("mcp-server-gamma", branch)] = "https://github.example/mcp-server-gamma/pull/7" @@ -422,8 +423,8 @@ def test_update_pr_opens_a_pr_only_for_siblings_that_pass(tmp_path: Path, portfo assert remote_branches(tmp_path, "mcp-server-alpha") == ["main", branch] remote = tmp_path / "remotes" / "mcp-server-alpha.git" assert ( - git(remote, "log", "-1", "--format=%s|%ae", branch).strip() - == f"Sync shared to {COMMIT_B[:7]}|{mod.COMMIT_EMAIL}" + git(remote, "log", "-1", "--format=%s|%an|%ae|%cn|%ce", branch).strip() + == f"Sync shared to {COMMIT_B[:7]}|{mod.OWNER}|{mod.COMMIT_EMAIL}|{mod.OWNER}|{mod.COMMIT_EMAIL}" ) assert git(remote, "log", "-1", "--format=%s", "main").strip() == "initial" assert git(alpha, "branch", "--show-current").strip() == "main"