Skip to content

ci: restore the Claude Code workflow and .mcp.json, lost in the v2 tree swap - #1851

Closed
cliffhall wants to merge 2 commits into
v2/mainfrom
ci/restore-claude-workflow
Closed

ci: restore the Claude Code workflow and .mcp.json, lost in the v2 tree swap#1851
cliffhall wants to merge 2 commits into
v2/mainfrom
ci/restore-claude-workflow

Conversation

@cliffhall

@cliffhall cliffhall commented Jul 28, 2026

Copy link
Copy Markdown
Member

Same regression class as #1843 (SECURITY.md): the v2 tree swap replaced the default branch's tree, and neither .github/workflows/claude.yml nor .mcp.json existed in the v2 tree, so both were silently dropped.

Impact

issue_comment / pull_request_review_comment / issues events always run workflows from the default branch, so losing the workflow disabled @claude repo-wide — including on PRs targeting v2/main.

Found the hard way: two @claude review comments on #1847 (19:08 and 19:10 UTC) produced no bot reply and no workflow run.

Evidence

Check Result
actions/workflows/173749385 state deleted
Last 3 runs (issue_comment, latest 03:10 UTC today) all skipped
.github/workflows/ on main only main.yml
ac3c1a12 (last commit carrying the file) not an ancestor of current main

The change

Two files, both restored byte-for-byte, both verified after the copy:

File Source sha256 Bytes
.github/workflows/claude.yml ac3c1a12 1c44f2d9d51c936adb40c9acefd4b44628fe7810360e2f8196034347f9d2602d 3592
.mcp.json 47f92841 (v1/main) b0f0b8ea0d6c6e4bd9d19270db8c4ed13a951c6a7d8fa9a7b76d0d12ddd2491f 123

No content changes to either. The @claude trigger remains gated to OWNER / MEMBER / COLLABORATOR author associations, which is the behavior we want under the issues-only contribution model (#1820).

Why .mcp.json is in the same PR

The workflow runs with --mcp-config .mcp.json and --allowedTools "Bash,mcp__mcp-docs". .mcp.json registers the mcp-docs HTTP server (https://modelcontextprotocol.io/mcp) and was lost in the same swap — it survives only on v1/main:

git ls-tree --name-only origin/main .mcp.json     # (empty)
git ls-tree --name-only origin/v2/main .mcp.json  # (empty)
git ls-tree --name-only origin/v1/main .mcp.json  # .mcp.json

Restoring the workflow without it would register no MCP server, so the mcp__mcp-docs tools would not resolve and the protocol-documentation lookups that --append-system-prompt explicitly directs it to make would silently do nothing. Shipping them together avoids a window where the workflow is on v2/main pointing at a file that isn't.

Why this targets v2/main and not main

This PR originally targeted main. It now targets v2/main, the develop branch that merges into main at milestone releases.

The two branches share no common git ancestorgit merge-base main v2/main returns nothing, because the tree swap created unrelated histories. A branch cut from main and opened against v2/main therefore diffs the entire v1 tree against the entire v2 tree, which is what made this PR read as conflicted across a dozen files it never touched. It has been rebuilt on v2/main; the diff is now the two files above and nothing else.

Landing on v2/main is also what makes the fix durable: restoring only to main would be undone by the next milestone tree swap, which is precisely how these files were lost.

Verifying after merge

@claude cannot work until this reaches main, which happens at the next milestone merge — a workflow on a non-default branch is not consulted for issue_comment events. After that, comment @claude review on any open PR; claude[bot] should reply within ~20s (it took 19s on #1825). If it's needed before the milestone, that wants a separate direct-to-main PR in addition to this one.

Testing

No source files are touched, so nothing in validate or coverage measures this change — the format globs cover core/, scripts/, the shared surface, and each client's scope, none of which reach a workflow YAML or a root-level JSON. npx prettier --check .mcp.json passes. I did not run the full npm run ci gate, as it would measure nothing here.

Note

SECURITY.md (#1843, plus #1864/#1865 for the v2/main half), claude.yml, and .mcp.json are three instances of one pattern, and none was caught by CI. A sweep for anything else the swap dropped is worth doing separately — since the histories are unrelated, no git tooling will surface them on its own.

@cliffhall cliffhall added the v2 Issues and PRs for v2 label Jul 28, 2026
@cliffhall
cliffhall changed the base branch from main to v2/main July 31, 2026 17:35
@cliffhall
cliffhall changed the base branch from v2/main to main July 31, 2026 17:38
@cliffhall
cliffhall changed the base branch from main to v2/main July 31, 2026 17:40
Closes #1850.

Restored byte-for-byte from ac3c1a1 (sha256
1c44f2d9d51c936adb40c9acefd4b44628fe7810360e2f8196034347f9d2602d,
3592 bytes). No content changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAt8rqxysNbhYWLhoRm3fU
The restored workflow runs with `--mcp-config .mcp.json` and
`--allowedTools "Bash,mcp__mcp-docs"`, so without this file the mcp-docs
server never registers and those tools do not resolve.

Lost in the same tree swap: .mcp.json survives only on v1/main, and is
absent from both main and v2/main. Restored byte-for-byte from 47f9284
(sha256 b0f0b8ea0d6c6e4bd9d19270db8c4ed13a951c6a7d8fa9a7b76d0d12ddd2491f,
123 bytes). No content changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAt8rqxysNbhYWLhoRm3fU
@cliffhall cliffhall changed the title ci: restore the Claude Code workflow, lost in the v2 tree swap ci: restore the Claude Code workflow and .mcp.json, lost in the v2 tree swap Jul 31, 2026
@cliffhall
cliffhall requested review from Copilot and removed request for BobDickinson and olaservo July 31, 2026 19:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores the Claude Code GitHub Actions workflow and its .mcp.json MCP server configuration to the v2/main tree so the integration isn’t silently lost again in future tree swaps, and so @claude automation can be re-enabled once v2/main is merged back into the default branch.

Changes:

  • Add back .github/workflows/claude.yml to re-enable Claude Code triggers on issue/PR comment and review events.
  • Add back .mcp.json so the workflow’s --mcp-config .mcp.json and mcp__mcp-docs tool allowance can resolve the docs MCP server.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.mcp.json Restores MCP server configuration used by the Claude workflow (mcp-docs HTTP server).
.github/workflows/claude.yml Restores the Claude Code workflow that reacts to @claude mentions and runs the Claude Code action.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +54 to +61
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});

core.setOutput('sha', pr.data.head.sha);
core.setOutput('repo', pr.data.head.repo.full_name);
Comment on lines +26 to +28
(github.event_name == 'issues' &&
(contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) &&
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association))
@cliffhall

Copy link
Copy Markdown
Member Author

Superseded by #1869 — same commits, same content.

This PR was auto-closed by GitHub when its head branch was renamed ci/restore-claude-workflowv2/ci/restore-claude-workflow (to satisfy the version-prefix branch convention). GitHub's rename API is documented as updating open PRs, but it closed this one instead, and it can't be reopened because the original head ref no longer exists. Same thing happened to #1865#1867.

#1869's description also corrects a claim made here: this PR said main and v2/main share no common ancestor. They do — merge base 4d30d1cd, established by the go-live merge (#1830). That finding came from running git merge-base in a shallow clone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Code workflow (.github/workflows/claude.yml) and .mcp.json lost in the v2 tree swap — @claude no longer triggers

2 participants