Skip to content

Commit b5cea9d

Browse files
authored
Merge pull request #5055 from modelcontextprotocol/v2/chore/4919-dco-check
Add a DCO signoff check to CI and the gate
2 parents 88c4037 + 988aa91 commit b5cea9d

9 files changed

Lines changed: 677 additions & 51 deletions

File tree

‎.claude/skills/pr-flow/SKILL.md‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,19 @@ This repo adopted the [Developer Certificate of
6767
Origin](https://developercertificate.org/) (maintainer decision on #4861).
6868
Commit with **`git commit -s`**, every time.
6969

70-
⚠️ **The [probot DCO app](https://probot.github.io/apps/dco/) is not installed on
71-
this repo yet**, so today nothing fails an unsigned commit. Installing it is an
72-
org-admin step (#4867). Sign off anyway: once the app is on, it checks
73-
every commit in a PR, so an unsigned commit pushed today becomes a red check
74-
that can only be cleared by rewriting history. Once the app enforces the check,
75-
`AGENTS.md` gains the signoff rule and this paragraph goes.
76-
77-
What the app checks: each commit carries a `Signed-off-by: Name <email>` trailer
70+
The rule is checked twice, by the same script (`scripts/verify-dco.mjs`):
71+
72+
- **`npm run verify:dco`**, a stage of the pre-push gate (step 4), over
73+
`origin/v2/main..HEAD`: the commits you are about to push. Name another
74+
range with `-- --base <rev> --head <rev>` (a stacked branch's base, say).
75+
- **The `DCO signoff` job** (`.github/workflows/dco.yml`), on every pull
76+
request except into `main`, over the PR's `base.sha..head.sha`.
77+
78+
What it checks: each commit carries a `Signed-off-by: Name <email>` trailer
7879
whose name **and** email match the commit's author or its committer. Merge
7980
commits and bot-authored commits are exempt. There is no partial credit: one
80-
unsigned commit out of six fails the whole check.
81+
unsigned commit out of six fails the whole check. The failure names each
82+
unsigned commit and prints the repair below.
8183

8284
Two things that look like automation and are not:
8385

@@ -90,20 +92,19 @@ Two things that look like automation and are not:
9092
`git var GIT_AUTHOR_IDENT` returns your config identity rather than the
9193
preserved author, so it cannot even tell it is signing for someone else.
9294

93-
**Repairing commits already pushed** means rewriting them:
95+
**Repairing commits already made** means rewriting them, onto the merge base
96+
the failure prints:
9497

9598
```sh
96-
git rebase HEAD~<n> --signoff
99+
git rebase --signoff <merge-base>
97100
git push --force-with-lease
98101
```
99102

100-
Use `--force-with-lease` rather than `--force`, and rewrite only when you are the
101-
sole author and nobody has based work on the branch (a stacked PR above yours
102-
has). The two apparent alternatives are not alternatives: the app's empty
103-
"remediation commit" flow needs `allowRemediationCommits.individual`, and this
104-
repo ships no `.github/dco.yml`, so it is disabled; and the override button that
105-
anyone with write access sees only silences the check, with nobody certifying
106-
anything.
103+
`--signoff` signs each commit as you, the committer. Use `--force-with-lease`
104+
rather than `--force`, and rewrite only when you are the sole author and
105+
nobody has based work on the branch (a stacked PR above yours has). Nothing
106+
else clears the check: an empty "remediation" commit signs nothing that came
107+
before it, and the check reads every commit in the range.
107108

108109
The signoff is a DCO assertion made in **your own name**. It does not claim you
109110
wrote the code, so signing off a cherry-pick is legitimate. Fabricating

‎.claude/skills/pre-push-gate/SKILL.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,20 @@ repo root**, commit the lockfile if it changed, and re-run. It is the first stag
5454
passes every static check and fails later as a test reporting the _old_
5555
dependency's behavior. Do not "fix" that test.
5656

57+
### `verify:dco`
58+
59+
A commit in `origin/v2/main..HEAD` has no `Signed-off-by:` trailer, or one
60+
whose name and email match neither its author nor its committer. The output
61+
names each commit and the repair: `git rebase --signoff <merge-base>`, then
62+
`git push --force-with-lease` if it was already pushed. Commit with
63+
`git commit -s` from then on. The rule, and when a rewrite is safe, is
64+
`pr-flow` step 3.
65+
66+
"cannot resolve origin/v2/main" means the ref is missing from this clone:
67+
`git fetch origin v2/main`. On a stacked branch the gate also checks the lower
68+
branch's commits; `npm run verify:dco -- --base <lower branch>` checks only
69+
yours.
70+
5771
### `format:check` / `format:check:root`
5872

5973
Run `npm run format` at the **root**. It covers `scripts/`, the root configs

‎.github/workflows/dco.yml‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: DCO
2+
3+
# Every commit a pull request adds carries a DCO signoff (#4919). It replaces
4+
# the probot DCO app, which never ran on this repo. The rule and its two
5+
# exemptions (merge commits, bot-authored commits) are in
6+
# `scripts/verify-dco.mjs`; `local:gate` runs the same script over
7+
# `origin/v2/main..HEAD` before a push.
8+
#
9+
# On `pull_request`, unlike typescript.yml and python.yml: only a PR knows its
10+
# base, and the range to check is exactly `base.sha..head.sha`. `edited` is
11+
# there so retargeting a stacked PR re-checks its new range. PRs into `main`
12+
# are skipped: the only one is a milestone merge, whose commits were each
13+
# checked on their way into `v2/main`, and whose range reaches back past the
14+
# adoption of the rule.
15+
on:
16+
pull_request:
17+
types: [opened, synchronize, reopened, edited]
18+
branches-ignore: [main]
19+
20+
# Read-only, and handed no secret, so this job holds no credential and stays
21+
# outside the SHA-pin rule (`verify:action-pins`).
22+
permissions:
23+
contents: read
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
dco:
31+
timeout-minutes: 5
32+
name: DCO signoff
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v6
36+
with:
37+
ref: ${{ github.event.pull_request.head.sha }}
38+
# The whole history, so both ends of the range and their merge base
39+
# are present.
40+
fetch-depth: 0
41+
persist-credentials: false
42+
43+
- uses: actions/setup-node@v7
44+
with:
45+
node-version: 22
46+
47+
# Node built-ins and git only, so no `npm ci`.
48+
- name: Check every commit is signed off
49+
env:
50+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
51+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
52+
run: npm run verify:dco -- --base "$BASE_SHA" --head "$HEAD_SHA"

‎AGENTS.md‎

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ not in advance.
1919

2020
## Skills index
2121

22-
| Skill | Covers | How it loads |
23-
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
24-
| [`board-ops`](.claude/skills/board-ops/SKILL.md) | `gh project` recipes and the IDs for the Servers V2 board (#43); resolving option IDs by name; the option-deletion hazard and its recovery | Model-invoked, or `/board-ops` |
25-
| [`issue-create`](.claude/skills/issue-create/SKILL.md) | The create flow: duplicate check, `v2` + type + server-scope labels, milestone, board card, Status + Priority, and the query that verifies them | Model-invoked, or `/issue-create` |
26-
| [`pr-flow`](.claude/skills/pr-flow/SKILL.md) | Issue to PR: branch, DCO signoff and repair, the gate, client evidence, `addCloseIssueReferences`, the Copilot loop and its exits, close-out on merge | Model-invoked, or `/pr-flow` |
27-
| [`issue-triage`](.claude/skills/issue-triage/SKILL.md) | Inflow: the class check and canned responses (listings, new servers, duplicates, outside PRs), pass 1 onto the board as Incoming, the priority rubric and its score comment, the board audit | Model-invoked, or `/issue-triage` |
28-
| [`pre-push-gate`](.claude/skills/pre-push-gate/SKILL.md) | Running `npm run local:gate` and reading its result; what each stage checks and how to fix it when it fails; waiting on the gate lease | Model-invoked, or `/pre-push-gate` |
29-
| [`security-advisory`](.claude/skills/security-advisory/SKILL.md) | A privately reported vulnerability end to end: the `[GHSA-…]` draft card, server or SDK ownership, the reach classes, accepting, the private fork, publishing, public tracking | Model-invoked, or `/security-advisory` |
30-
| [`project-structure`](.claude/skills/project-structure/SKILL.md) | What is inside each server: the TypeScript and Python layouts, where each server registers its features, and where a new file goes | Model-invoked, or `/project-structure` |
31-
| [`local-dev`](.claude/skills/local-dev/SKILL.md) | Install, build and run each server from the checkout over the transports it implements; local `npx`/`uvx` and client-config runs; stale builds and fresh worktrees; the `overrides`, lockstep and `uv.lock` procedures | Model-invoked, or `/local-dev` |
32-
| [`testing`](.claude/skills/testing/SKILL.md) | The in-process protocol-level harness, test placement, the commands per suite, `test` versus `coverage`, and clearing the per-file coverage gate | Model-invoked, or `/testing` |
33-
| [`release`](.claude/skills/release/SKILL.md) | A milestone release end to end: the release issue, the preparation PRs on `v2/main` (audit, Version Packages, Python CalVer), the pure `v2/main` → `main` merge PR, the release ledger, and what a maintainer publishes | **Name-only**: `/release` |
34-
| [`client-smoke`](.claude/skills/client-smoke/SKILL.md) | Driving a built server with the Inspector CLI (the scripted path), the Inspector web UI (by hand) and an LLM client; the CLI's argument split and exit codes; protocol eras and what can be exercised today | Model-invoked, or `/client-smoke` |
22+
| Skill | Covers | How it loads |
23+
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
24+
| [`board-ops`](.claude/skills/board-ops/SKILL.md) | `gh project` recipes and the IDs for the Servers V2 board (#43); resolving option IDs by name; the option-deletion hazard and its recovery | Model-invoked, or `/board-ops` |
25+
| [`issue-create`](.claude/skills/issue-create/SKILL.md) | The create flow: duplicate check, `v2` + type + server-scope labels, milestone, board card, Status + Priority, and the query that verifies them | Model-invoked, or `/issue-create` |
26+
| [`pr-flow`](.claude/skills/pr-flow/SKILL.md) | Issue to PR: branch, DCO signoff and repair, the gate, client evidence, `addCloseIssueReferences`, the Copilot loop and its exits, close-out on merge | Model-invoked, or `/pr-flow` |
27+
| [`issue-triage`](.claude/skills/issue-triage/SKILL.md) | Inflow: the class check and canned responses (listings, new servers, duplicates, outside PRs), pass 1 onto the board as Incoming, the priority rubric and its score comment, the board audit | Model-invoked, or `/issue-triage` |
28+
| [`pre-push-gate`](.claude/skills/pre-push-gate/SKILL.md) | Running `npm run local:gate` and reading its result; what each stage checks and how to fix it when it fails; waiting on the gate lease | Model-invoked, or `/pre-push-gate` |
29+
| [`security-advisory`](.claude/skills/security-advisory/SKILL.md) | A privately reported vulnerability end to end: the `[GHSA-…]` draft card, server or SDK ownership, the reach classes, accepting, the private fork, publishing, public tracking | Model-invoked, or `/security-advisory` |
30+
| [`project-structure`](.claude/skills/project-structure/SKILL.md) | What is inside each server: the TypeScript and Python layouts, where each server registers its features, and where a new file goes | Model-invoked, or `/project-structure` |
31+
| [`local-dev`](.claude/skills/local-dev/SKILL.md) | Install, build and run each server from the checkout over the transports it implements; local `npx`/`uvx` and client-config runs; stale builds and fresh worktrees; the `overrides`, lockstep and `uv.lock` procedures | Model-invoked, or `/local-dev` |
32+
| [`testing`](.claude/skills/testing/SKILL.md) | The in-process protocol-level harness, test placement, the commands per suite, `test` versus `coverage`, and clearing the per-file coverage gate | Model-invoked, or `/testing` |
33+
| [`release`](.claude/skills/release/SKILL.md) | A milestone release end to end: the release issue, the preparation PRs on `v2/main` (audit, Version Packages, Python CalVer), the pure `v2/main` → `main` merge PR, the release ledger, and what a maintainer publishes | **Name-only**: `/release` |
34+
| [`client-smoke`](.claude/skills/client-smoke/SKILL.md) | Driving a built server with the Inspector CLI (the scripted path), the Inspector web UI (by hand) and an LLM client; the CLI's argument split and exit codes; protocol eras and what can be exercised today | Model-invoked, or `/client-smoke` |
3535

3636
A PR that adds a skill under `.claude/skills/<name>/SKILL.md` adds its row to
3737
this table in the same change, and the table never lists a skill that does not
@@ -120,7 +120,8 @@ npm run local:gate
120120

121121
**Run `npm run local:gate` before every push, and push only when it exits 0.**
122122
It runs every check CI runs, for both languages, in one command:
123-
`verify:install-fresh`, the root `validate` (the guards, then each TypeScript
123+
`verify:install-fresh`, `verify:dco` (every commit since `origin/v2/main` is
124+
signed off), the root `validate` (the guards, then each TypeScript
124125
workspace's format check, lint, typecheck, build and tests), `coverage` (each
125126
TypeScript workspace's per-file coverage gate), `validate:py`
126127
(each Python server's locked sync, `ruff check`, `ruff format --check`,
@@ -252,6 +253,15 @@ together.
252253
PR merges to `v2/main`. The server dropdown in each form does not label the
253254
issue; triage applies the `server-<name>` scope label from it.
254255

256+
**Every commit is signed off** under the [Developer Certificate of
257+
Origin](https://developercertificate.org/) (adopted on #4861): commit with
258+
`git commit -s`, so the message ends in a `Signed-off-by: Name <email>`
259+
trailer whose name and email match the commit's author or committer. Merge
260+
commits and bot-authored commits are exempt. `verify:dco` checks it in the
261+
pre-push gate, and the **DCO signoff** job (`.github/workflows/dco.yml`) checks
262+
every commit a pull request adds; one unsigned commit fails it. The repair
263+
(`git rebase --signoff`) is in the `pr-flow` skill.
264+
255265
**Every PR references an issue.** The PR body's first line is
256266
`Closes #<ISSUE_NUMBER>`. A PR with no linked issue has no board card, so the
257267
work is invisible to the board. If there is no issue yet, create it first. This
@@ -328,11 +338,12 @@ from happening. How to write a description that fires, and eval cases that
328338
measure it, is [`docs/skill-authoring.md`](./docs/skill-authoring.md).
329339

330340
1. **`npm run verify:skills` must pass.** It runs inside `validate:guards`, and
331-
CI runs it with `verify:skills:cli` (the authoritative `claude plugin
332-
validate`, at a pinned CLI version) on every push and pull request. It parses
333-
each `SKILL.md`'s frontmatter the way Claude Code does. Malformed YAML loads
334-
the body with an _empty_ description, so `/name` still works while the skill
335-
can never auto-fire; an unquoted `#` truncates the description silently.
341+
CI runs it with `verify:skills:cli` (the authoritative
342+
`claude plugin validate`, at a pinned CLI version) on every push and pull
343+
request. It parses each `SKILL.md`'s frontmatter the way Claude Code does.
344+
Malformed YAML loads the body with an _empty_ description, so `/name` still
345+
works while the skill can never auto-fire; an unquoted `#` truncates the
346+
description silently.
336347
**Quote any description containing `#` or `:`**, and keep the opening `---`
337348
on the file's first line.
338349
2. **Every skill declares `disable-model-invocation` explicitly. Default it to

0 commit comments

Comments
 (0)