Skip to content

Commit df05c88

Browse files
committed
fix(ci): the low-risk tier requires commits committed and signed by GitHub
A git author is a declared e-mail and a verified signature vouches for the committer's key, so a contributor could sign a commit under Dependabot's name on a Dependabot branch. The tier now also requires committer web-flow. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYsWnKSjpX4oNV19PCF
1 parent 5ec3aea commit df05c88

4 files changed

Lines changed: 19 additions & 5 deletions

‎.github/workflows/pipeline-post-merge.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ jobs:
372372
"""True for a Dependabot minor or patch update of the dependency files.
373373
374374
The tier comes from the change, not from a label or a title (ADR-1126): the
375-
PR and each of its commits are Dependabot's (GitHub verified signature),
375+
PR and each of its commits are Dependabot's (committed and signed by GitHub),
376376
every update it declares is minor or patch, and it touches nothing outside
377377
LOW_RISK_FILES. Such a PR merges on green required checks without a review.
378378
"""
@@ -386,7 +386,13 @@ jobs:
386386
detail = commit.get("commit") or {}
387387
signed = (detail.get("verification") or {}).get("verified") is True
388388
author = (commit.get("author") or {}).get("login")
389-
if author != "dependabot[bot]" or not signed:
389+
# A git author is only a declared e-mail, and `verified` vouches for
390+
# the committer's key. Dependabot's commits are committed and signed
391+
# by GitHub itself (`web-flow`), where the author is the acting
392+
# account and cannot be chosen.
393+
# source: https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification
394+
committer = (commit.get("committer") or {}).get("login")
395+
if author != "dependabot[bot]" or committer != "web-flow" or not signed:
390396
return False
391397
updates += re.findall(
392398
r"^\s*update-type: (\S+)\s*$", detail.get("message") or "", re.M

‎docs/adr/ADR-1126-a-dependabot-minor-or-patch-update-of-the-dependency-files-merges-without-a-review.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Anthropic describes the same problem and its answer in "Solving code review at A
2323
## Decision
2424

2525
1. The resolver computes a tier from the change itself. A pull request is low risk when all of these hold:
26-
- its author is `dependabot[bot]`, and every commit is authored by `dependabot[bot]` with a signature GitHub verified;
26+
- its author is `dependabot[bot]`, and every commit is authored by `dependabot[bot]`, committed by GitHub (`web-flow`) and carries a verified signature. The author alone is a declared e-mail and `verified` vouches for the committer's key, so a commit a person signs under Dependabot's name is refused;
2727
- every `update-type` its commit messages declare is `version-update:semver-minor` or `version-update:semver-patch`, and there is at least one;
2828
- every file it changes is `uv.lock` or `pyproject.toml`.
2929
2. A low-risk pull request merges without a Claude verdict. Everything else of the merge path is unchanged: the `Pipeline` run of the head succeeded, the branch protection still requires `merge` and `CodeQL`, and a `hold` or `do-not-merge` label or a "do not merge" title still holds it.

‎tests_py/scripts/test_ci_low_risk_tier.py‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ def resolver():
2323
return namespace
2424

2525

26-
def commit(updates=(PATCH,), author="dependabot[bot]", verified=True):
26+
def commit(
27+
updates=(PATCH,), author="dependabot[bot]", verified=True, committer="web-flow"
28+
):
2729
lines = "".join(f"- dependency-name: x\n update-type: {u}\n" for u in updates)
2830
return {
2931
"author": {"login": author},
32+
"committer": {"login": committer},
3033
"commit": {
3134
"message": f"deps: bump x\n\n---\nupdated-dependencies:\n{lines}...\n",
3235
"verification": {"verified": verified},
@@ -93,6 +96,11 @@ def test_another_author_or_an_unsigned_commit_is_not(self):
9396
self.assertFalse(self.low([commit(), commit(author="cdeust")]))
9497
self.assertFalse(self.low([commit(verified=False)]))
9598

99+
def test_a_bot_attributed_commit_signed_by_a_person_is_not(self):
100+
# Dependabot's e-mail as author, a contributor's own verified key.
101+
self.assertFalse(self.low([commit(), commit(committer="cdeust")]))
102+
self.assertFalse(self.low([commit(committer=None)]))
103+
96104
def test_a_low_risk_pr_merges_without_a_review(self):
97105
api = FakeApi([commit()], ("uv.lock",))
98106
merge = resolver()["_merge_open_pr"]

‎wiki/adr/cortex/1126-a-dependabot-minor-or-patch-update-of-the-dependency-files-merges-without-a-review.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Anthropic describes the same problem and its answer in "Solving code review at A
2121
## Decision
2222

2323
1. The resolver computes a tier from the change itself. A pull request is low risk when all of these hold:
24-
- its author is `dependabot[bot]`, and every commit is authored by `dependabot[bot]` with a signature GitHub verified;
24+
- its author is `dependabot[bot]`, and every commit is authored by `dependabot[bot]`, committed by GitHub (`web-flow`) and carries a verified signature. The author alone is a declared e-mail and `verified` vouches for the committer's key, so a commit a person signs under Dependabot's name is refused;
2525
- every `update-type` its commit messages declare is `version-update:semver-minor` or `version-update:semver-patch`, and there is at least one;
2626
- every file it changes is `uv.lock` or `pyproject.toml`.
2727
2. A low-risk pull request merges without a Claude verdict. Everything else of the merge path is unchanged: the `Pipeline` run of the head succeeded, the branch protection still requires `merge` and `CodeQL`, and a `hold` or `do-not-merge` label or a "do not merge" title still holds it.

0 commit comments

Comments
 (0)