fix(git): let the forge judge commit signatures, refuse only unsigned commits locally #487
No reviewers
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea!487
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-424-lean-on-git-signing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Summary
The signature check refused every commit that git did not report as a good signature (
GorU). That includesE, "git cannot check it here". This is the normal state of an SSH-signed commit on a machine with no allowed-signers file, and of a GPG signature whose public key is not in the local keyring. The forge checks against the keys on the user's account, so it can accept a commit that the local check refused.The check is now split by what each side can prove:
CheckBranchSignaturesrefuses onlyN, a commit with no signature. Git can prove that alone, and it fails a signing requirement on any forge. Every signed commit passes, whatever its status on this machine.finishreads the forge's own verification of every commit the branch adds (VerifyBranchSignaturesOnForge: the commits API withverification=true,sha=<branch>,not=<base>). If the forge does not verify a commit,finishstops before it opens the PR. The refusal names each commit with the forge's reason and gives both remedies: fix the key on the forge account, or re-sign and push with--force.Both halves run only when a rule that covers the default branch sets
require_signed_commits. Both fail open on read errors. madtea copies none of the forge's key rules and holds no key material, so the check works the same for every signature format git supports. A plainpushkeeps only the local half, because a push opens no PR.ADR 0013 records this as a dated amendment.
Tests
Nrefuses.G,U,B,E,X,YandRpass. The existing gating and fail-open tests carry over.finish: the new step passes the target repo, the base and the branch, and returns the forge refusal unchanged.Closes #424